Select the account and sandbox#
- In the Stripe Dashboard, open the intended account and sandbox.
- Create an empty environment and save the sandbox's keys.
- Use that environment for local development and agent tasks.
godmode env create acme-test
godmode --env acme-test \
--context - setup stripe
godmode --env acme-test \
--context - agents --printStripe recommends a general sandbox for new integrations. Test keys start with sk_test_ or rk_test_, and their prefix is shared across sandboxes. Identify the sandbox in the Dashboard when obtaining the key. Stripe Sandboxes · API keys
Check the target before changing it#
With the Stripe CLI installed, check that the saved test secret can read a sandbox balance:
godmode --env acme-test \
--context - run \
STRIPE_API_KEY=STRIPE_TEST_SECRET_KEY \
-- stripe balance retrieveA balance read checks access to that endpoint. Before writes, confirm the authenticated account ID and the mode of a known project resource through the API or SDK. Compare them with the account and resource IDs your project expects. Use a restricted key with only the permissions required. Account API · Restricted keys
If you use an organization key, requests targeting a specific account require Stripe-Context. All requests using the organization key require Stripe-Version. Organization keys
Keep webhook secrets with their endpoints#
Store the signing secret in the receiving deployment's secret store. Test, live, and Stripe CLI forwarding each use their own signing secret. Verify signatures against the raw request body and check mode and project ownership before applying an event. Test with a signed event and check what the receiver did. Stripe webhooks
Reuse facts and verified resources#
Share the same business profile across test and live if they use the same legal and contact details. Keep account IDs, price IDs, and webhook destinations in the matching deployment configuration. When retrying an API write, reuse its idempotency key and check for existing resources before creating another. Stripe idempotency