B2B Partner API
🔌 Connect: sandbox, live, webhooks
One base URL, three things to set up. Pick a tab.
Sandbox for building and testing. Send a sandbox key to https://holidaysg.com/api/b2b/v1.
- Bookings are simulated: the reference starts with
SBX-, no wallet is charged and no supplier ticket is issued. - Webhooks are sent for sandbox bookings too, so you can test your endpoint before going live.
- Attractions have a checklist: run
GET /certificationto see which checks you have passed; an attractions production key is issued after it. eSIM, hotels and ferry have no checklist: we switch them on for your account after you have run a sandbox test (for eSIM, see the test scenarios).
What you can test on a sandbox key
| Service | On a sandbox key |
|---|---|
| Attractions & tours | Full test quote, book and cancel are simulated (SBX- references, no charge, no ticket). |
| Hotels | Full test a booking is confirmed as a simulation. Nothing is sent to the hotel and nothing is charged. |
| Ferry | Full test bookings are simulated (SBX- ids) and can be read back for 7 days. |
| eSIM | Simulated orders, top-ups, usage and cancel work as a simulation: no supplier call, no charge, and the eSIM returned is a test one (ICCID starts with 89000SIM, no QR, cannot be installed). A plan with a phone number is not simulated (503 SANDBOX_UNAVAILABLE). To test a real order use a live key (paid from your wallet). |
Live real money, real tickets. Same base URL, a production key and its own signing secret.
- Wallet or credit is charged when a booking is made, and a real ticket is issued.
- Enabled by us after your sandbox certification. Keep sandbox and live keys in separate config.
- Refunds are never automatic. A cancellation is handled by our team.
Webhook goes from us to you. It is not part of the API you call.
- Set your HTTPS URL in the B2B portal, under Webhook (
/b2b/webhook), and switch it on. - Event:
BOOKING_TRANSACTION_UPDATE. HeadersX-Webhook-EventandX-Webhook-Signature(base64 HMAC-SHA256 of the raw body with your webhook secret). - Body:
event(for examplebooking.confirmed),booking_id,status,total,currency,gt_booking_ref,timestamp. - Answer
2xxwithin 15 seconds. Otherwise we retry up to 5 times, after about 10 s, 30 s, 1 min, 5 min and 15 min. Delivery is at-least-once, so dedupe on booking id and status. - If your firewall restricts inbound traffic, allow our server address
187.127.107.96.
What you need to call the API:
X-Api-Key: hsg_b2b_...on every call. Writes are also signed:X-Api-Timestamp,X-Api-Nonce,X-Api-Signature(see Request signing), plus anIdempotency-Keyon bookings.- A key is limited to the services it has been granted (attractions, hotels, eSIM, ferry). A service not granted answers
403 AUTH_SCOPE_FORBIDDEN. - IP allowlist (required, 1 to 3 addresses): every key is locked to the server IPs you call from. Type them in the Allowed IPs box when you create a key or request one in the B2B portal (Staff & API keys, API users tab), one per line. Exact addresses only, no ranges (CIDR). A call from any other address answers
401 AUTH_UNAUTHORIZED. You can change the list later in the same place, but it can never be empty. - Keys are per API. In the portal (Staff & API keys, API users tab) create a sandbox key for each API you want to test (attractions, hotels, eSIM, ferry). It works at once. When you are ready, press Request live key for that API; we review it, and once it is approved you create the live key yourself in the same place (we never see it).
🧭 Start here
New to the API? Read this block, then jump to the service you sell. Everything else on this page is reference.
- Apply for a B2B partner account. Once approved we issue a sandbox key and its signing secret (details).
- Build on sandbox: same host as live, nothing is charged and nothing is booked (sandbox).
- Test: run the full flow once on sandbox (attractions: the certification checklist; eSIM, hotels, ferry: your own test, we review it) and we issue a production key and, if agreed, a credit line.
- Fund your wallet (or use your credit line) and go live by swapping the key and secret.
Which service do you need?
| Service | What you sell | You pay from | Switched on | Section |
|---|---|---|---|---|
| Attractions & tours | Tickets and experiences, by date | Wallet or credit line | With your account | Catalog to Cancel |
| Hotels | Hotel rooms, by dates and guests | Wallet or credit line | Per partner, ask your account manager | Hotels |
| HolidaySG eSIM | Data plans and top-ups | Wallet | Per partner, ask your account manager | eSIM |
| Ferry | Ferry tickets, one way or two way | Wallet only | Ferry access on your key, ask your account manager | Ferry |
What every service shares
- One base URL, one API key, scopes, rate limits and the same response envelope.
- Money-moving calls are signed and carry an Idempotency-Key, so a retry never books twice.
- Prices are your nett price in SGD; you set your own selling price. Hotel and ferry cancellations and refunds are reviewed by our team, never automatic.
- Machine-readable spec: OpenAPI file (every path, verb and scope for attractions, hotels, eSIM and ferry, plus the main request fields; this page has the full field lists).
◉ Overview
A REST API over HTTPS. JSON in, JSON out. Every response uses a consistent { data, meta, errors } envelope.
The API exposes HolidaySG's bookable inventory — attractions, tours and tickets — sourced from our suppliers and normalised into a single catalog. You browse products, check live availability, lock a price, and book. Money settles through your wallet or an approved credit line. SEO/marketing content is never exposed; you receive only the fields you need to transact.
| Property | Value |
|---|---|
| Base URL | https://holidaysg.com/api/b2b/v1 |
| Protocol | HTTPS only · TLS 1.2+ |
| Format | JSON request & response (UTF-8) |
| Auth | X-Api-Key header on every request (+ HMAC signature on money-moving calls) |
| Currency | SGD (all prices, one currency — no FX) |
| Versioning | Path-pinned /v1; breaking changes ship as a new version |
➜ API workflow
Five steps from browsing to a confirmed ticket. Each maps to one endpoint.
- Understand product structure and map our products to yours (Product → Option → Ticket Type).
- Get live availability & pricing for a date (availability) then lock the price.
- Provide booking information (quote + customer) to create a paid transaction (book).
- Receive fulfilment — the e-ticket is delivered to the customer and you are notified by webhook.
🚀 Getting access
- Apply for a B2B partner account. Once approved you are placed in a commission group (default 1%).
- In the B2B portal (Staff & API keys, API users tab) create a sandbox API key for each API you need, with 1 to 3 static server IPs. You see the key and its signing secret once — store the secret securely.
- Build against sandbox (no real money or inventory) and complete the certification checklist.
- When you are ready, press Request live key for each API. After we approve it, create the live key yourself in the portal. Attractions need the certification checklist first; a credit line is agreed separately.
Health check
Check service availability (authenticated):
curl https://holidaysg.com/api/b2b/v1/ping -H "X-Api-Key: <your-key>"
→ { "data": { "status": "ok", "service": "HolidaySG B2B API", "version": "v1" } }
Verify your key
Verify a key at any time:
curl https://holidaysg.com/api/b2b/v1/me -H "X-Api-Key: <your-key>"
→ { "data": { "partner": { "id": 12, "name": "Acme Travel", "tier": 2, "currency": "SGD" },
"api_key": { "name": "Prod", "prefix": "hsg_b2b_ab12", "scopes": [], "last_used_at": "..." } } }
🧩 Environments
There is one base URL for everything. Sandbox vs production is decided by which key you send — not by a different host.
| Environment | How | Money & inventory |
|---|---|---|
| Sandbox | Use a sandbox key against the same base URL | Simulated — bookings are recorded but no wallet is charged and no supplier ticket is issued |
| Production | Use a production key | Real — wallet/credit is charged and a real ticket is issued |
🔑 Authentication
Send your API key on every request.
X-Api-Key: hsg_b2b_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keys are stored hashed — we never see the raw key after issue. Money-moving requests additionally require a signature.
| Condition | Response |
|---|---|
| Missing / invalid / revoked / expired key, or a source IP outside your allowlist | 401 AUTH_UNAUTHORIZED |
| Valid key calling an endpoint outside its scopes | 403 AUTH_SCOPE_FORBIDDEN |
🎚 Scopes
Each key carries a set of scopes. An empty scope list means full access (backward-compatible default); a non-empty list is strictly enforced per endpoint.
| Scope | Grants |
|---|---|
catalog:read | Products & availability |
quote:write | Create quotes |
booking:read | List & retrieve bookings |
booking:write | Create bookings |
booking:cancel | Cancel bookings |
statement:read | Statements |
✍ Request signing
Money-moving calls — POST /bookings and POST /bookings/{id}/cancel — require an HMAC-SHA256 signature (plus /signature/verify to test it).
X-Api-Timestamp: <unix seconds>
X-Api-Nonce: <unique per request>
X-Api-Signature: hex( hmac_sha256(canonical, signing_secret) )
canonical = timestamp "\n" METHOD "\n" path "\n" nonce "\n" rawBody
pathincludes the leading slash, no query string (e.g./api/b2b/v1/bookings).rawBodyis the exact JSON bytes you send — sign the string you transmit.- Timestamp must be within 5 minutes of server time; each nonce is single-use (replays are rejected).
Dry-run: POST /signature/verify
Validate your signing implementation with no side effects. Note that /signature/verify is itself a signed endpoint — send the same three signature headers you would on a booking, computed over this request's own canonical string (path = /api/b2b/v1/signature/verify). The server recomputes the signature and confirms the match.
POST /signature/verify
Headers: X-Api-Key, X-Api-Timestamp, X-Api-Nonce, X-Api-Signature
{ ...any JSON body (may be empty)... }
→ 200 { "data": { "verified": true,
"echo": { "method": "POST", "path": "/api/b2b/v1/signature/verify",
"timestamp": "...", "nonce": "...", "body_sha256": "..." } } }
/signature/verify — or any signed endpoint — without the three signature headers returns 401 SIGNATURE_MISSING. A bad signature is 401 SIGNATURE_INVALID, a timestamp more than 5 minutes off is 401 SIGNATURE_TIMESTAMP_SKEW, and a reused nonce is 409 SIGNATURE_REPLAY. All are rejected before the request runs, so /signature/verify is the safe place to shake these out.♻ Idempotency
Booking is safe to retry. Send a unique Idempotency-Key header on POST /bookings.
Idempotency-Key: 2f9c1e77-....-per-booking-attempt
- First call →
201and the booking is created. - Any retry with the same key →
200returning the original booking. You are never charged twice. - Reuse the same key only for the same logical booking. Use a fresh key for a new booking.
- Missing the header →
400 IDEMPOTENCY_KEY_REQUIRED. - Same key with different quote/customer →
409 IDEMPOTENCY_KEY_MISMATCH.
⏱ Rate limits
Per-partner, by tier. Every response carries the current window.
| Tier | Requests / min |
|---|---|
| 1 (default) | 60 |
| 2 | 300 |
| 3 | 600 |
| 4 | 1200 |
X-RateLimit-Limit: 60 # your tier's per-minute quota
X-RateLimit-Remaining: 57
Retry-After: 12 # present on 429
Over the limit → 429 RATE_LIMIT_EXCEEDED. Back off and honour Retry-After.
A flood guard of 300 requests / minute per source IP also runs before authentication (invalid-key requests count). Tier 3–4 integrations calling from a single IP should contact us to align the per-IP guard with their tier.
✉ Envelope & pagination
Every response — success or error — has the same shape.
{ "data": ... ,
"meta": { "request_id": "01J...", "timestamp": "2026-08-15T07:57:00+00:00" },
"errors": [ { "code": "...", "message": "..." } ] }
Quote request_id when contacting support — it identifies the exact call in our logs.
Cursor pagination
List endpoints are cursor-paginated. meta carries the cursors; pass one back as ?cursor=.
"meta": { "per_page": 25, "next_cursor": "eyJpZCI6...", "prev_cursor": null }
GET /products?per_page=25&cursor=eyJpZCI6...
⚠ Errors
Errors return the standard envelope with a machine code in errors[].code and a matching HTTP status.
| Code | HTTP | Meaning |
|---|---|---|
AUTH_UNAUTHORIZED | 401 | Bad / missing / IP-blocked key |
AUTH_SCOPE_FORBIDDEN | 403 | Key lacks the required scope |
SIGNATURE_MISSING | 401 | A signed endpoint was called without the X-Api-Timestamp/X-Api-Nonce/X-Api-Signature headers |
SIGNATURE_INVALID | 401 | Signature does not match the canonical string |
SIGNATURE_TIMESTAMP_SKEW | 401 | Timestamp is more than 5 minutes from server time |
SIGNATURE_REPLAY | 409 | Nonce already used within the signing window |
VALIDATION_FAILED | 422 | Bad or missing parameters |
RATE_LIMIT_EXCEEDED | 429 | Slow down; honour Retry-After |
PRODUCT_NOT_FOUND | 404 | No such product |
SOURCE_UNAVAILABLE | 503 | Availability source temporarily down — retry |
QUOTE_EXPIRED | 409 | Quote expired or already used |
INSUFFICIENT_FUNDS | 402 | Wallet too low — no money moved |
CREDIT_LIMIT_EXCEEDED | 402 | Over credit line — no money moved |
BOOKING_CONFIRM_FAILED | 502 | Supplier rejected at confirm — fully refunded |
BOOKING_NOT_CANCELLABLE | 409 | Already cancelled or past cut-off — no money moved |
IDEMPOTENCY_KEY_REQUIRED | 400 | Missing Idempotency-Key header on POST /bookings |
IDEMPOTENCY_KEY_MISMATCH | 409 | Same idempotency key used with different quote or customer |
BOOKING_NOT_FOUND | 404 | No booking matches the given id for this partner |
BOOKING_RESERVE_FAILED | 502 | Upstream source could not reserve — no funds debited |
TRAVELLER_ANSWERS_REQUIRED | 422 | Ticket types require per-traveller details (passport name, gender, DOB) — see availability for required questions |
▦ Product structure
Every product is organised as Product → Option → Ticket Type. You map these ids to your own catalog, then reference them when quoting and booking.
product_id: hsgp_1option_id: opt_60ticket_type_id: tt_94| Level | Represents | You use it to… |
|---|---|---|
| Product | The bookable attraction, tour or ticket | List & display; the unit of a catalog page |
| Option | A bookable variant of the product (duration, package, session) | Show the choices for a product/date |
| Ticket Type | The smallest priced unit within an option (pax category) | Quote & book — you pass ticket_type_id + quantity |
▤ Catalog
Query parameters
| Param | Description | |
|---|---|---|
country | opt | Filter by country, e.g. Singapore |
city | opt | Filter by city |
category_id | opt | Filter by category |
is_bookable | opt | true to return only live-bookable products |
per_page / cursor | opt | Pagination (see envelope) |
curl "https://holidaysg.com/api/b2b/v1/products?country=Singapore&per_page=20" -H "X-Api-Key: <key>"
from_price in the catalog is indicative only and must not be sold on. Always take the real price from a quote.📅 Availability
| Param | Description | |
|---|---|---|
date | req | Visit date, YYYY-MM-DD, today or later |
pax | opt | Party size to check capacity against |
Returns the options and their ticket_type_ids that are bookable for that date — this is where you get the ticket_type_id to quote and book (they are not on the catalog/product record). Availability is fetched live from the source at request time — if the source is unreachable you get 503 SOURCE_UNAVAILABLE (retry), never a stale “available”.
date, or a date the product does not operate on (many run only on certain weekdays), returns 422 VALIDATION_FAILED — not an empty list. Read the operating days from the product before probing, or step the date forward until availability returns available: true.curl "https://holidaysg.com/api/b2b/v1/products/hsgp_1/availability?date=2026-08-20&pax=2" -H "X-Api-Key: <key>"
💲 Pricing model
Simple and transparent: one currency, your price only. You never see supplier nett cost or the margin — your commission is already baked into what you pay.
| Field | Meaning |
|---|---|
unit_price | Your all-in price per ticket, in SGD, with your commission applied |
sub_total | unit_price × quantity for a line |
total | Sum of all line sub-totals — the amount debited on booking |
currency | Always SGD |
There is no separate tax or FX step — total is exactly what leaves your wallet/credit. Your own selling price and margin to your customer are yours to set on top.
🔒 Quotes
A quote locks the price for 15 minutes and returns a single-use quote_id you pass to booking. This guarantees the price you saw is the price you pay.
POST /quotes
{ "product_id": "hsgp_1",
"date": "2026-08-20",
"items": [ { "ticket_type_id": "tt_94", "quantity": 2 } ] }
→ { "data": {
"quote_id": "q_XXXX", "product_id": "hsgp_1", "date": "2026-08-20", "currency": "SGD",
"lines": [ { "ticket_type_id":"tt_94", "name":"ADULT", "quantity":2, "unit_price":56.41, "sub_total":112.82 } ],
"total": 112.82,
"expires_at": "2026-08-20T07:57:00+00:00" } }
- A quote is consumed by exactly one successful booking; a used or expired quote →
409 QUOTE_EXPIRED. - Re-quote if the customer takes longer than the 15-minute window.
🔁 Booking lifecycle
One call books money-safely. Internally we debit first, then confirm with the supplier, and compensate automatically if anything fails — so you are never left paying for an unconfirmed ticket.
| Status | HTTP | Meaning |
|---|---|---|
| reserved | — | Transient — payment taken, confirming with supplier |
| confirmed | 201 | Booked & paid; e-ticket being fulfilled |
| confirmed (replay) | 200 | Idempotent retry returned the original booking |
| pending | 202 | Accepted; outcome being reconciled — watch the webhook |
| failed_pending_refund | 502 | Supplier rejected after debit; refund issued back to source |
| cancelled | 200 | Cancelled by you; refunded |
402 (insufficient funds / credit) means nothing was ever charged. You can rely on “charged ⇔ confirmed (or refunded)”.🎫 Create a booking
Idempotency-Key. Consumes a quote, charges wallet or credit, books the supplier.| Field | Description | |
|---|---|---|
quote_id | req | A live, unused quote |
payment_method | opt | wallet (default) or credit |
customer.name | req | Lead traveller name |
customer.email | req | Where the e-ticket is sent |
customer.phone | opt | Contact phone number (max 30 chars) |
customer.mobile_code | opt | Country dial code, e.g. +65 (max 10 chars) |
traveller_answers | opt* | Per-traveller details keyed by ticket type, with nested per-pax answers. Required when the product's availability response includes questions (e.g. passport name, gender, DOB). Omitting when required → 422 TRAVELLER_ANSWERS_REQUIRED. |
POST /bookings
Headers: X-Api-Key, X-Api-Timestamp, X-Api-Nonce, X-Api-Signature, Idempotency-Key
{ "quote_id": "q_XXXX", "payment_method": "wallet",
"customer": { "name": "Jane Tan", "email": "jane@example.com" } }
→ 201 { "data": { "booking_id": "b_XXXX", "status": "confirmed",
"total": 112.82, "currency": "SGD",
"customer": { "name": "Jane Tan", "email": "jane@example.com" },
"note": null } }
See the lifecycle for the 200 / 202 / 402 / 502 paths.
🔎 Retrieve bookings
Query parameters (listing)
| Param | Description | |
|---|---|---|
per_page | opt | Results per page, 1–100. Default 25. |
cursor | opt | Cursor from a previous response's meta.next_cursor / meta.prev_cursor. |
Response fields
| Field | Description |
|---|---|
booking_id | Your reference for the booking |
status | See lifecycle statuses |
total / currency | Amount charged, in SGD |
customer | { name, email } |
created_at | ISO-8601 timestamp (listing only — not present on create/show/cancel responses) |
reserved, confirmed, cancelled, and failed_pending_refund. Transient pending bookings are not included — poll GET /bookings/{id} by id to follow a 202 pending booking to its terminal state, or rely on the webhook.↩ Cancel & refunds
- 200
cancelled— refund returned to the source of payment (wallet, or credit reversed). Idempotent: cancelling an already-cancelled booking returns200without a second refund. - 409
BOOKING_NOT_CANCELLABLE— already cancelled, or past the supplier cut-off. No money moves.
📩 Vouchers & fulfilment
HolidaySG fulfils the ticket — you don't have to.
On confirmed, the e-ticket / voucher is issued by the supplier and delivered by email to the customer.email on the booking. You can:
- Follow fulfilment via the booking
status(GET /bookings/{id}), and - Receive a webhook when the transaction updates.
🔔 Webhooks
We push booking updates to your endpoint so you don't have to poll. Deliveries retry with backoff and dead-letter after repeated failures.
Event (X-Webhook-Event) | Fires when |
|---|---|
BOOKING_TRANSACTION_UPDATE | A booking is confirmed, refunded, or otherwise changes state |
Verifying a webhook
Each POST to your URL carries a signature over the raw request body, keyed by your webhook secret:
X-Webhook-Event: BOOKING_TRANSACTION_UPDATE
X-Webhook-Signature: base64( hmac_sha256(rawBody, webhook_secret) )
# verify (pseudo)
expected = base64(hmac_sha256(request.rawBody, webhook_secret))
if !constant_time_equal(expected, header["X-Webhook-Signature"]) -> reject 400
- Respond
2xxquickly to acknowledge; non-2xx (or timeout) triggers retries. - Treat delivery as at-least-once — dedupe on the booking id + state.
📶 eSIM overview
Sell HolidaySG eSIM data plans to your travellers through the same API: browse plans, order one eSIM per order from your wallet, hand the install code to your customer.
| Property | Value |
|---|---|
| Base URL | https://holidaysg.com/api/b2b/v1/esim — same X-Api-Key, IP allowlist, rate limits and request signing on writes as the rest of the API |
| Money | Prices in SGD, paid from your HolidaySG wallet (credit lines are not used for eSIM) |
| Order size | One eSIM per order |
| IDs | Plans hsg_plan_{n} · eSIMs hsg_esim_{n} (or the ICCID) · orders HSGE-YYYYMMDD-XXXXXX |
| Accounts | Company accounts and their staff keys. Sub-agent accounts cannot use eSIM (403 AUTH_SCOPE_FORBIDDEN). |
| B2B portal | Orders your team places in the B2B portal (eSIM menu) appear in the same lists and statements with "channel": "portal"; API orders have "channel": "api". |
"held": true) so you are never sent a second eSIM you did not want.country or one region.?ref=.🗺 eSIM catalog
Scope catalog:read. Send exactly one of country (ISO-2, e.g. JP) or region (a slug from GET /esim/regions).
GET /esim/plans?country=JP
→ 200 { "data": [ {
"plan_id": "hsg_plan_123", "name": "Japan 5 GB 7 days", "scope": "country",
"country_code": "JP", "country_name": "Japan",
"data_gb": 5, "is_unlimited": false, "fair_usage": null,
"validity_days": 7, "validity_note": "Validity starts when the eSIM first connects to a network.",
"network_type": "...", "networks": [ ... ],
"supports_topup": true, "supports_cancel": true, "supports_hotspot": true, "ip_export": "...",
"requires_kyc": false,
"price": 12.40, "currency": "SGD", "suggested_retail_price": 15.90
} ], ... }
| Field | Meaning |
|---|---|
price | Your partner price in SGD — what your wallet is charged for this plan. |
suggested_retail_price | The price HolidaySG sells the same plan at on holidaysg.com/esim. You set your own selling price. |
requires_kyc | The destination needs the traveller's ID for this plan. Such plans are sold through the API only (not the portal); you keep your customers' documents. |
supports_cancel / supports_topup / supports_hotspot | Whether an unused eSIM can be cancelled, whether data can be added, whether tethering works. |
validity_days | Counted from the first network connection, not from purchase. |
🛒 eSIM orders
Scope booking:write, signed. The wallet is debited before the eSIM is ordered.
POST /esim/orders
{ "plan_id": "hsg_plan_123",
"partner_ref": "your-order-9F2K", // required: your idempotency key
"end_user_email": "traveller@example.com", // optional, kept for your records; we never e-mail your customer
"end_user_name": "A. Traveller", // optional
"expected_sgd": 12.40 } // optional: refuse if the price is no longer this
→ 201 { "data": { "id": "HSGE-20261014-7Q2M4X", "partner_ref": "your-order-9F2K",
"status": "processing", "payment": "paid", "held": false,
"total": 12.40, "currency": "SGD", "sandbox": false, "channel": "api",
"end_user_name": "A. Traveller", "end_user_email": "traveller@example.com",
"created_at": "...", "esims": [ { "esim_id": "hsg_esim_88", "status": "processing", ... } ] },
"meta": { "timestamp": "...", "replayed": false }, "errors": [] }
partner_ref: 1–100 characters fromA-Z a-z 0-9 . _ -. TheIdempotency-Keyheader is accepted when the body has none.- A
partner_refis unique across your orders and top-ups. Retry with the same one →200with the original order andmeta.replayed: true; never a second charge. The same ref for a different plan or for a top-up →409 PARTNER_REF_REUSED. 502 WALLET_UNCONFIRMED, a timeout or a500: retry with the samepartner_ref(after 5 minutes forWALLET_UNCONFIRMED). We check the wallet and finish or close the order; you are never charged twice.payment:paid(wallet charged, refunds included) ·checking(charge still being confirmed) ·not_charged(cancelled before any charge, or a sandbox order).- Order
status: completed every eSIM issued · processing being prepared — pollGET /esim/orders/{id}or use a webhook · failed not issued (if your wallet was charged, it is credited back after our team's review).
Listing
GET /esim/orders?page=1&per_page=25— page-based,per_pageup to 100;metacarriespage,per_page,total.GET /esim/orders?ref=your-order-9F2K— returns one order object for thatpartner_ref, or404 NOT_FOUND.GET /esim/orders/{id}— by our order idHSGE-…. Scopebooking:readfor every read.
📱 eSIMs, usage, top-ups, cancel
{id} is hsg_esim_{n} or the ICCID. Only eSIMs of your own orders are found.
| Field | Meaning |
|---|---|
status | processing · ready (issued, not installed) · installed · active · used_up · expired · suspended · revoked · failed · cancelled |
iccid, lpa, qr_url | Install details, once issued. lpa is the manual activation code; qr_url is a HolidaySG link to the QR image. Treat both like a password: anyone holding them can install the eSIM. |
ios_install_url, android_install_url | One-tap install links for the traveller's phone. |
install_by, expires_at | Install before this date; the plan's end once active. |
data_total_mb, data_used_mb, data_remaining_mb, tracking. Refreshes every 2–3 hours upstream; on unlimited plans use status.topup_id, name, data_gb, validity_days, price (SGD).booking:write. Body { "topup_id": "...", "partner_ref": "..." }. Wallet debited first; same replay rules as orders. Use the same kind of key (sandbox or live) the eSIM was bought with, else 409 SANDBOX_MISMATCH.booking:cancel. Only an unused eSIM on a plan with supports_cancel. Answers 202 with cancel_requested: true and a refund_request id.409 NOT_CANCELLABLE).📄 eSIM statements
statement:read. Orders paid in that month, Singapore time.- Each row:
date,order_id,partner_ref,plans,amount,status,payment_status,refunded. Totals:orders,amount,refunded,net(SGD). - A sandbox key sees sandbox orders only; a live key sees live orders only.
- Orders placed in the B2B portal are included.
🔔 eSIM webhooks
eSIM events have their own endpoints and signature, separate from booking webhooks.
id, url, events, is_active, fail_count).{ "url": "https://...", "events": ["*"] }. The URL must be https and resolve to a public internet address; at most 5 endpoints. The signing_secret is shown once.{ "id": 12 } in the body.test.ping now and answers delivered: true|false.signing_secret for the same endpoint, shown once. The old secret stops signing at once, so update your server first or right after.Event (X-HSG-Event) | Sent when |
|---|---|
esim.ready | The eSIM was issued (install details available) |
topup.completed | A top-up was added |
esim.installed · esim.active | Installed on a phone · first connected |
esim.low_data · esim.expiring · esim.expired | Usage and validity milestones |
esim.cancelled | The eSIM was cancelled |
test.ping | Your test call |
order.failed · topup.failed | Reserved, not sent yet — poll the order |
POST https://your-endpoint
X-HSG-Event: esim.ready
X-HSG-Signature: t=1760420000,v1=<hex hmac_sha256( t + "." + rawBody, signing_secret )>
User-Agent: HolidaySG-Webhooks/1.0
Content-Type: application/json
{ "event": "esim.ready", "created": "2026-10-14T08:00:00+08:00", "data": { ... } }
- Sent from a queue, usually within a minute; 8-second timeout, redirects not followed. A failed delivery is retried up to 5 times, after 10 s, 30 s, 1 min, 5 min and 15 min, so the same event can arrive twice. Poll the order if you still missed one.
- An endpoint is switched off after 10 failed deliveries in a row (a delivery counts as failed only after its last retry).
- Verify with a constant-time comparison, reject a
tolder than 5 minutes, and de-duplicate onevent+data.id(order events) ordata.esim_id(eSIM events) and usecreatedto order deliveries; there is no separate event id.
Verify in PHP
$raw = file_get_contents('php://input');
preg_match('/t=(\d+),v1=([a-f0-9]+)/', $_SERVER['HTTP_X_HSG_SIGNATURE'] ?? '', $m);
$ok = $m && abs(time() - (int) $m[1]) <= 300
&& hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2]);
if (! $ok) { http_response_code(400); exit; }
Verify in Node
const crypto = require('crypto');
// rawBody = the exact bytes received (Buffer), before JSON parsing
const m = /t=(\d+),v1=([a-f0-9]+)/.exec(req.get('X-HSG-Signature') || '');
const expected = m && crypto.createHmac('sha256', secret).update(m[1] + '.' + rawBody).digest('hex');
const ok = m && Math.abs(Date.now() / 1000 - Number(m[1])) <= 300
&& m[2].length === expected.length
&& crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(m[2]));
if (!ok) return res.status(400).end();
🧾 eSIM sample responses
Complete examples of what the API returns. Values are examples; the fields and types are what you get. Every answer is wrapped as { "data": ..., "meta": { "timestamp": "..." }, "errors": [] }; only data is shown below.
Order (POST /esim/orders, GET /esim/orders/{id})
{ "id": "HSGE-20261108-7Q2M4X",
"partner_ref": "your-order-9F2K",
"status": "completed", // processing | completed | failed
"total": 12.40, "currency": "SGD",
"sandbox": false,
"channel": "api", // api | portal
"payment": "paid", // paid | checking | not_charged
"held": false,
"end_user_name": "A. Traveller",
"end_user_email": "traveller@example.com",
"created_at": "2026-11-08T09:15:02+08:00",
"esims": [ {
"esim_id": "hsg_esim_88",
"plan_id": "hsg_plan_123",
"plan": "Japan 1GB / 7 days",
"status": "ready", // processing | ready | installed | active | used_up | expired | suspended | revoked
"iccid": "8981100022152967123",
"lpa": "LPA:1$smdp.example$ABCD-1234",
"qr_url": "https://holidaysg.com/esim/qr/456/abc123",
"ios_install_url": "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=...",
"android_install_url": "https://esimsetup.android.com/esim_qrcode_provisioning?carddata=...",
"install_by": "2026-12-08T09:15:02+08:00",
"expires_at": null,
"has_phone_number": false } ] }
While an eSIM is still being prepared, status is processing and iccid, lpa, qr_url and the install links are null.
Usage (GET /esim/esims/{id}/usage)
{ "esim_id": "hsg_esim_88", "status": "active",
"data_total_mb": 1024, "data_used_mb": 312, "data_remaining_mb": 712,
"tracking": true,
"note": "Usage refreshes every 2-3 hours upstream. On unlimited plans use status." }
On an unlimited plan the three data_* figures can be null and tracking is false.
Top-up list (GET /esim/esims/{id}/topups)
[ { "topup_id": "TP-1GB-7D", "name": "1 GB / 7 days", "data_gb": 1, "validity_days": 7,
"price": 6.30, "currency": "SGD" } ]
POST /esim/esims/{id}/topup answers 201 with an order object like the one above (the order is a top-up; its esims list shows the eSIM that was topped up).
Cancel (POST /esim/esims/{id}/cancel)
// live key: a request only, answered 202
{ "esim_id": "hsg_esim_88", "cancel_requested": true, "refund_request": 31,
"note": "Cancellation is reviewed by our team; your wallet is credited after approval." }
// sandbox key
{ "esim_id": "hsg_esim_88", "cancelled": true, "sandbox": true }
Statement (GET /esim/statements?month=2026-11)
{ "month": "2026-11", "timezone": "Asia/Singapore", "currency": "SGD", "sandbox": false,
"orders": [ { "date": "2026-11-08", "order_id": "HSGE-20261108-7Q2M4X", "partner_ref": "your-order-9F2K",
"plans": [ "Japan 1GB / 7 days" ], "amount": 12.40, "currency": "SGD",
"status": "completed", "payment_status": "paid", "refunded": 0 } ],
"totals": { "orders": 1, "amount": 12.40, "refunded": 0, "net": 12.40 } }
Error (any call)
HTTP 402
{ "data": null, "meta": { "timestamp": "..." },
"errors": [ { "code": "INSUFFICIENT_BALANCE", "message": "..." } ] }
⏱ eSIM limits, retries and going live
Rate limits
- eSIM calls use the same per-partner limit as every other call on your key, by tier: tier 1 = 60, tier 2 = 300, tier 3 = 600, tier 4 = 1200 requests a minute. They share one counter with attractions, hotels and ferry.
- Every answer carries
X-RateLimit-LimitandX-RateLimit-Remaining. Over the limit you get429 RATE_LIMIT_EXCEEDEDwithRetry-After: wait that long. - A flood guard of 300 requests a minute per source IP runs before authentication.
Webhook delivery
- A failed delivery is retried up to 5 times (after 10 s, 30 s, 1 min, 5 min, 15 min), the same as booking webhooks; an 8-second timeout, redirects not followed. Make your handler safe to run twice.
- An endpoint is switched off after 10 failed deliveries in a row, each counted after its last retry (
fail_countonGET /esim/webhooks). - Treat webhooks as a hint and poll
GET /esim/orders/{id}as the source of truth: if you missesim.ready, the order still shows the eSIM.
The live-key ordering flow
- Fund your wallet in the partner portal. A live order is paid from it; there is no credit line unless we agreed one.
- List plans with
GET /esim/plansand note theprice. POST /esim/orderswith a newpartner_refand, if you like,expected_sgd(refused with409 PRICE_CHANGEDif the price moved). The wallet is debited first;402 INSUFFICIENT_BALANCEmeans nothing was charged.- The answer is
processingorcompleted. Wait for theesim.readywebhook or poll the order untilcompleted, then give the traveller theqr_urlorlpa. - After a timeout or a
5xx, retry with the samepartner_ref: you get the original order back and are never charged twice. - Refunds are never automatic: a cancel is a request that our team approves, then your wallet is credited.
⚠ eSIM errors
Same envelope: { data, meta: { timestamp, replayed? }, errors: [ { code, message } ] }. Every refusal before a charge says "Nothing was charged".
| HTTP | Code | Meaning |
|---|---|---|
| 401 | AUTH_UNAUTHORIZED | Bad / missing / IP-blocked key |
| 403 | AUTH_SCOPE_FORBIDDEN | Key lacks the scope, or a sub-agent account |
| 401 / 409 | SIGNATURE_* | See request signing |
| 429 | RATE_LIMIT_EXCEEDED | Slow down; honour Retry-After |
| 422 | VALIDATION_ERROR | Bad or missing parameters (e.g. both country and region, a bad webhook URL) |
| 422 | INVALID_PARTNER_REF | partner_ref missing or not 1–100 allowed characters |
| 422 | PLAN_UNAVAILABLE | Plan not found or not on sale right now |
| 422 | TOPUP_UNAVAILABLE | That top-up pack is not available for this eSIM |
| 422 | LIMIT_REACHED | Already 5 webhook endpoints |
| 404 | PLAN_NOT_FOUND / NOT_FOUND | No such plan, order, eSIM or webhook for your account |
| 409 | PARTNER_REF_REUSED | That partner_ref already names a different order or a top-up |
| 409 | PRICE_CHANGED | The price is no longer your expected_sgd |
| 409 | SANDBOX_MISMATCH | Top-up with a different kind of key than the eSIM was bought with |
| 409 | NOT_CANCELLABLE | Installed / used / expired, or the plan does not support cancel |
| 402 | INSUFFICIENT_BALANCE | Wallet too low — nothing was charged; top up in the partner portal |
| 502 | WALLET_UNAVAILABLE | The wallet could not be checked — nothing was charged; retry with the same partner_ref |
| 502 | WALLET_UNCONFIRMED | The charge could not be confirmed — retry with the same partner_ref in 5 minutes; never charged twice |
| 503 | ESIM_B2B_CLOSED | Live partner orders are paused |
| 503 | LIVE_NOT_READY | Live orders open shortly; use your sandbox key |
| 503 | SANDBOX_UNAVAILABLE | A sandbox key asked for a plan with a phone number, which cannot be simulated — use your live key |
| 503 | SANDBOX_CLOSED | B2B portal: test orders are closed now that eSIM is live |
| 503 | ESIM_UNAVAILABLE | eSIM service temporarily unavailable — retry; a write is safe to retry with the same partner_ref |
| 500 | INTERNAL_ERROR | Something failed on our side — retry with the same partner_ref |
🧪 eSIM sandbox
- A sandbox key can order and top up as a simulation. HolidaySG eSIM is live, so a sandbox order is answered by us without asking the supplier: nothing is charged, no wallet is debited, and no real eSIM is made. The eSIM it returns is a test one (its ICCID starts with
89000SIM, the install address cannot be installed and there is no QR image). - Reading usage, listing top-ups, topping up and cancelling work on a simulated eSIM too, with fixed test figures (one top-up,
SIM-TOPUP-1GB; a cancel is accepted and no refund is made). Theesim.readyandtopup.completedwebhooks are sent for simulated orders, so you can test your endpoint. - A plan with a phone number is not simulated: a sandbox key gets
503 SANDBOX_UNAVAILABLEfor it. The B2B portal test tick is closed now that eSIM is live (503 SANDBOX_CLOSED). To test a real order, use a live key: it is paid from your wallet, so start with the smallest plan. - Statements keep sandbox and live orders apart.
- Test scenarios to run on a sandbox key:
The wallet-balance error (# Do this You should see 1 GET /esim/countries,/esim/plansPlans with priceandplan_id2 POST /esim/orderswith a newpartner_ref201,sandbox: true,payment: not_charged, one eSIMreadywith an89000SIMICCID3 Send the same partner_refagain200, same order,meta.replayed: true4 Send the same partner_reffor a different plan409 PARTNER_REF_REUSED5 GET /esim/esims/{id}/usageFixed test figures (1024 MB total, 0 used) 6 GET /esim/esims/{id}/topups, thenPOST .../topupwithSIM-TOPUP-1GBOne pack; 201with a top-up order7 POST /esim/esims/{id}/cancelcancelled: true,sandbox: true, no refund8 POST /esim/webhooks, thenPOST /esim/webhooks/{id}/testand place an ordertest.ping, thenesim.ready(andtopup.completedfor a top-up), signed9 GET /esim/statements?month=YYYY-MMYour sandbox orders only 10 Order with an unknown plan_id; a wrong signature422 PLAN_UNAVAILABLE; a signature error402 INSUFFICIENT_BALANCE) andPRICE_CHANGEDneed a live key, because a sandbox key has no wallet. There are no special test plans: use any plan on sale.
🏨 Hotels overview
Search hotels, read live room rates, lock a price with a quote and book from your HolidaySG wallet or credit line — through the same API, keys and signing as the rest of this reference.
| Property | Value |
|---|---|
| Base URL | https://holidaysg.com/api/b2b/v1/hotels — same X-Api-Key, IP allowlist, rate limits and request signing on writes |
| Access | Hotels are enabled for your key by your account manager. Until then every hotel path answers 403 AUTH_SCOPE_FORBIDDEN. |
| Money | Prices are your nett price in SGD (what you pay), paid from your wallet or credit line (payment_method). You set your own selling price. |
| Sandbox keys | A booking made with a sandbox key is confirmed as a simulation: nothing is sent to the hotel and nothing is charged. |
| IDs | Hotels by slug · rates by rate_id · quotes quote_id · bookings by booking_id (our order reference) |
| Policy | Every booking follows the Hotel Booking Policy and its Partner Hotel Terms (policy_url in the answers). |
catalog:read).catalog:read).quote:write).booking:write, signed, Idempotency-Key).booking:read).booking:cancel, signed).🔎 Search & rates
Guests: send adults (1–6) and children[] (each child's age, 0–17) for one room, or rooms[] (up to 9) with adults and children[] each. residency is the lead guest's nationality (ISO-2, e.g. in): send the real one, the price can depend on it.
GET /hotels?destination=Singapore&checkin=2026-11-21&checkout=2026-11-23&adults=2&residency=sg&per_page=25
→ 200 { "data": [ {
"slug": "...", "name": "...", "city": "Singapore", "country": "Singapore",
"star_rating": 4, "review_score": 8.6, "image": "...",
"from": { "total": 412.30, "per_night": 206.15, "currency": "SGD", "nights": 2,
"meal": "nomeal", "refundable": true, "taxes_at_hotel": [] }
} ], "meta": { "per_page": 25, "next_cursor": "..." }, "errors": [] }
Next page: repeat the call with cursor=<next_cursor>. Only hotels with a bookable rate for the dates are returned.
GET /hotels/{slug}/rates?checkin=2026-11-21&checkout=2026-11-23&rooms[0][adults]=2&residency=sg
→ 200 { "data": {
"hotel": { "slug": "...", "name": "...", "check_in_time": "15:00", "check_out_time": "12:00",
"important_information": { "Deposit": ["Deposit for keys · may be asked — USD 10.00 per room per stay"], ... },
"important_notes": "...", "policy_url": "https://holidaysg.com/hotel-booking-policy" },
"checkin": "2026-11-21", "checkout": "2026-11-23", "nights": 2,
"rates": [ { "rate_id": "...", "room": "Deluxe Double Room", "room_group": "...", "bedding": "...",
"meal": "breakfast", "has_breakfast": true, "allotment": 3,
"total": 412.30, "per_night": 206.15, "currency": "SGD",
"taxes_at_hotel": [ { "name": "city_tax", "amount": 12.00, "currency": "USD" } ],
"cancellation": { "summary": "Free cancellation until 19 Nov 2026, 20:00 (UTC+0) · 20 Nov 2026, 04:00 Singapore time",
"free_cancellation_before": "...", "refundable": true, "tiers": [ ... ] } } ] } }
important_information (the hotel's rules: deposits, children, extra beds, parking, pets, no-show, check-in / check-out fees …), important_notes, taxes_at_hotel (paid at the hotel, not included in total) and the cancellation deadline, which is given in the hotel's time (UTC+0) and Singapore time.🔒 Hotel quotes
A quote re-checks the rate with the hotel and locks its price until expires_at. Book before it expires.
POST /hotels/quotes
{ "slug": "...", "rate_id": "...", "checkin": "2026-11-21", "checkout": "2026-11-23",
"rooms": [ { "adults": 2, "children": [7] } ], "residency": "sg", "expected_total": 412.30 }
→ 201 { "data": { "quote_id": "...", "slug": "...", "checkin": "2026-11-21", "checkout": "2026-11-23",
"room": "...", "meal": "...", "total": 412.30, "currency": "SGD", "price_changed": false,
"taxes_at_hotel": [ ... ], "cancellation": { ... }, "expires_at": "...",
"important_information": { ... }, "important_notes": "...", "policy_url": "..." } }
When price_changed is true, the hotel's price moved since your rates call: show the new total to your customer before booking. A rate the hotel can no longer confirm answers 409 QUOTE_PRICE_UNAVAILABLE — call /rates again for fresh rate IDs.
📘 Hotel bookings
Signed request with an Idempotency-Key header. One key = one booking: repeating the same request returns the same booking.
POST /hotels/bookings
Idempotency-Key: 6f1c…
{ "quote_id": "...", "payment_method": "wallet",
"customer": { "name": "Lead Guest", "email": "guest@example.com", "phone": "+6591234567",
"special_requests": "High floor, late arrival" },
"guests": [ { "room": 1, "first_name": "Lead", "last_name": "Guest" },
{ "room": 1, "first_name": "Child", "last_name": "Guest", "is_child": true, "age": 7 } ] }
→ 201 { "data": { "booking_id": "HSG-…", "status": "confirmed", "hotel": { ... }, "checkin": "...", "checkout": "...",
"room": "...", "meal": "...", "guests": [ ... ], "total": 412.30, "currency": "SGD",
"taxes_at_hotel": [ ... ], "cancellation": { "summary": "...", ... },
"hotel_confirmation_number": null, "refunded": false, "refund_status": null,
"invoice_number": null, "credit_note_number": null, "created_at": "..." } }
| Answer | Meaning |
|---|---|
201 status: confirmed | Booked and paid. |
202 BOOKING_PENDING_CONFIRMATION | Paid and sent to the hotel; the hotel has not confirmed yet. Poll GET /hotels/bookings/{id}. Do not retry. |
502 BOOKING_CONFIRM_FAILED | The hotel did not confirm. Our team reviews it and credits your wallet / credit line after approval (refund_status: pending_approval). |
402 INSUFFICIENT_FUNDS / CREDIT_LIMIT_EXCEEDED | Not enough wallet balance / credit. Nothing was charged. |
404 QUOTE_NOT_FOUND · 409 QUOTE_EXPIRED | Request a new quote. |
400 IDEMPOTENCY_KEY_REQUIRED · 409 IDEMPOTENCY_KEY_MISMATCH | Missing key, or the key was used for a different booking. |
Guest names: letters, spaces, hyphens and apostrophes only, as on the passport; at least one adult with a full name per room. hotel_confirmation_number is filled when the hotel sends it, which can be after the booking is confirmed. status is one of processing, confirmed, failed, cancelled. invoice_number: your invoice from HolidaySG, downloadable on the booking in the B2B portal.
↩️ Hotel cancellation & refunds
POST /hotels/bookings/{id}/cancel
→ 200 { "data": { "booking_id": "HSG-…", "status": "cancelled", ..., "refund": 380.10, "refund_status": "pending_approval" } }
- The refund is the nett price you paid minus the hotel's penalty at the time you cancel. There is no HolidaySG cancellation fee for partners.
- Refunds are never automatic. Our team checks and approves every refund, then credits your wallet or credit line;
refund_statusmoves frompending_approvaltorefundedandcredit_note_numberis filled. - No-shows and early departures are not refunded. A booking past its cancellation deadline, or already cancelled, answers
409 BOOKING_NOT_CANCELLABLE(nothing moved); if the hotel could not confirm the cancellation in time you getBOOKING_CANCEL_UNCONFIRMED— our team follows up. - Names, dates and rooms cannot be changed: cancel and book again.
💬 Special requests & questions
- When booking:
customer.special_requests(up to 250 characters) is sent to the hotel with the booking. The hotel decides; requests are not guaranteed. - After booking: there is no messaging endpoint. Use "Ask about this booking" on the booking in the B2B portal, or contact our team with the
booking_id; we contact the hotel for you.
⛴️ Ferry overview
Search ferry sailings, get the exact price for a chosen sailing and book from your HolidaySG wallet — through the same API, keys and signing as the rest of this reference.
| Property | Value |
|---|---|
| Base URL | https://holidaysg.com/api/b2b/v1/ferry — same X-Api-Key, IP allowlist, rate limits and request signing on writes |
| Access | Your key needs the ferry supplier scope; otherwise every ferry path answers 403 AUTH_SCOPE_FORBIDDEN. |
| Money | Prices are set by HolidaySG, in SGD, and worked out on our server. You pay from your wallet only. You set your own selling price. |
| Sandbox keys | A booking made with a sandbox key is checked and priced, then answered as a simulation (booking_id starts SBX-, sandbox: true). Nothing is booked and nothing is charged. A simulated booking can be read with GET /ferry/bookings/SBX-… for 7 days (your key only); a cancel request on it is answered but sent to nobody. Repeating the same Idempotency-Key with the same request returns the same SBX- booking (200); a different request on the same key answers 409 IDEMPOTENCY_KEY_MISMATCH. |
| Not available here | Visa and flight reservation services are not part of the partner API. |
catalog:read).catalog:read).quote:write).booking:write, signed, Idempotency-Key).booking:read).booking:cancel, signed).🔎 Ferry search & quote
Start with GET /ferry/sectors: each sector has an id such as SIN-BAT (origin-destination), and the list of nationalities you may send for passengers. Up to 9 passengers per booking.
POST /ferry/search
{ "sector_id": "SIN-BAT", "depart_date": "2026-12-05", "adult_qty": 2, "child_qty": 1 }
→ 200 { "data": { "currency": "SGD", "roundTrip": false,
"departTrips": [ { "id": "...", "departTime": "...", "arriveTime": "...", "vessel": "...",
"seats": 40, "soldOut": false, "isOpen": false,
"adultPrice": 28.50, "childPrice": 24.00, "offSale": false } ],
"returnTrips": [], "twoWay": null }, "meta": {...}, "errors": [] }
Two way: add return_date (or "open_ticket": true for an open return) and, if the return is a different sector, return_sector_id. Per-person prices for a two way trip depend on the pair, so take them from the quote. A sailing with soldOut or offSale true cannot be booked.
POST /ferry/quote
{ "sector_id": "SIN-BAT", "depart_date": "2026-12-05", "trip_id": "...", "adult_qty": 2, "child_qty": 1 }
→ 200 { "data": { "currency": "SGD", "adultPrice": 28.50, "childPrice": 24.00, "total": 81.00,
"departTime": "...", "returnTime": null }, ... }
A sailing that is no longer bookable answers 409. Search or quote trouble is returned as FERRY_<http status> (for example FERRY_503 when schedules are unavailable): try again shortly.
🎫 Ferry bookings
Send the quote fields plus the contact and one entry per traveller (adults and children together). Send expected_total = the quote total: if our price has moved you get 409 PRICE_CHANGED and nothing is charged.
POST /ferry/bookings (signed, Idempotency-Key required)
{ "sector_id": "SIN-BAT", "depart_date": "2026-12-05", "trip_id": "...", "adult_qty": 2, "child_qty": 1,
"expected_total": 81.00,
"contact": { "name": "...", "email": "...", "mobile": "..." },
"passengers": [ { "name": "...", "gender": "M", "birthDate": "1990-04-02",
"passportNo": "...", "passportExpiryDate": "2030-01-01", "nationalityId": "SG" } ] }
→ 201 { "data": { "booking_id": 123, "booking_ref": "...", "supplier_ref": "... (deprecated, same as booking_ref)", "status": "...", "sector": "SIN-BAT",
"depart_date": "2026-12-05", "return_date": null, "adults": 2, "children": 1,
"total": 81.00, "currency": "SGD" }, ... }
| Answer | Meaning |
|---|---|
201 / 200 | Booked / the same booking again (same Idempotency-Key). |
202 | Paid but under review by our team. Do not retry; read the booking later. |
402 INSUFFICIENT_FUNDS / PAYMENT_FAILED | Wallet too low / payment failed. Nothing was booked. |
409 SAILING_UNAVAILABLE · PRICE_CHANGED | Search or quote again. |
409 REQUEST_IN_PROGRESS · PAYMENT_UNDER_REVIEW | Same key still running / payment taken but the booking needs review: do not retry, contact us. |
422 IDEMPOTENCY_KEY_REQUIRED · PASSENGER_COUNT · RETURN_DATE_REQUIRED | Fix the request. |
500 BOOKING_REVIEW | Wallet was debited but the booking needs review. Do not retry; our team follows up. |
Passenger names: letters, spaces, hyphens, apostrophes and full stops, as on the passport. Passport details are stored encrypted and masked after travel. GET /ferry/bookings/{id} returns the same fields for your own bookings; others answer 404.
↩️ Ferry cancellation
POST /ferry/bookings/{id}/cancel (signed) { "reason": "optional, up to 300 characters" }
→ 202 { "data": { "booking_id": 123, ..., "cancel_requested": true, "note": "Request received. ..." } }
- This is a request. Our team reviews it; nothing is cancelled or refunded automatically.
- A refund, if any, follows the normal review and is credited to your wallet after a person approves it.
- Repeating the call returns the same request. An already cancelled booking answers
409 ALREADY_CANCELLED.
👛 Wallet & credit
Two ways to settle. Both are debited atomically at booking time.
| Method | How it works |
|---|---|
| Wallet | Pre-fund by card; each booking debits the balance; refunds credit it back. Too low → 402 INSUFFICIENT_FUNDS (nothing charged). |
| Credit | Book now, settle later against an approved limit; refunds reverse the charge. Over limit → 402 CREDIT_LIMIT_EXCEEDED. |
Top-ups are done by card in the partner portal (not via this API — card handling stays on our PCI surface).
📄 Statements
Statements are the source of truth for reconciliation. They are generated at month close and available for every period you were active. The listing returns the most recent 36 months.
🧪 Sandbox & certification
Build safely on a sandbox key — bookings are simulated (no real inventory, no real money) — then certify to go live.
| Sandbox key | Production key | |
|---|---|---|
| Bookings | Simulated — confirmed instantly, no supplier ticket issued | Real supplier reservation |
| Money | No wallet charge, no refund — nothing moves | Wallet is debited / refunded |
| Booking ref | Prefixed SBX- | Real supplier reference |
Certification checklist
{ "data": { "sandbox_key": true, "certified": false, "completed": 4, "total": 7,
"steps": [ {"key":"auth","done":true}, {"key":"catalog","done":true},
{"key":"availability","done":true}, {"key":"quote","done":true},
{"key":"signing","done":false}, {"key":"booking","done":false}, {"key":"cancel","done":false} ] } }
auth · catalog · availability · quote · signing · booking · cancel. The checklist is computed from your real request log. Once certified is true, your account manager issues a production key (and credit line, if agreed).Sandbox test products
The sandbox contains a set of test products designed to cover all integration scenarios. Use these product ids in your sandbox calls:
| Product ID | Name | Scenario |
|---|---|---|
hsgp_test_1 | Test Attraction — Standard | Standard flow: single option, ADULT + CHILD ticket types, always available |
hsgp_test_2 | Test Attraction — Multi-option | Multiple options (Half-Day, Full-Day, VIP), each with different ticket types |
hsgp_test_3 | Test Attraction — Traveller details | Requires per-traveller answers (passport name, gender, DOB) — tests traveller_answers handling |
hsgp_test_4 | Test Attraction — Capacity limited | Max 2 pax per booking — tests capacity validation |
hsgp_test_5 | Test Attraction — Weekday only | Available Mon–Fri only — tests date validation and operating-day handling |
hsgp_test_err | Test Attraction — Error scenarios | Used with special inputs to trigger specific error codes (see test cases below) |
Mandatory test cases
Partners must complete these test scenarios before going live. Progress is tracked automatically from your sandbox API calls.
1 — Happy path: full booking lifecycle
Complete the standard flow end to end with hsgp_test_1.
| Step | Call | Expected result |
|---|---|---|
| 1. Auth | GET /ping or GET /me | 200 with partner details |
| 2. Catalog | GET /products | 200 with product list including hsgp_test_1 |
| 3. Availability | GET /products/hsgp_test_1/availability?date=<tomorrow>&pax=2 | 200 with available: true and at least one ticket_type_id |
| 4. Quote | POST /quotes with the returned ticket_type_id, quantity 2 | 200 with quote_id, total, expires_at ~15 min in the future |
| 5. Signing | POST /signature/verify with valid HMAC headers | 200 with verified: true |
| 6. Book | POST /bookings (signed + Idempotency-Key) with the quote_id | 201 with status: "confirmed", booking_id prefixed SBX- |
| 7. Cancel | POST /bookings/{id}/cancel (signed) | 200 with status: "cancelled" |
2 — Idempotent booking retry
| Step | Call | Expected result |
|---|---|---|
| 1. Book | POST /bookings with a fresh quote + Idempotency-Key: idem-test-1 | 201 confirmed |
| 2. Retry | Repeat the exact same request with the same Idempotency-Key | 200 returning the original booking — no double charge |
3 — Expired quote
| Step | Call | Expected result |
|---|---|---|
| 1. Quote | POST /quotes for hsgp_test_1 | 200 with quote_id |
| 2. Wait | Wait for the quote to expire (15 min), or use quote_id value q_expired_test | — |
| 3. Book | POST /bookings with the expired quote | 409 QUOTE_EXPIRED — no funds moved |
4 — Insufficient funds
| Step | Call | Expected result |
|---|---|---|
| 1. Book | POST /bookings with a valid quote and customer name containing INSUFFICIENT (e.g. "name": "Test INSUFFICIENT") | 402 INSUFFICIENT_FUNDS — no funds moved |
5 — Duplicate idempotency key with different payload
| Step | Call | Expected result |
|---|---|---|
| 1. Book | POST /bookings with Idempotency-Key: idem-conflict-1 and a valid quote | 201 confirmed |
| 2. Mismatch | POST /bookings with same key idem-conflict-1 but a different quote_id | 409 IDEMPOTENCY_KEY_MISMATCH |
6 — Traveller answers required
| Step | Call | Expected result |
|---|---|---|
| 1. Availability | GET /products/hsgp_test_3/availability?date=<tomorrow> | 200 with questions array on ticket types (passport name, gender, DOB) |
| 2. Quote | POST /quotes for hsgp_test_3 | 200 with quote_id |
| 3. Book without answers | POST /bookings without traveller_answers | 422 TRAVELLER_ANSWERS_REQUIRED |
| 4. Book with answers | POST /bookings with valid traveller_answers | 201 confirmed |
7 — Signature validation errors
| Scenario | How to trigger | Expected result |
|---|---|---|
| Missing signature | Call POST /bookings without X-Api-Signature headers | 401 SIGNATURE_MISSING |
| Bad signature | Send a X-Api-Signature computed with the wrong secret | 401 SIGNATURE_INVALID |
| Timestamp skew | Set X-Api-Timestamp to a value >5 minutes in the past | 401 SIGNATURE_TIMESTAMP_SKEW |
| Replay | Re-send the exact same X-Api-Nonce on a second signed request | 409 SIGNATURE_REPLAY |
8 — Cancelling a non-cancellable booking
| Step | Call | Expected result |
|---|---|---|
| 1. Cancel twice | POST /bookings/{id}/cancel on an already-cancelled booking | 200 (idempotent — no second refund) |
| 2. Past cut-off | Cancel a booking with customer name containing NOCANCEL | 409 BOOKING_NOT_CANCELLABLE — no funds moved |
9 — Scope and auth errors
| Scenario | How to trigger | Expected result |
|---|---|---|
| No API key | Call any endpoint without X-Api-Key | 401 AUTH_UNAUTHORIZED |
| Invalid key | Send a made-up key value | 401 AUTH_UNAUTHORIZED |
| Missing scope | Call POST /bookings with a key that only has catalog:read | 403 AUTH_SCOPE_FORBIDDEN |
10 — Validation and not-found errors
| Scenario | How to trigger | Expected result |
|---|---|---|
| Invalid product | GET /products/nonexistent/availability?date=2026-09-30 | 404 PRODUCT_NOT_FOUND |
| Missing date | GET /products/hsgp_test_1/availability (no date param) | 422 VALIDATION_FAILED |
| Past date | GET /products/hsgp_test_1/availability?date=2020-01-01 | 422 VALIDATION_FAILED |
| Unknown booking | GET /bookings/b_nonexistent | 404 BOOKING_NOT_FOUND |
| Missing idempotency key | POST /bookings without Idempotency-Key header | 400 IDEMPOTENCY_KEY_REQUIRED |
GET /certification at any time to see which steps remain. Once all 7 steps pass and your account manager has reviewed your integration, a production key is issued.📘 Glossary
| Term | Meaning |
|---|---|
| Product | A bookable attraction, tour or ticket in the catalog |
| Option | A variant of a product (duration/package/session) |
| Ticket type | The smallest priced unit within an option (pax category) |
| Quote | A 15-minute, single-use price lock |
| Nett cost | Supplier cost — never exposed to partners |
| Commission | Your margin band, baked into unit_price |
| Idempotency key | A per-attempt token that makes booking retries safe |
| Nonce | A single-use value that stops signed-request replays |
Need a key, a higher tier, a credit line, or voucher-payload delivery? Contact your HolidaySG account manager.