API Keys & Security

The difference between test and live keys, the full scope list, and how to handle keys safely.

View as Markdown

Test keys vs. live keys

The key prefix identifies its environment: rbp_test_... is a test key (the only kind currently issued), rbp_live_... is a live key (not yet issued). A test key is rejected in Production, and a live key is rejected in Sandbox — there's no way to accidentally cross environments.

One-time reveal, revoke, rotate

  • The full secret is shown only once, at creation time; every later GET returns just the prefix.
  • You can revoke at any time — takes effect immediately, every subsequent request with that key is rejected.
  • You can rotate: create a new key, cut your service over, then revoke the old one, with an overlap window so nothing breaks.
  • The dashboard shows a key's creation time and last-used time, so you can spot keys that were created but never used.

Full scope list

Write (:write) always implies read (:read). Only check the scopes a key actually needs. Scopes marked "high-risk" move real money — authorize them extra carefully.

ScopeGrants
products:read / products:writeProduct catalog
prices:read / prices:writePrices
customers:read / customers:writeCustomer data and payment method refs
subscriptions:read / subscriptions:writeSubscription create/read/cancel
billing:readBilling records
payments:read / payments:writePayment read / high-risk: create or attempt a charge
refunds:read / refunds:writeHigh-risk: refunds
payment_links:read / payment_links:writePayment Links
webhooks:read / webhooks:writeWebhook endpoints and event/delivery logs
usage:read / usage:writeUsage meters and Credits (non-cash)
entitlements:read / entitlements:writeFeature entitlement checks
discounts:read / discounts:writePromotion codes
mcp:invokeCall MCP tools — see MCP / AI Integration
ai:invokeCall the AI conversation endpoints
analytics:readWorkspace analytics
logs:readAudit logs
payouts:*Planned — currently always returns 403 SCOPE_DISABLED, not yet available

What you must never do

  • Keys belong in server-side environment variables only — never in frontend code or a browser network request.
  • Never log the full key, card number/CVV, or a Customer Portal token in your own logs.
  • A request missing a scope gets 403 SCOPE_DENIED; requesting a not-yet-available scope like payouts:* gets 403 SCOPE_DISABLED.