Going live
Work through this before your first real order. Most of it is about what happens when something goes wrong, because that is what separates an integration that survives from one that pages you at 3am.
Credentials
Section titled “Credentials”- A live key exists, created by an Owner or Admin.
- It holds only the scopes you call. Drop
orders:writefrom a key that only reads. - The secret is in a secret store — not in your repository, not in an environment variable committed to an image.
- You know how to rotate. The old secret keeps working during the transition, so rotation needs no downtime.
- Optional: an IP allowlist on the key, if your egress addresses are fixed.
Correctness
Section titled “Correctness”- Every order sends an
Idempotency-Keythat is persisted before the call, so a retry reuses it. See Idempotency. - You branch on
code, never onmessage. -
request_idis written to your logs on every error. - Access tokens are cached for their hour rather than fetched per request.
-
429,500and503retry with exponential backoff and jitter. -
422does not retry.
- Balance is monitored, and someone is alerted before it runs out. Subscribe
to
balance.low. - You handle
insufficient_balanceas a real branch in your checkout, not as a generic failure. - If you show a price before ordering, you send
expected_totalso a price move rejects the order rather than surprising the customer.
Delivery
Section titled “Delivery”- Your webhook endpoint verifies the signature and rejects anything that fails. See Webhooks.
- It is idempotent on the event
id— duplicate deliveries are expected. - It returns
2xxquickly and does its real work asynchronously. - You have a reconciliation path that polls for anything a webhook missed, so a delivery outage cannot leave an order permanently stuck.
Before the first sale
Section titled “Before the first sale”- Sandbox ids are gone from configuration and caches.
- One small live order has been placed, installed, and confirmed on a real device.
- You know which of your own alerts fires when the API returns errors.
