Customers & growth · Developer marketing
Sandbox/playground strategy
Best for Early Startup to Startup
Use it when
Developers need to try your API and test their integration without real money, data or side effects, and you must decide what test environment to offer and how.
Skip it when
- You need one place where developers find docs, keys, the sandbox and help. Use Developer portal framework, which links to this environment.
- You do not yet know which stage of the developer journey loses people. Use Developer experience (DX) framework first, which feeds this.
- You need the short guide that takes developers to a first working call. Use Quick start framework.
- Developers are moving to a new version with breaking changes. Use Migration guide framework, which this feeds.
What to apply first and what to use instead are listed below.
Approaches
Test mode on the real platform
Developers use test keys or a sandbox account on your real API, with no real money or effects, as Stripe, PayPal, Plaid and Twilio do.
- Pro Code and authentication match production, so going live is mostly a swap of keys and endpoints.
- Con Some features and partner behaviors are missing or differ, and stricter rate limits rule out load tests.
Hosted mock from the API description
A mock server returns example responses generated from the OpenAPI file or from saved examples, as Postman and Prism provide.
- Pro Developers and front-end teams can build before the backend exists.
- Con Responses are examples with little or no stored state, so the mock can drift from real behavior.
Inputs
- API descriptionThe OpenAPI file or equivalent, with example responses for every endpoint, from the API repositories.
- Developer tasksThe calls and flows developers most need to test, including error and edge cases, from support tickets, docs searches and the DX audit over the last 90 days.
- Production behaviorAuthentication, rate limits, pagination, webhooks and error codes in production, from the platform team.
- Risk rulesWhat must never reach production systems or real customers, such as payments, messages and personal data, from security, legal and Operational risk management.
- Budget and capacityInfrastructure cost and engineering time to run the environment, from the platform lead.
- Sandbox usageOptionalSandbox calls, errors and active accounts for the last 90 days, from gateway logs.
Steps
- Choose test mode on the real platform, a hosted mock, or both, based on whether developers must test stored state and webhooks or only request and response shapes.
- Isolate the environment from production systems and real data, give it its own keys or accounts, and make basic access free.
- Match production authentication, request types, pagination, errors and webhooks, and write down each known difference and any relaxed rate limit.
- Publish test values that trigger set results, such as a success, a decline or a named error code, and add calls or commands that fire webhooks, forward them to a local endpoint and reset state. Give developers a log of their test calls and webhook deliveries, filterable by status, endpoint and error code, with the failed payload and a resend for each delivery.
- Write the going-live checklist, covering the swap to live keys and endpoints, secure key storage and the features that only work in production.
- Review sandbox logs each month for frequent errors and stalled accounts, and fix the docs or environment behind the top ones.
Output
A sandbox spec and a published test guide for one API, with a list of known differences from production.
- Environment type and how to get access
- Keys or accounts and how they are isolated
- Production behaviors matched
- Known differences and rate limits
- Test values and the results they trigger
- Webhook, log and reset tools
- Going-live checklist
- Owner and monthly review date
Done when
- A new account can get sandbox access and make a successful call without contacting staff.
- No sandbox call can reach production systems, real money or real customers.
- Every documented error code has a test value or call that triggers it, or is listed as untestable.
- Every known difference from production is written in the test guide.
- The going-live checklist names each change needed to switch to live.
Measure
Track the share of new accounts that make a successful sandbox call on their first day, the share that move from sandbox to live within 30 days, and support tickets about test setup. Compare each month with your own previous three months. It works when both shares rise and setup tickets fall after a change.
Hypothetical example
Parcelwise offers a shipping label API. Support tickets show developers testing against live accounts and buying real labels by mistake. The team adds a test mode with its own keys and no carrier charges, matching production authentication and webhooks. It publishes test addresses that return an invalid address error, a rate limit error and a delayed shipment event, plus a command that fires each webhook. Rate limits stay at production levels and are written in the guide. The going-live checklist covers the key swap and carrier pickups, which do not run in test mode. After two months, accounts reaching a first test label on day one rise from 41 to 63 percent.
Common mistakes
- Leaving authentication out of the sandbox. Use the same key or token flow as production.
- Testing only the happy path. Publish test values for each error and edge case.
- Letting developers load test in the sandbox. State its limits and say where load tests should run.
- Hiding differences from production. List every missing feature and changed behavior in the test guide.
- Building it once and leaving it. Review sandbox errors each month and fix their causes.
Sources
- 7 Best Practices for API Sandboxes · Thomas Bush, 2020
- Sandboxes · Stripe Docs
- Testing · Stripe Docs
Show all 11 sources
- Sandbox · Plaid Docs
- Test credentials · Twilio Docs
- PayPal sandbox testing guide · PayPal Developer
- Set up mock servers · Postman Docs
- Prism (stoplightio/prism) · Stoplight
- Receive Stripe events in your webhook endpoint · Stripe Docs
- View API request logs · Stripe Docs
- API and Webhooks Logs Are Generally Available · Chris Lopez, 2022
By company stage
Apply first
Nothing. You can start here.
Use instead
- Developer portal framework
You need one place where developers find docs, keys, the sandbox and help. Use Developer portal framework, which links to this environment.
- Developer experience (DX) framework
You do not yet know which stage of the developer journey loses people. Use Developer experience (DX) framework first, which feeds this.
- Quick start framework
You need the short guide that takes developers to a first working call. Use Quick start framework.
- Migration guide framework
Developers are moving to a new version with breaking changes. Use Migration guide framework, which this feeds.
Where it sits
Open the developer marketing roadmapRecommended resources
No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.
Progress is not saved until you have an account. Create a free account