orderId immediately,
then poll until the codes are ready.
Statuses
Some - but not all - codes were delivered. The response includes
delivered, total, and
products[].codes for every code that was delivered (fewer than quantity on each line).
See Partial deliveries below.Codes are returned when
status is completed or partially_completed. While
processing, you receive
{"status": "processing", "message": "Order is still processing"} with no codes.wallet snapshot with your current
balances and low-balance flag.
The flow
1
Place the order
POST /orders returns 202 Accepted with orderId, status: "processing",
estimatedReadyAt, and wallet.2
Wait for the estimate
estimatedReadyAt tells you roughly when codes will be ready. It scales with the order
size - small orders are near-instant; large orders take longer.3
Poll the order
GET /orders/{reference} by orderId or externalOrderCode. Repeat until you get a
terminal status (completed, partially_completed, or failed).Order pricing
Each line inorderProducts carries a unit price in minor units (validated against the catalog).
Multi-line example
Two fixed-price products totalling 15000 minor units (GBP 100.00 + GBP 50.00):Regional products
A regional product can be sold in several countries. The catalog returns one row per country, all with the sameproductCode, and each row lists every market in
availableCountries. Tell Kalixo which market to fulfil with country on the order line:
Redemption codes
When an order completes - or partially completes - each line includes acodes array with
one object per delivered unit:
2 with two successful deliveries yields two { code } entries. On a
partially_completed order, codes.length may be less than quantity for a line.
Large orders
Use the samePOST /orders endpoint for any quantity. The response includes an
estimatedReadyAt timestamp that scales with the order size - larger orders may take longer
to complete.
Poll GET /orders/{reference} until you reach a terminal status. While the order is still
processing, you’ll see "message": "Order is still processing". When completed or
partially_completed, the response includes delivered codes in products[].codes.
Polling cadence
Poll at or after
estimatedReadyAt, then every minute or so. Avoid tight polling loops.Idempotency
Re-submitting the same
externalOrderCode returns 202 with the existing order - never a duplicate.Partial deliveries
If you receivepartially_completed:
- Save the codes in
products[].codes- these are the units that were delivered. - Compare
deliveredandtotal, and each line’scodes.lengthvsquantity, to see what is still outstanding. - Do not place a new order for the missing quantity - billing and idempotency risks apply.
- Contact support at [email protected] with your
orderIdandexternalOrderCodefor the remaining units.
Polling example
The example waits untilestimatedReadyAt, then polls once a minute. It retries rate limits,
5xx responses and network errors with backoff, and gives up after a maximum wait. Other
4xx responses are not retried: they need a fix on your side.
Node