Sandbox
tiun gives you two fully independent environments that run in parallel: live and sandbox.
Think of sandbox as a separate copy of your tiun setup — same SDK and checkout behavior, but its own catalog, snippet ID, domains, API keys, customers, and analytics. Nothing syncs or carries over automatically between the two.
Live is the default: real customers, real payments, your production domain. localhost is blocked in live.
Sandbox is for building and testing: simulated payments, test customers, and your development flow. localhost is enabled by default on any port in sandbox when you use sandbox settings (sandbox: true plus a sandbox snippet ID).
What is independent in each environment
Everything you configure in tiun exists twice — once per environment. A sandbox product ID never works in live, and a live API key never works against the sandbox API.
Authorized domains
Production domains only (e.g. yoursite.com), no localhost
Dev / staging domains (e.g. staging.yoursite.com); localhost is enabled by default
Snippet ID
Live snippet
Sandbox snippet
Products & pricing
Your live catalog
Separate test catalog
Product IDs
p-live-...
p-test-...
API keys
Live keys only
Sandbox keys only (not shared)
Customers, sessions, payments
Real
Test / simulated
Dashboard data
Live analytics
Sandbox analytics
Checkout, events, paywalls, and access control work the same way in both environments. Only the data, domains, credentials, and payment processing differ.
Selecting an environment in your app
In the browser SDK, pass sandbox: true to target sandbox. Omit sandbox or set sandbox: false to target live (the default).
Use the snippet ID from the environment you're building against. Sandbox and live each have their own snippet ID in the dashboard.
Dashboard: two parallel setups
In the my.tiun.business dashboard, the Sandbox toggle in the sidebar switches which environment you're viewing and editing — products, customers, snippet ID, and API keys all belong to that view.
You set up live and sandbox separately:
Live — register your production domain and create your real product catalog.
Sandbox — the first time you open the sandbox view, register your test domain (prefer test/staging; use your live domain if needed as a fallback), then create test products with the same structure you plan to use in live.
Both environments can be fully configured at the same time and run in parallel.
For a step-by-step walkthrough, see setting up your environment.
Your app and the dashboard should target the same environment while you're working. If the dashboard is on live but your SDK has sandbox: true (or the other way around), snippet IDs, product IDs, and sessions won't line up with what you see in the UI.
Recommended workflow
Most teams build in sandbox first, then stand up live when they're ready to ship:
Set up sandbox — domain, products, snippet ID, and (if you verify server-side) a sandbox API key.
Integrate and test —
sandbox: true, your sandbox snippet ID, andp-test-...product IDs.Set up live — production domain, recreate products and pricing, note your live snippet ID and
p-live-...IDs, and create live API keys.Ship — point production traffic at live: remove
sandbox: true(or set it tofalse), swap in the live snippet ID and product IDs, and use live server credentials.
There is no one-click switch from sandbox to live. Going live means replacing environment-specific values; the integration patterns stay the same.
Server-side verification
If your backend calls the tiun API, use the matching base URL and API key for the environment your app is using:
Live
https://api.tiun.live
Sandbox
https://api-sandbox.tiun.live
API keys are not shared between environments. See the server verification guides for examples.
Agent integration (MCP)
If you use the tiun MCP server, the agent can read both environments from your account — sandbox and live providers are listed separately. With products set up in each environment, the agent can use the correct snippet ID and product IDs for sandbox development versus production, without you copying IDs by hand.
Last updated
Was this helpful?