Test mode
Keep test objects separate and understand when sandbox checkout is available.
Keys that start with sk_test_ operate in test mode. Test products, customers,
checkout sessions, payments, subscriptions, webhooks and events are all
separate from live objects. A test key cannot read a live id, and a live key
cannot read a test id.
Payments, checkout sessions and subscriptions carry livemode. Check that
field before displaying a payment as live revenue. Products and customers do
not carry it: they already belong to the key's own mode.
Current checkout availability
Creating and reading non-payment test objects works with a test key. A hosted
test checkout requires sandbox payment credentials to be enabled for the
Utopia account. Until then, POST /checkout_sessions returns:
{
"code": "TEST_MODE_UNAVAILABLE",
"message": "Test mode payments are not enabled yet. Use a live key, or contact support."
}There are no public test card numbers while sandbox checkout is unavailable. Never use live card details as a substitute for test mode.
Use GET /account with the test key. payments_enabled tells you whether test
checkout is ready, and currencies contains the currencies enabled in that
mode.