Complete guide to authenticating with the Stateset API
Authorization
header:Key Type | Prefix | Use Case | Permissions |
---|---|---|---|
Secret Key | sk_live_ | Server-side operations | Full API access |
Restricted Key | rk_live_ | Limited scope access | Custom permissions |
Publishable Key | pk_live_ | Client-side operations | Read-only public data |
Test Key | sk_test_ | Development & testing | Sandbox environment |
Authorization Request
Token Exchange
Use Access Token
Scope | Description |
---|---|
orders:read | Read order data |
orders:write | Create and update orders |
customers:read | Read customer data |
customers:write | Manage customers |
inventory:read | View inventory levels |
inventory:write | Update inventory |
returns:* | Full returns access |
admin | Full API access |
Role | Description | Default Permissions | API Key Prefix |
---|---|---|---|
anonymous | Unauthenticated user | Public read-only endpoints | N/A |
viewer | Read-only access | All read operations | rk_view_ |
operator | Standard user | CRUD on assigned resources | sk_live_ |
manager | Team manager | CRUD on team resources | sk_mgr_ |
admin | Full access | All operations | sk_admin_ |
super_admin | System admin | System configuration | sk_super_ |
Resource | Anonymous | Viewer | Operator | Manager | Admin |
---|---|---|---|---|---|
Orders | ❌ | Read | CRUD (own) | CRUD (team) | CRUD (all) |
Customers | ❌ | Read | Read (own) | CRUD (team) | CRUD (all) |
Inventory | Read | Read | Read | CRUD | CRUD |
Returns | ❌ | Read | CRUD (own) | CRUD (team) | CRUD (all) |
Reports | ❌ | Read | Read (own) | Read (team) | CRUD |
Settings | ❌ | ❌ | Read (own) | Update (team) | CRUD |
API Key Security
Token Management
Network Security
Issue | Cause | Solution |
---|---|---|
401 Unauthorized | Invalid or expired API key | Check key validity in dashboard |
403 Forbidden | Insufficient permissions | Verify key has required scopes |
429 Too Many Requests | Rate limit exceeded | Implement exponential backoff |
CORS Error | Cross-origin request blocked | Use server-side proxy or SDK |
Signature Mismatch | Invalid webhook secret | Verify webhook secret matches |