Testing
How to deliberately trigger each error in your test environment.
Use a test key (sk_test_...) for all of this — nothing here should ever be tried against a live key.
401 unauthorized: omit the Authorization header, or send a malformed token.
403 forbidden: call an endpoint your key's scopes don't include.
404 not_found: use a syntactically valid but nonexistent ID.
422 insufficient_balance: a fresh test account starts at a $0 wallet balance, so any purchase call will trigger this until you fund it.
429 rate_limited: send requests faster than your key's rps limit — the default test-key limit is deliberately low enough to trigger in a quick script.