Before you begin
- Link the customer first. Use the same
partnerMemberIdyou used when they linked. See Account linking. - Register a signing key and get your key ID. See Sign your requests.
- Use the base URL for your environment. See Environments and credentials.
How it works
You build the event as JSON, sign the exact bytes, and post them. Bilt answers202 and checks the event a few seconds later. Field rules and eight worked examples are on Report an order event.
Steps
1
Build the event
Set
orderId, partnerMemberId, currency, createdAt, and a new idempotencyKey. Pick the order.type for what happened and set order.status to the order status after it.Add payments only when money moved: an authorization, a capture, a void, or a refund. Add one entry per tender that changed.Every listed field is required unless the reference says optional. Send empty arrays as []. Send money as strings with two decimals, such as "12.50". An unknown key rejects the whole event.2
Sign it
Serialize the JSON once and sign those bytes. Add the
webhook-id, webhook-timestamp, webhook-signature, and X-Bilt-Key-Id headers. See Sign your requests.3
Post it
Send one event to Report an order event:To send up to 100 events in one request, wrap them as
{"events": [...]} and post to Report a batch. The batch has one webhook-id, one signature, and a 1 MiB limit.4
Handle the response
A
202 means Bilt stored the request. It does not mean Bilt accepted the event. On a 400 or 413, fix the request, because Bilt stored nothing. On a timeout or a 500, retry with the same webhook-id and body, signed again.5
Send the next change
Send each later event when it happens, with the same
orderId and a new idempotencyKey. If Bilt rejects an event, see Handle rejections and resends.cardDetails, never in a line item or a reason. Bilt stores every event as you sent it.
What can go wrong
- The amounts do not add up. Bilt rejects the event with
SUM_MISMATCH. order.statusis not allowed for theorder.type. Bilt rejects it withSTATUS_MISMATCH.- The customer has not linked yet. Bilt holds the event with
CONSUMER_NOT_LINKED. - An event arrives before its
PURCHASE. Bilt holds it withORIGINAL_ORDER_NOT_FOUND. - A signing header is missing or too long. Bilt answers
400.