Starship Rewards API
Getting Started

Integration Journey

The four stages every Starship integration passes through, with the concrete deliverables at each stage

Integration Journey

Every production Starship integration passes through four stages. They're not strictly linear — you may iterate back to earlier stages as requirements solidify — but the dependency arrows below are real. Skipping them leads to the common failure modes we've seen: quoting engines that don't match billing, retry loops that double-charge, production rollouts with no sandbox parity.

The four stages of a Starship integration
Stage 0 — Access
API key + secret provisioned · sandbox URLs confirmed · IP whitelist sent
Stage 1 — Read-only Explore
List products · inspect reference data No money moves
Stage 2 — Quote & Order
Charges API quote → sandbox wallet top-up → POST /orders First vouchers delivered against sandbox
Stage 3 — Production Canary
Prod credentials · real wallet · 1–5% of live traffic Observe for 48–72 h · compare to sandbox baseline
Stage 4 — Full Production
Webhooks wired · reconciliation job running Alerting on PENDING > 24 h

Each stage has a concrete exit criterion — see the table below. Do not skip a stage to hit a launch deadline; the cost of debugging a production incident far exceeds two more days of sandbox testing.

Stage-by-stage deliverables

Stage 0 — Access

Exit criterionHow to verify
You have a sandbox API key + secretecho $X_API_KEY | head -c 8 returns sk_test_
Your egress IPs are whitelistedcurl https://api-playground.starshiprewards.com/api/v1/products -H "X-API-Key: $K" -H "X-API-Secret: $S" returns 200
You have a copy of your negotiated discount sheetYou know which products have CPD rows and what the % is

Blockers: IP whitelist changes take 24–48 h. Request yours from your Starship contact on day one.

Stage 1 — Read-only Explore

Exit criterionHow to verify
You can list products, filter by country + currency, and paginateYour catalog ingestion runs without errors
You can fetch a single product and read its delivery_timeYour UI shows "Delivered instantly" vs "Delivery within hours" copy correctly
You can resolve a Charges API quote for a known productYour checkout "Pay now" amount matches the API total exactly

Common mistakes: caching delivery_time for hours (it can flip with each inventory pump — re-quote at order time), hardcoding a CPD % in your frontend (CPD changes without notice; trust the Charges API).

Stage 2 — Quote & Order

Exit criterionHow to verify
You've funded your sandbox wallet and placed 20+ sandbox ordersWallet balance decreases exactly by the quoted total for each order
Both INSTANT and DELAYED delivery paths exercisedYou've received order-pending-then-delivered webhook sequences
Your order creation uses Idempotency-Key on every callA simulated timeout + retry does not double-charge
Your GET /orders/:id polling backs off after initial 60 sYour polling doesn't trigger 429 E_REQUEST_THROTTLED under load

Common mistakes: omitting Idempotency-Key ("my retries are rare so it won't matter"), polling too fast (429), assuming PENDING means "in progress" (it means "parked, awaiting admin or inventory pump").

Stage 3 — Production Canary

Exit criterionHow to verify
Production credentials provisioned in a separate env from sandboxSandbox traffic cannot accidentally hit prod due to an env-var typo
1–5 % of live traffic routed to Starship for at least 48 hYour A/B metrics show no user-facing regression
Webhook endpoint is reachable from Starship's egress IPsNo failed deliveries in the stats response
Reconciliation job matches Starship's ledger to yours dailyZero unexplained discrepancies over a 48 h window

Common mistakes: reusing sandbox credentials in prod (they'll 401 — embarrassing at best, outage at worst), skipping the canary because "sandbox worked" (prod has different vendors, different inventory depth, different FX timing).

Stage 4 — Full Production

Exit criterionHow to verify
Alerting on orders PENDING > 24 hAn ops dashboard surfaces them; someone is paged
Alerting on wallet balance below a threshold you can live withYou get a day's notice before you'd run out
Runbook for "Starship is down" exists and has been rehearsedOn-call knows how to fail open (disable rewards temporarily) vs fail closed (queue and replay)

What to build in parallel

Don't wait until Stage 3 to build these — they're load-bearing and take real engineering time:

  • A wallet-balance dashboard — otherwise no one notices until orders start failing with PAYMENT_REQUIRED.
  • A PENDING stuck-orders report — orders that never closed out need human attention.
  • Event de-duplication in the webhook handler — Starship may retry a webhook after a lost 2xx, and your handler must not double-process.
  • A reconciliation job — a nightly diff of your ledger vs. Starship's. Silent 0.05-per-order drift compounds to real money over a quarter.

Next

Quickstart — five curl commands, sandbox to first voucher