pnpm --filter api stripe:catalog: the products, the prices, their tax behaviour, the product tax code and the customer portal. What is left lives only in the Stripe dashboard. This page is the checklist for it and the order to switch from a sandbox to live mode. How billing behaves once it runs is on Billing.
Dashboard settings
Set every row in every sandbox and again in live mode. The catalog script prints the same list when it finishes.Going live
1
Register for Stripe Tax
Add the registrations in the dashboard: Poland, OSS for the EU, and any US state past its nexus threshold. Until they exist
STRIPE_TAX_ENABLED stays false, and Checkout collects the address and tax id without charging tax.2
Provision live mode
Run
pnpm --filter api stripe:catalog with the live secret key in STRIPE_SECRET_KEY and the production WEB_PUBLIC_URL. Read its output: the four lookup keys with their price ids, the portal configuration id and the dashboard checklist.3
Set the dashboard
Set every row of the table above in live mode.
4
Create the live endpoint
Register
https://app.asobeast.com/api/backend/billing/webhook with the ten handled events on the pinned API version, and copy its signing secret.5
Switch the keys
Replace
STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET on the host, remove the four STRIPE_PRICE_* variables, set STRIPE_TAX_ENABLED to what the first step allows, and redeploy. The boot log reports four prices resolved from lookup keys and no longer warns about a sandbox key.6
Send a test event
Send one test event from the endpoint’s page. It names no subscription, so the stored event settles as
ignored.7
Buy once with a real card
Buy Indie monthly on a throwaway workspace, confirm the plan card shows Indie, then cancel in the portal and refund the charge from the dashboard.
8
Rotate the sandbox keys
Rotate every sandbox key that was ever pasted anywhere outside the host.
9
Retire the old sandbox endpoint
Delete the sandbox endpoint that pointed at production, so the old sandbox can serve a staging stack or be deleted.
Rolling back
Put the sandbox keys and the sandbox webhook secret back on the host and redeploy, then delete the live endpoint so Stripe stops posting live events to an instance that cannot verify them. A workspace that paid in live mode in the meantime keeps its subscription at Stripe; refund it from the dashboard and reconcile the workspace from support once live mode returns.Related
Billing
The catalog, checkout, the webhook endpoint and reconciliation.
Billing incident
What to do when an event fails or a customer lands on the wrong side.