Request & Response Conventions
Envelope structure
- Collection:
{ "data": [...], "meta": { "page", "per_page", "total", "total_pages" } } - Resource:
{ "data": { ... } } - Error:
{ "errors": [{ "code", "message" }] }
Error codes
| Code | HTTP | Meaning |
|---|---|---|
| unauthorized | 401 | Missing or invalid API token |
| not_found | 404 | Resource does not exist |
| insufficient_stock | 422 | Requested quantity exceeds available |
| invalid_status | 422 | Action not valid for current status |
| rate_limited | 429 | Request throttle exceeded |
| internal_error | 500 | Server error — retry with backoff |
Pagination
Use ?page= and ?per_page= (max 100).
Rate limits
/api/v1/*: 300 req / 5 min (by token)/integrations/webhooks/*: 120 req / min (by IP)/api/ai/*: 20 req / min