> Godmode v0.20.0 documentation · Reviewed 2026-11-19
> Source: https://godmode.build/docs/stripe

# Stripe accounts and sandboxes

Keep Stripe test and live keys in separate Godmode environments. Confirm the Stripe account and sandbox before building or changing a payment flow.

## Select the account and sandbox

1. In the Stripe Dashboard, open the intended account and sandbox.
2. Create an empty environment and save the sandbox's keys.
3. Use that environment for local development and agent tasks.

```sh
godmode env create acme-test
godmode --env acme-test \
  --context - setup stripe
godmode --env acme-test \
  --context - agents --print
```

Stripe 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](https://docs.stripe.com/sandboxes) · [API keys](https://docs.stripe.com/keys)

## Check the target before changing it

With the Stripe CLI installed, check that the saved test secret can read a sandbox balance:

```sh
godmode --env acme-test \
  --context - run \
  STRIPE_API_KEY=STRIPE_TEST_SECRET_KEY \
  -- stripe balance retrieve
```

A 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](https://docs.stripe.com/api/accounts/retrieve) · [Restricted keys](https://docs.stripe.com/keys/restricted-api-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](https://docs.stripe.com/keys/organization-api-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](https://docs.stripe.com/webhooks)

## Reuse facts and verified resources

Share the same [business profile](/docs/contexts#reuse-one-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](https://docs.stripe.com/api/idempotent_requests)
