Authentication
All API requests require authentication via a Bearer token in theAuthorization header.
API Key Types
- Secret Keys
- Publishable Keys
Prefix:
sk_live_* or sk_test_*Server-side keys with full access to both Admin and Storefront APIs.
Must never be exposed in client-side code.Test vs Live Mode
API keys determine the data mode automatically:| Mode | Key Prefix | Description |
|---|---|---|
| Test | sk_test_*, pk_test_* | Sandbox data, no real payments processed |
| Live | sk_live_*, pk_live_* | Production data, real transactions |
Always develop and test with test mode keys first. Switch to live keys only when ready for production.
Customer Authentication (Storefront)
For Storefront endpoints that require customer identity (/customers/me, /orders):
Step 1. Your server generates a customer token using the Admin API:
X-Customer-Token header:
Guest Cart
Carts can be created without customer authentication using asession_id. When a guest customer logs in, merge the guest cart into their account using POST /storefront/carts/{id}/merge.