Developers
The PZOS API and webhooks
Read bills, day figures, bookings, enquiries and deals. Send enquiries in from your website. Hear about bills and bookings as they happen. For your IT team, your data team and your website.
curl "https://api.pzos.app/v1/bills?limit=50" \
-H "Authorization: Bearer pz_live_…"
{
"data": [
{
"id": "9e1d…",
"number": "PHL/26-27/1204",
"branch_id": "b6f4…",
"total": 21240.00,
"lines": [
"…"
]
}
],
"next_cursor": "eyJhdCI6…"
} Get started
- Make a key. An owner makes one in Head office › Setup › API keys, for one job (“Website”, “Data team”), with what it may do and at which branches. It is shown once; PZOS keeps only its hash.
- Call the API. Send the key as
Authorization: Bearer pz_live_…(orx-api-key). Every answer is JSON; times have their offset; amounts are in the bill’s currency with two decimals. - Pull what changed. Ask with
?since=every few minutes, or add a webhook and hear as it happens.
The address is https://api.pzos.app/v1. The API is on the Enterprise plan.
Keys and scopes
A key is pz_live_ and 32 letters and digits. Each has its scopes and its branches (all of them, now and later, or chosen ones). Replace makes a new key with the same settings and stops the old one at once; Switch off stops it at once. Both, and every call, are recorded.
catalogueRead branches, items and pricesbillsRead bills: lines, GST, payments and voidsfiguresRead the day figures saved at day closebookingsRead bookings, parties and group visitsleadsRead Sales leads (with Enquiries and deals on, the deals under their old name)leads_inSend a lead in (the old address, kept as an alias)enquiriesRead enquiries · Needs Enquiries and deals switched ondealsRead deals · Needs Enquiries and deals switched onquotesRead quotes · Needs Enquiries and deals switched onenquiries_inSend an enquiry in · Needs Enquiries and deals switched onpersonalRead families’ names and mobiles, and the contact details on leads, enquiries and deals · Off unless the owner ticks itgatesCheck wristbands at a gate or turnstile · One key per gate; 600 calls a minuteCalls
GET/v1/branchesBranches
The key’s branches. Scope catalogue.
Each row
id- The branch’s id, used everywhere else as branch_id
name, status- Its name, and setting_up, live, paused or closed
brand_id, region_id- Its brand and region, where the business has them
city, state, country, time_zone- Where it is; business dates are in its time zone
format- mall, standalone, play_cafe or other
Example
curl
curl "https://api.pzos.app/v1/branches?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/branches?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/branches", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "b6f4…",
"name": "Gachibowli",
"status": "live",
"brand_id": "1c0e…",
"region_id": "7d2a…",
"city": "Hyderabad",
"state": "Telangana",
"country": "IN",
"time_zone": "Asia/Kolkata",
"format": "mall"
}
],
"next_cursor": null
} GET/v1/itemsItems and prices
Every item with each branch’s price. Scope catalogue.
Each row
id, name, kind- The item, and its kind: play_package, extension, group_package, party, food_beverage, merchandise, pass, set_menu…
category_id, stream, sku- Its category, the stream it counts in, and its code
gst_rate, hsn_sac- GST rate in per cent, and its HSN or SAC code
minutes- Play time a play package gives
active- Whether it is on sale
prices[]- branch_id, price, extra_price and available at each of the key’s branches
Example
curl
curl "https://api.pzos.app/v1/items?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/items?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/items", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "42aa…",
"name": "1 hour play",
"kind": "play_package",
"stream": "play",
"gst_rate": 18,
"hsn_sac": "[SAC]",
"minutes": 60,
"active": true,
"prices": [
{
"branch_id": "b6f4…",
"price": 400.00,
"extra_price": 200.00,
"available": true
}
]
}
],
"next_cursor": null
} GET/v1/billsBills
Bills made or voided, with lines, GST and payments. Practice bills never. Scope bills.
Each row
id, number, branch_id, business_date- The bill, its number in its company’s series, and its branch and business date
type, status, supply- sale or refund; final or void; intra or inter (state)
currency, gross, taxable, tax, round_off, total- The amounts, in the bill’s currency with two decimals (prices include GST)
buyer_name, buyer_tax_id, buyer_state- A company bill’s buyer and GSTIN; empty for families
visit_id, created_at- The visit it closed, and when it was made
voided_at, void_reason- When and why it was voided
changed_at- Made or voided, whichever is later: what since and the cursor follow
lines[]- line, item_id, stream, description, qty, price, gst_rate, hsn_sac, gross, taxable, tax, discount
taxes[]- component (cgst, sgst, igst) and amount
payments[]- mode (cash, upi, card, online, bank_transfer, pass, gift_card, credit, on_account…), amount, status (received, paid_back, void) and at
Example
curl
curl "https://api.pzos.app/v1/bills?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/bills?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/bills", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "9e1d…",
"branch_id": "b6f4…",
"number": "PHL/26-27/1204",
"business_date": "2026-12-06",
"type": "sale",
"status": "final",
"supply": "intra",
"currency": "INR",
"gross": 21240.00,
"taxable": 18000.00,
"tax": 3240.00,
"round_off": 0.00,
"total": 21240.00,
"buyer_name": "Sunrise Public School",
"buyer_tax_id": "36AABTS7781K1ZQ",
"buyer_state": "Telangana",
"visit_id": "5c77…",
"created_at": "2026-12-06T12:04:11+05:30",
"voided_at": null,
"void_reason": null,
"changed_at": "2026-12-06T12:04:11+05:30",
"lines": [
{
"line": 1,
"item_id": "42aa…",
"stream": "play",
"description": "School group play, 2 hours",
"qty": 32,
"price": 590.00,
"gst_rate": 18,
"hsn_sac": "[SAC]",
"gross": 18880.00,
"taxable": 16000.00,
"tax": 2880.00,
"discount": 0.00
}
],
"taxes": [
{
"component": "cgst",
"amount": 1620.00
},
{
"component": "sgst",
"amount": 1620.00
}
],
"payments": [
{
"mode": "upi",
"amount": 21240.00,
"status": "received",
"at": "2026-12-06T12:04:30+05:30"
}
]
}
],
"next_cursor": "eyJhdCI6…"
} GET/v1/daysDay figures
The figures each branch saves when it closes its day. Scope figures.
Each row
id- <branch_id>:<business_date>
branch_id, business_date, saved_at- The branch, its day, and when the figures were saved (saved again if the day reopens and closes)
takings, bills, gst- Final bills with GST, how many, and the GST in them; refunds count as minus
play, cafe, merchandise, other, discounts, overtime- Takings by stream after discounts, the discounts, and overtime charged
paid- Money taken by way of paying, like {"cash": 1200.00, "upi": …}
visits, kids, family_kids, group_kids, party_kids- Visits and children, by kind of visit
stay_minutes, stay_kids- For the average stay across any number of days
…- and the other figures the Day summary shows
Example
curl
curl "https://api.pzos.app/v1/days?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/days?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/days", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "b6f4…:2026-12-06",
"branch_id": "b6f4…",
"business_date": "2026-12-06",
"saved_at": "2026-12-06T22:41:02+05:30",
"takings": 184320.00,
"bills": 212,
"gst": 28116.00,
"play": 131200.00,
"cafe": 48760.00,
"merchandise": 4360.00,
"discounts": 2100.00,
"overtime": 3800.00,
"paid": {
"cash": 41200.00,
"upi": 121620.00,
"card": 21500.00
},
"visits": 176,
"kids": 241
}
],
"next_cursor": null
} GET/v1/bookingsBookings
Bookings, parties and group visits; the family by id only (ids only, never a name or a mobile). Scope bookings.
Each row
id, number, branch_id- The booking and its branch
kind, status, source- The kind of booking; enquiry, confirmed, arrived, cancelled or no_show; desk, parent (the family app) or office
starts_at, ends_at, room_id, package_item_id- When, where and which package
expected_kids, expected_adults, quoted_total- Guests expected and the quoted total
account_id, family_id, visit_id- The school or company, the family, and the visit on the day
created_at, updated_at- Made and last changed
Example
curl
curl "https://api.pzos.app/v1/bookings?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/bookings?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/bookings", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "a01c…",
"number": "BK-0412",
"branch_id": "b6f4…",
"kind": "party",
"status": "confirmed",
"source": "desk",
"starts_at": "2026-12-13T16:00:00+05:30",
"ends_at": "2026-12-13T18:00:00+05:30",
"expected_kids": 18,
"expected_adults": 10,
"quoted_total": 24500.00,
"family_id": "3f9b…",
"created_at": "2026-12-01T11:20:00+05:30",
"updated_at": "2026-12-05T18:02:00+05:30"
}
],
"next_cursor": null
} GET/v1/leadsLeads
Sales leads and their stage. With Enquiries and deals on, the deals under their old name (number D-…). Scope leads.
Each row
id, number, branch_id, kind, title- The lead
stage, source, wanted_date, kids, adults, estimated_value- Where it stands and what is wanted
owner_id, account_id, family_id, booking_id- Who owns it, and what it is linked to
created_at, updated_at, closed_at- Its times
contact_name, contact_phone, contact_email- Only with the personal scope
Example
curl
curl "https://api.pzos.app/v1/leads?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/leads?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/leads", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "c11e…",
"number": "L-0088",
"branch_id": "b6f4…",
"kind": "school",
"title": "Annual day outing",
"stage": "quote_sent",
"source": "website",
"wanted_date": "2027-01-20",
"kids": 60,
"adults": 6,
"estimated_value": 36000.00,
"created_at": "2026-12-02T10:00:00+05:30",
"updated_at": "2026-12-04T15:30:00+05:30",
"closed_at": null
}
],
"next_cursor": null
} GET/v1/enquiriesEnquiries
Enquiries from every channel. Scope enquiries. Pages of up to 200, with the true total.
Filters
status- new, contacted, qualified or not_qualified
channel- whatsapp, website, phone, walk_in, api, import…
Each row
id, number, branch_id, kind, title- The enquiry (number E-…); a group enquiry may have no branch
status, channel- Where it stands and where it came from
not_qualified_reason, not_qualified_reason_key- Why not: spam, wrong_number, just_asking_prices, outside_our_area, duplicate, no_reply or other
auto_closed, merged_into, spam- Closed by itself as No reply; merged; marked spam
family_id, account_id, deal_id, deal_number, old_number- Who it is from, and the deal it became
wanted_date, kids, adults, owner_id, first_reply_at- What is wanted, who has it, first reply
created_at, updated_at, closed_at- Its times
contact_name, contact_phone, contact_email, message- Only with the personal scope
Example
curl
curl "https://api.pzos.app/v1/enquiries?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/enquiries?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/enquiries", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "e7d0…",
"number": "E-1042",
"branch_id": "b6f4…",
"kind": "party",
"status": "new",
"channel": "website",
"wanted_date": "2026-12-20",
"kids": 15,
"adults": 8,
"family_id": null,
"deal_id": null,
"created_at": "2026-12-06T09:12:00+05:30"
}
],
"total": 37,
"next_cursor": null
} GET/v1/dealsDeals
Deals for families and accounts. Scope deals. Pages of up to 200, with the true total.
Filters
stage- open, quote_sent, negotiating, won or lost
family_id- One family’s deals
account_id- One school’s or company’s deals
Each row
id, number, old_number, branch_id, kind, title- The deal (D-…), and the L- number it had
stage, stage_at, source, chance, expected_close- Where it stands
family_id, account_id, contact_id- Who it is for, by id
wanted_date, kids, adults, value- What is wanted and its value
owner_id, booking_id, made_for_booking- Who owns it; its booking; a desk quotation’s quiet deal
won_at, lost_reason, created_at, updated_at, closed_at- How and when it ended
contact_name, contact_phone, contact_email- Only with the personal scope
Example
curl
curl "https://api.pzos.app/v1/deals?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/deals?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/deals", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "d5a2…",
"number": "D-0301",
"old_number": "L-0088",
"branch_id": "b6f4…",
"kind": "school",
"stage": "quote_sent",
"value": 36000.00,
"chance": 60,
"expected_close": "2026-12-15",
"account_id": "8b31…"
}
],
"total": 12,
"next_cursor": null
} GET/v1/quotesQuotes
Every version of every option, desk quotations too. Scope quotes. Pages of up to 200, with the true total.
Filters
status- draft, discount_not_approved, sent, viewed, accepted, declined, expired, not_chosen or replaced
deal_id- One deal’s quotes
Each row
id, number, version, option, deal_id, deal_number, branch_id- The quote, its version and option (A, B…)
status, title, kids, adults, starts_at, room_id, package_item_id- What it offers
lines[]- name, stream, quantity, unit_price, amount, gst_rate_bp (GST in hundredths of a per cent), hsn_sac
gross, discount, total, deposit, valid_until, discount_approval- Its money
sent_at, sent_via, sent_together, views, viewed_at- How it went out and was opened
accepted_at, accepted_via, declined_at, declined_reason, not_chosen_at, expired_at, replaced_at- What became of it
booking_id, created_at, updated_at- The booking made from it
accepted_name- Who said yes, only with the personal scope
Example
curl
curl "https://api.pzos.app/v1/quotes?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/quotes?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/quotes", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "q0b8…",
"number": "Q-0215",
"version": 2,
"option": "A",
"deal_id": "d5a2…",
"status": "sent",
"total": 36000.00,
"deposit": 10000.00,
"valid_until": "2026-12-15",
"lines": [
{
"name": "School group play, 2 hours",
"stream": "play",
"quantity": 60,
"unit_price": 600.00,
"amount": 36000.00,
"gst_rate_bp": 1800,
"hsn_sac": "[SAC]"
}
]
}
],
"total": 4,
"next_cursor": null
} GET/v1/familiesFamilies
Families and their children. Erased families never. Scope personal.
Each row
id, name, mobile, email, area- The family
children[]- name and date_of_birth
created_at, updated_at- Its times
Example
curl
curl "https://api.pzos.app/v1/families?since=2026-12-01T00:00:00%2B05:30" \
-H "Authorization: Bearer $PZOS_KEY"Node
let cursor = null;
do {
const q = new URLSearchParams({ since: '2026-12-01T00:00:00+05:30', ...(cursor && { cursor }) });
const res = await fetch(`https://api.pzos.app/v1/families?${q}`, { headers: { Authorization: `Bearer ${process.env.PZOS_KEY}` } });
const page = await res.json();
if (!res.ok) throw new Error(`${res.status} ${page.error}: ${page.message}`); // 429: wait retry-after seconds
save(page.data);
cursor = page.next_cursor;
} while (cursor);Python
import os, requests
params = {"since": "2026-12-01T00:00:00+05:30"}
while True:
res = requests.get("https://api.pzos.app/v1/families", params=params,
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"})
res.raise_for_status() # 429: wait retry-after seconds
page = res.json()
save(page["data"])
if not page["next_cursor"]:
break
params["cursor"] = page["next_cursor"]The answer
{
"data": [
{
"id": "3f9b…",
"name": "Ananya Rao",
"mobile": "+919800000000",
"email": null,
"area": "Kondapur",
"children": [
{
"name": "Ishaan",
"date_of_birth": "2021-08-14"
}
],
"created_at": "2026-11-02T17:40:00+05:30",
"updated_at": "2026-12-01T12:00:00+05:30"
}
],
"next_cursor": null
} POST/v1/enquiriesSend an enquiry in
An enquiry from your website, app or CRM, through the same writer as every other channel. Scope enquiries_in.
Body (JSON)
phone or email- One is needed; phone in international form, +919876543210
kind- party, school, company, society, event, membership, play or other
title, name, organisation, message- What it is about and who from
branch_id- One of the key’s branches (a one-branch key uses its branch)
wanted_date, kids, adults- What is wanted
idempotency_key- Send the same key again and nothing new is made (200, existing)
The answer
id, number, status- created (201), added_to_open_enquiry (200) or existing (200)
- A known family’s mobile, or an account’s name or phone, links it to them.
- A message about the same request within 7 days joins that open enquiry, as does one that closed itself as No reply in the last 60 days.
- Anything else is a new enquiry, given to its owner by the business’s routing.
Example
curl
curl -X POST "https://api.pzos.app/v1/enquiries" \
-H "Authorization: Bearer $PZOS_KEY" \
-H "Content-Type: application/json" \
-d '{"phone":"+919876543210","kind":"party","name":"Ananya","wanted_date":"2026-12-20","kids":15,"adults":8,"message":"Birthday party for my son","branch_id":"b6f4…","idempotency_key":"web-7f3c"}'Node
const res = await fetch('https://api.pzos.app/v1/enquiries', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.PZOS_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"phone": "+919876543210",
"kind": "party",
"name": "Ananya",
"wanted_date": "2026-12-20",
"kids": 15,
"adults": 8,
"message": "Birthday party for my son",
"branch_id": "b6f4…",
"idempotency_key": "web-7f3c"
})
});
console.log(res.status, await res.json());Python
import os, requests
res = requests.post("https://api.pzos.app/v1/enquiries",
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"},
json={
"phone": "+919876543210",
"kind": "party",
"name": "Ananya",
"wanted_date": "2026-12-20",
"kids": 15,
"adults": 8,
"message": "Birthday party for my son",
"branch_id": "b6f4…",
"idempotency_key": "web-7f3c"
})
print(res.status_code, res.json())The answer
{
"id": "e7d0…",
"number": "E-1042",
"status": "created"
} POST/v1/leadsSend a lead in (older address)
Kept for systems built on it. With Enquiries and deals on, it does what POST /enquiries does. Scope leads_in.
Body (JSON)
contact_phone or contact_email- One is needed
kind, title, contact_name, branch_id, wanted_date, kids, adults, note, idempotency_key- As for an enquiry
The answer
id, number, status- created (201) or added_to_open_lead (200)
Example
curl
curl -X POST "https://api.pzos.app/v1/leads" \
-H "Authorization: Bearer $PZOS_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_phone":"+919876543210","kind":"school","title":"Annual day outing","kids":60}'Node
const res = await fetch('https://api.pzos.app/v1/leads', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.PZOS_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"contact_phone": "+919876543210",
"kind": "school",
"title": "Annual day outing",
"kids": 60
})
});
console.log(res.status, await res.json());Python
import os, requests
res = requests.post("https://api.pzos.app/v1/leads",
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"},
json={
"contact_phone": "+919876543210",
"kind": "school",
"title": "Annual day outing",
"kids": 60
})
print(res.status_code, res.json())The answer
{
"id": "c11e…",
"number": "L-0088",
"status": "created"
} POST/v1/gates/checkCheck a wristband at a gate
May this band pass? For turnstiles and gates. Scope gates.
Body (JSON)
band- The band’s number (needed)
direction- in (the default) or out
zone, gate- The zone the gate opens, and the gate’s name in the taps
The answer
allow- true or false
reason- ok, time_up, pay_at_desk, wrong_zone, paused, lost_band, not_on_floor, other_branch or checked_out
child, zone, minutes_left, status, band, direction- The child’s first name only, never a surname or mobile
- In passes a child on the floor, not paused, within their time and the branch’s grace, and in a zone their package opens.
- Out passes a child checked out or within their time; over time answers pay_at_desk.
- Every tap is kept for 90 days and shows on the visit at the desk.
Example
curl
curl -X POST "https://api.pzos.app/v1/gates/check" \
-H "Authorization: Bearer $PZOS_KEY" \
-H "Content-Type: application/json" \
-d '{"band":"0004417","direction":"in","zone":"Soft play","gate":"Main entry"}'Node
const res = await fetch('https://api.pzos.app/v1/gates/check', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.PZOS_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"band": "0004417",
"direction": "in",
"zone": "Soft play",
"gate": "Main entry"
})
});
console.log(res.status, await res.json());Python
import os, requests
res = requests.post("https://api.pzos.app/v1/gates/check",
headers={"Authorization": f"Bearer {os.environ['PZOS_KEY']}"},
json={
"band": "0004417",
"direction": "in",
"zone": "Soft play",
"gate": "Main entry"
})
print(res.status_code, res.json())The answer
{
"allow": true,
"reason": "ok",
"child": "Ishaan",
"zone": "Soft play",
"minutes_left": 42,
"status": "playing",
"band": "0004417",
"direction": "in"
} Paging and changes
- Lists come oldest change first, 100 a page (
?limit=up to 100). Enquiries, deals and quotes go up to 200 a page and addtotal: how many rows match in all. - Each answer is
{ "data": [...], "next_cursor": "…" | null }. Pass?cursor=for the next page until it isnull. ?since=gives only what changed after that time: a bill made or voided, a booking or lead updated, a day’s figures saved. Keep the time of your last pull and ask again every few minutes.- Ids in the address are fine. A name, mobile or email never goes in an address.
Errors and limits
An error is { "error": "<code>", "message": "<words>" }. Up to 60 calls a minute a key (a gate’s key: 600).
invalid_requestSomething in the request isn’t valid: a time, a cursor, a fieldunknown_keyNo key, an unknown key, or one that was switched offnot_in_planThe API isn’t on for this businessnot_allowedThe key’s scopes don’t cover this callnot_switched_onEnquiries, deals and quotes with Enquiries and deals offnot_foundNo such addressmethod_not_allowedThe API reads; it only takes POST for enquiries, leads and gatestoo_manyMore than 60 calls in a minute (a gate’s key: 600). Wait a momenterrorOur side. Try again; it is recorded and we look at itThe API never makes, changes or voids a bill, takes a payment or moves money. Money stays at the desk.
Webhooks
An owner adds an address in Head office › Setup › Webhooks: a public https:// address (at most 10 a business) and the events it wants. Its signing secret (whsec_…) is shown once; New secret replaces it. Events are written in the same database step as the change, so a post is never about something that didn’t happen.
bill.madeA bill is made (practice bills never)bill id, number, branch, business date, type, total, tax, currency, visit idbill.voidedA bill is voidedbill id, number, branch, business date, total, voided time (not the staff’s reason)day.closedA branch closes its daybranch, business date, closed time, cash expected, counted and variancevisit.arrivedA visit startsvisit id, branch, kind, business date, time in, family id, account idvisit.checked_outA visit is checked outvisit id, branch, business date, time in and outlead.madeA Sales lead is made (with Enquiries and deals on, a deal: an alias)lead id, number, branch, kind, source, stage, wanted date, kids, estimated valuelead.stage_changedA lead’s stage changes (with Enquiries and deals on, a deal’s)lead id, number, branch, from, to, booking idbooking.madeA booking, party or group visit is madebooking id, number, branch, kind, status, start, kids, quoted total, sourcebooking.cancelledA booking is cancelledbooking id, number, branch, kind, startmembership.chargedA monthly membership is chargedmembership id, branch, amount, bill id, periodmembership.pausedA membership pauses after a failed chargemembership id, branch, paid tovisit.nearly_upA child reaches the branch’s nearly-up time; for an all-day child, that long before closingvisit id, child’s visit id, branch, out by, all day, bandvisit.overtimeA child’s time is up; for an all-day child, at closingvisit id, child’s visit id, branch, out by, all day, bandenquiry.createdAn enquiry comes in, from any channelenquiry id, number, branch, kind, channel, status, wanted date, kids, adults, family id, account idenquiry.qualifiedAn enquiry is qualified into a new deal or an open oneenquiry id, number, branch, deal id, deal number, into, family id, account iddeal.wonA deal is won: deposit paid, booking confirmed or credit termsdeal id, number, old number, branch, kind, stage before, value, booking id, accepted quote, won timedeal.lostA deal is lostdeal id, number, old number, branch, kind, stage before, value, lost reason, booking idquote.sentA quote goes out for the first timequote id, number, version, option, deal id, branch, total, deposit, valid until, how it was sentquote.acceptedA quote is accepted, on its link, on the phone or at the deskquote id, number, version, option, deal id, branch, total, deposit, how, when, the booking made from itEach post is POST <your address> with these headers and a JSON body:
PZOS-Event- The event type
PZOS-Delivery- The delivery’s number
PZOS-Signaturet=<unix seconds>,v1=<hex>: HMAC-SHA256 of<t>.<body>with the signing secret
{
"id": "6a1f…",
"type": "bill.made",
"created_at": "2026-12-06T12:04:11+05:30",
"business_id": "0a4e…",
"data": {
"bill_id": "9e1d…",
"number": "PHL/26-27/1204",
"branch_id": "b6f4…",
"business_date": "2026-12-06",
"type": "sale",
"total": 21240.00,
"tax": 3240.00,
"currency": "INR",
"visit_id": "5c77…"
}
} No family’s name or mobile is ever in a webhook. A post may arrive twice: use id to ignore repeats.
Checking a signature
Check the signature against the body exactly as it arrived, and that t is within five minutes, before trusting a post.
Node
import crypto from 'node:crypto';
// header = request.headers['pzos-signature'], rawBody = the body exactly as received
export function fromPzos(header, rawBody, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && parts.v1?.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected));
}Python
import hashlib, hmac, time
def from_pzos(header: str, raw_body: bytes, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
signed = parts["t"].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(parts.get("v1", ""), expected)PHP
function from_pzos(string $header, string $rawBody, string $secret): bool {
parse_str(str_replace(',', '&', $header), $parts);
$expected = hash_hmac('sha256', $parts['t'] . '.' . $rawBody, $secret);
$fresh = abs(time() - (int) $parts['t']) < 300;
return $fresh && hash_equals($expected, $parts['v1'] ?? '');
}Retries and the log
- Answer any 2xx within 10 seconds. Anything else is tried again 1, 5 and 15 minutes, then 1, 3, 6 and 12 hours later: 8 tries in about 22 hours.
- After the last try the owners get an email, and can Resend it from the delivery log (kept 30 days).
- An address failing for 3 days running is paused and the owners are told; Resume it when your system is back.
- A test post (type
test) can be sent any time.
Nightly export
Head office › Setup › Nightly export writes each closed day as CSV, one file per kind (bills, bill_lines, payments, day_figures, expenses, visits, bookings, and families only when ticked), to your own storage (anything that speaks S3, or an Azure container) or for download. Files are <folder>/<date>/<kind>.csv; loading a file again replaces the same period. Every Monday brings last week in one folder, and once, every year so far.
Personal data
Names, mobiles and emails leave PZOS only with the personal scope, and families only in the nightly export when the owner ticks it. Both are off by default. Webhooks never carry them. Families who asked to be erased never appear.
OpenAPI and versions
The OpenAPI file describes every call for Postman, Insomnia or your own client. This is version 1: new fields and events may be added to it; anything that would break your code comes as a new version, announced to owners first.
Questions from your IT team: wecare@pzos.app or WhatsApp.
Building on PZOS for your branches?
A demo of head office and the API with a chain set up like yours.