API Keys
Create API key
Section titled “Create API key”rcommerce api-key create --name "My Integration" --scopes "products:read,orders:write"Output:
Key: ak_1a2b3c4d.x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4The key is shown only once. Store it securely.
Key format
Section titled “Key format”API keys use a two-part format: prefix.secret
- Prefix (8+ characters): identifies the key, stored in plaintext
- Secret (32+ characters): the actual secret, hashed before storage
Scopes
Section titled “Scopes”Scopes follow the pattern resource:action:
| Scope | Access |
|---|---|
products:read | Read products |
products:write | Create/update products |
orders:read | Read orders |
orders:write | Create/update orders |
customers:read | Read customers |
customers:write | Create/update customers |
carts:read | Read carts |
carts:write | Create/update carts |
read | Read access to all resources |
write | Read + write access to all resources |
admin | Full admin access |
Presets
Section titled “Presets”| Preset | Scopes |
|---|---|
read_only | read |
read_write | write |
admin | admin |
customer | products:read, carts:read/write, orders:read/write, customers:read/write |
List keys
Section titled “List keys”rcommerce api-key listRevoke key
Section titled “Revoke key”rcommerce api-key revoke <prefix> --reason "No longer needed"Delete key
Section titled “Delete key”rcommerce api-key delete <prefix>Update scopes
Section titled “Update scopes”rcommerce api-key update <prefix> --scopes "read"