Zansync API Reference

Zansync is a ZRA VFMS compliance layer. Instead of integrating directly with the ZRA API — which requires managing separate authentication headers, two endpoint sets, and credential storage — you call Zansync once and we handle the ZRA communication on your behalf.

This documentation covers all available endpoints for both Basic VFMS (restaurants, bars, retail) and Hotel VFMS (accommodation lifecycle).

📘 Need API access? Register at zansync.com to receive your API key and onboarding. Test keys are issued immediately.

Base URLs

TESThttps://api.zansync.com/api/zs/v1
LIVEhttps://api.zansync.com/api/zs/v1

Authentication

All requests require your Zansync API key in the X-Zansync-Key header. Keys are issued per property. Test keys begin with zs_test_, live keys with zs_live_.

# Include on every request
X-Zansync-Key: zs_live_your_key_here
⚠️ Never expose your API key in client-side JavaScript or public repositories.

Environments

The test environment connects to ZRA's official test servers with pre-loaded sandbox credentials. No real fiscal receipts are issued in test mode.

EnvironmentBase URLReal Receipts
Testapi.zansync.com/api/zs/v1No
Liveapi.zansync.com/v1Yes
✓ Your test API key is pre-configured with ZRA sandbox credentials. No ZRA setup needed to start testing.

Basic VFMS

Use Basic VFMS endpoints to issue ZRA fiscal receipts for all non-accommodation sales — restaurants, bars, cafes, retail, and general services.

POST /v1/sales — Normal Sales

Issue a ZRA fiscal receipt for a standard walk-in customer transaction. Use for all taxable sales to individual customers.

POST/v1/salesWalk-in customer sale ▾
ParameterTypeDescription
referencestringrequiredYour unique order/transaction ID
customerstringrequiredCustomer name. Use "Walk-in" for anonymous.
phonestringoptionalCustomer phone number
currencyenumrequiredTZS · USD · EURO
itemsarrayrequiredArray of sale items
items[].namestringrequiredItem or service name
items[].pricenumberrequiredUnit price (tax inclusive)
items[].quantitynumberrequiredQuantity sold
items[].discountnumberoptionalDiscount amount. Default 0.
items[].item_idnumberoptional0 for taxable items. Use ID from /v1/non-tax-items for exempt goods.
# Request
curl -X POST https://api.zansync.com/api/zs/v1/v1/sales \
  -H "X-Zansync-Key: zs_test_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "ORD-1042",
    "customer": "Walk-in",
    "currency": "TZS",
    "items": [
      {"name":"Grilled Prawns","price":45000,"quantity":1,"item_id":0},
      {"name":"Fresh Juice","price":5000,"quantity":2,"item_id":0}
    ]
  }'

# Response 200
{
  "receipt_number": "213590000076220812",
  "response_number": "441514155",
  "z_number": "Z025608121",
  "tax_exclusive": 47826.09,
  "tax_amount": 7173.91,
  "total": 55000.00,
  "currency": "TZS",
  "business_name": "THE BOX BY ASHLEY",
  "qr_url": "http://102.223.7.131:6060/vfms/checkout-receipt-form/guest/213590000076",
  "issued_at": "2026-04-18T17:31:00+03:00",
  "status": "success"
}

POST /v1/btob — B2B Sales

For sales to ZRA-registered business customers. The buyer's ZRB registration number is required.

POST/v1/btobBusiness-to-business sale ▾
ParameterTypeDescription
referencestringrequiredUnique transaction reference
zrb_numberstringrequiredCustomer ZRB registration number (e.g. Z0025383974)
phonestringrequiredCustomer phone number
currencyenumrequiredTZS · USD · EURO
itemsarrayrequiredSame structure as Normal Sales

POST /v1/institution — Institution Sales

For sales to government institutions and withholding agents. Tax is withheld and calculated separately per ZRA rules.

POST/v1/institutionGovernment / withholding agent sale ▾
ParameterTypeDescription
referencestringrequiredUnique transaction reference
zrb_numberstringrequiredInstitution ZRB registration number
phonestringrequiredInstitution phone number
currencyenumrequiredTZS · USD · EURO
itemsarrayrequiredSame structure as Normal Sales

POST /v1/relief/check — Check Relief Number

Verify a special relief number issued by ZRA before processing a relief sale.

POST/v1/relief/checkVerify relief number ▾
ParameterTypeDescription
relief_numberstringrequiredCustomer special relief number issued by ZRA

POST /v1/relief/save — Save Relief Sale

Process a relief sale after verifying the relief number. Use the relief_id returned from the check endpoint.

POST/v1/relief/saveIssue relief sale receipt ▾
ParameterTypeDescription
relief_idnumberrequiredID returned from /v1/relief/check

GET /v1/non-tax-items — Non-Taxable Items

Retrieve the current ZRA list of exempt (non-taxable) items. Use the returned id values as item_id in sales requests for exempt goods. No request body required.

GET/v1/non-tax-itemsZRA exempt item list ▾
# Response
[
  {"id":219, "name":"SEAFOOD", "unit":"No", "taxable":false},
  {"id":216, "name":"RICE", "unit":"No", "taxable":false}
]

POST /v1/seaport/local — Seaport Local Sales

For seaport ticketing agents issuing receipts for passengers travelling locally (Unguja–Pemba) or to Mainland.

POST/v1/seaport/localLocal passenger sale ▾
ParameterTypeDescription
referencestringrequiredUnique transaction reference
ticket_numberstringrequiredTicket number from your system
customerstringrequiredPassenger name (LOCAL or MAINLAND)
phonestringrequiredCustomer phone
currencyenumrequiredTZS · USD
departure_datedatetimerequiredISO 8601 departure datetime
itemsarrayrequiredTicket items with name, price, quantity

POST /v1/seaport/foreign — Seaport Foreign Charge

For charging foreign passengers travelling outside Tanzania. Provide number of passengers and reference number.

POST/v1/seaport/foreignForeign passenger charge ▾
ParameterTypeDescription
no_paxintegerrequiredNumber of passengers
referencestringrequiredUnique transaction reference

POST /v1/error — Error Correction

Submit a correction when a receipt was issued in error. ZRA will cancel the old receipt and log the new correct one.

POST/v1/errorCancel and correct a receipt ▾
ParameterTypeDescription
old_receiptstringrequiredIncorrect receipt number to cancel
new_receiptstringrequiredReplacement correct receipt number
reasonstringrequiredReason for correction
emailstringrequiredTaxpayer email for ZRA notification
phonestringrequiredTaxpayer phone number

Hotel VFMS

Hotel VFMS manages the full accommodation lifecycle — check-in through fiscal checkout. ZRA calculates infrastructure tax automatically per guest per night from the moment of check-in. The fiscal receipt is generated at checkout.

ℹ️ Hotel VFMS requires the Professional or Enterprise plan. Every guest must use a unique reference at check-in — store this to use in all subsequent endpoints for that guest stay.

POST /v1/hotel/checkin — Guest Check-In

Register a guest with ZRA at check-in. ZRA begins calculating infrastructure tax from this moment. Must be called at the time of physical check-in.

POST/v1/hotel/checkinRegister guest with ZRA ▾
ParameterTypeDescription
referencestringrequiredYour unique booking reference. Store this — needed for checkout.
room_namestringrequiredRoom number or name
room_idintegerrequiredYour internal room ID
pricenumberrequiredNightly accommodation price (tax inclusive)
discountnumberoptionalDiscount amount. Default 0.
currencyenumrequiredUSD · TZS · EURO
checkin_datedatetimerequiredISO 8601 (e.g. 2026-04-18T14:00:00Z)
payment_packagestringrequiredAI (All Inclusive) · FB (Full Board) · BB (Bed & Breakfast) · HB (Half Board)
sourceenumrequiredDIRECT · TOUR_OPERATOR
tour_reg_nostringconditionalRequired if source is TOUR_OPERATOR. Tour operator ZRA registration number.
guestsarrayrequiredArray of guest objects
guests[].full_namestringrequiredGuest full name
guests[].document_typestringrequiredPASSPORT · NIDA · ZANID
guests[].document_nostringrequiredDocument number. Store this — needed for checkout.
guests[].countrystringrequiredGuest country of origin
guests[].arrival_datestringrequiredDate of arrival in Zanzibar (yyyy-mm-dd)
curl -X POST https://api.zansync.com/api/zs/v1/v1/hotel/checkin \
  -H "X-Zansync-Key: zs_test_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "BK-2026-0418",
    "room_name": "Ocean Suite 12", "room_id": 12,
    "price": 150, "currency": "USD",
    "checkin_date": "2026-04-18T14:00:00Z",
    "payment_package": "BB", "source": "DIRECT",
    "guests": [{
      "full_name": "John Smith",
      "document_type": "PASSPORT",
      "document_no": "GBP123456",
      "country": "UNITED KINGDOM",
      "arrival_date": "2026-04-18"
    }]
  }'

POST /v1/hotel/change-room — Change Room

Notify ZRA when a guest moves to a different room. Tax recalculates based on the new room rate from that point.

POST/v1/hotel/change-roomGuest room change ▾
ParameterTypeDescription
referencestringrequiredUnique reference for this change event
document_nostringrequiredGuest document number from check-in
room_namestringrequiredNew room name or number
room_idintegerrequiredNew room ID
pricenumberrequiredNew room nightly rate
currencyenumrequiredUSD · TZS · EURO

POST /v1/hotel/change-price — Change Room Price

Update the nightly rate for one or more rooms without changing the room assignment.

POST/v1/hotel/change-priceUpdate room rate ▾
ParameterTypeDescription
roomsarrayrequiredArray of room price updates
rooms[].room_idintegerrequiredRoom ID to update
rooms[].pricenumberrequiredNew nightly rate

POST /v1/hotel/service — Hotel Services

Issue a ZRA receipt for hotel extras — restaurant meals, spa, laundry, or any service charged to a checked-in guest or walk-in customer.

POST/v1/hotel/serviceRestaurant or hotel extra ▾
ParameterTypeDescription
referencestringrequiredUnique reference for this service transaction
document_nostringconditionalGuest document number — required for checked-in guest charges (types CR, CS)
currencyenumrequiredUSD · TZS · EURO
typeenumrequiredCR — restaurant, checked-in guest · CS — other service, checked-in guest · WR — restaurant, walk-in · WS — other service, walk-in
itemsarrayrequiredItems with name, price, quantity, discount

POST /v1/hotel/add-guest — Add Guest

Add an additional guest to an already occupied room after initial check-in.

POST/v1/hotel/add-guestAdd guest to occupied room ▾
ParameterTypeDescription
referencestringrequiredUnique reference for this addition
first_guest_documentstringrequiredDocument number of the primary guest already in the room
full_namestringrequiredNew guest full name
document_typestringrequiredPASSPORT · NIDA · ZANID
document_nostringrequiredNew guest document number
countrystringrequiredGuest country of origin
arrival_datestringrequiredDate of arrival in Zanzibar (yyyy-mm-dd)

POST /v1/hotel/checkout — Guest Checkout

Check out one or more guests and generate the full ZRA fiscal receipt. This is the final step — ZRA calculates all nights, infrastructure tax, and services into one official receipt.

POST/v1/hotel/checkoutGenerate ZRA fiscal checkout receipt ▾
ParameterTypeDescription
document_numbersarrayrequiredArray of guest document numbers to check out
currencyenumrequiredUSD · TZS · EURO
# Request
{ "document_numbers": ["GBP123456"], "currency": "USD" }

# Response 200 — full ZRA fiscal receipt
{
  "report_number": "381418072277",
  "total_amount": 300.00,
  "total_tax": 32.61,
  "total_infrastructure": 20.00,
  "days": 2,
  "z_number": "Z025608121",
  "business_name": "FUMBA BEACH LODGE",
  "qr_url": "http://102.223.7.131:6060/vfms/checkout-receipt-form/guest/381418072277",
  "status": "success"
}

POST /v1/hotel/change-profile — Change Guest Profile

Correct guest information if it was entered incorrectly at check-in.

POST/v1/hotel/change-profileCorrect guest information ▾
ParameterTypeDescription
referencestringrequiredUnique reference for this correction
old_document_nostringrequiredOriginal incorrect document number
new_document_nostringrequiredCorrect document number
full_namestringrequiredGuest full name
document_typestringrequiredPASSPORT · NIDA · ZANID
countrystringrequiredGuest country of origin

Response Codes

Zansync returns standard HTTP codes. ZRA-specific error details are included in the response body under error.

CodeMeaningAction
200SuccessReceipt issued. Use receipt_number and qr_url in your printout.
201Created — pending ZRALogged by Zansync. Retry or poll for status.
400Bad RequestInvalid parameters. Check error field in response body.
401UnauthorizedInvalid or missing X-Zansync-Key header.
403ForbiddenYour plan does not include this endpoint.
500ZRA Server ErrorZRA is temporarily unavailable. Zansync retries automatically. Retry after 30s.

Receipt Print Requirements

ZRA requires specific fields on every printed or digital receipt. All required values are returned in Zansync API responses.

FieldZansync Response Key
ZRA Receipt Numberreceipt_numberrequired on receipt
Z-Numberz_numberrequired on receipt
Business Namebusiness_namerequired on receipt
TIN Numbertin_numberrequired on receipt
Tax Exclusive Amounttax_exclusiverequired on receipt
Tax Amounttax_amountrequired on receipt
Total Amounttotalrequired on receipt
Issue Dateissued_atrequired on receipt
QR Codeqr_urlrequired on receipt
⚠️ A scannable QR code generated from qr_url is mandatory on every receipt. Customers and ZRA inspectors use it to verify authenticity.

Webhooks

Register a webhook endpoint to receive ZRA receipt data pushed to your server the moment a receipt is issued — no polling required. Contact support@zansync.com to register your webhook URL, or configure it in your admin dashboard at admin.zansync.com.

# Webhook POST payload sent to your endpoint
{
  "event": "receipt.issued",
  "property_id": "your_property_id",
  "reference": "ORD-1042",
  "receipt_number": "213590000076220812",
  "z_number": "Z025608121",
  "tax_amount": 7173.91,
  "total": 55000.00,
  "qr_url": "http://102.223.7.131:6060/vfms/checkout-receipt-form/guest/...",
  "issued_at": "2026-04-18T17:31:00+03:00"
}
✓ Zansync signs all webhook payloads with an X-Zansync-Signature header. Verify this on your server to ensure the payload is genuine.

Questions? support@zansync.com · zansync.com