| Environment | Base URL | Credential |
|---|---|---|
| Sandbox | https://api.staging.maple.inc/v1 | mpk_test_… |
| Production | https://api.maple.inc/v1 | mpk_live_… |
The only differences between environments are the base URL and the credential. Your request and response
shapes, webhook signing, and the order loop are identical — so going live is a configuration change, not a rewrite.
Why this matters
The sandbox lets you exercise the full order loop against data that can’t affect a real merchant or charge a real customer. Once your webhook handler verifies signatures correctly and you’ve driven orders end to end, switching to production is a base-URL-and-credential swap.Telling environments apart in your code
The sandbox and production are separate deployments on different hosts, so a request or webhook belongs to whichever environment its host and credential do — you don’t infer it from the payload. Where you do want it explicitly:GET /v1/mereturns the credential’senvironment(testorlive).- The order resource carries
livemode—truein production,falsein the sandbox.
A test-first workflow
Build against the sandbox
Point your client at
https://api.staging.maple.inc/v1 with your mpk_test_… key. Connect to the sandbox
location Maple grants you, subscribe a webhook, and exercise the full order loop.Prove your webhook handler
POST /v1/webhook_subscriptions/{id}/test delivers a signed webhook.test event so you can confirm signature
verification and your 2xx response before any real order exists.Going-live checklist
- Your client’s base URL and credential both point at the same environment.
- Your webhook handler verifies the HMAC signature and rejects bad or stale signatures. See Webhooks.
- You dedupe deliveries on the envelope
id(delivery is at-least-once). - You respond
2xxquickly and do slower work asynchronously. - Decision calls are retried safely on transient errors (they’re replay-safe).
- You store the live signing secret (
mwhsec_…) securely — it’s shown only once.