| Field | Type | Description |
|---|---|---|
success | 0 | Always 0 for errors |
error | string[] | Machine-readable list of individual error details |
message | string | Short human-readable description |
code | number | HTTP status code, mirrored in the body |
HTTP status codes
| Code | Meaning | Common causes |
|---|---|---|
400 | Bad Request | Failed Zod validation, missing required field, business rule violation |
401 | Unauthorized | Missing, expired, or invalid credential |
403 | Forbidden | Authenticated but wrong role (e.g. non-admin hitting admin route) |
404 | Not Found | Resource ID doesn’t exist or doesn’t belong to the caller |
429 | Too Many Requests | Rate limit exceeded — back off and retry |
500 | Internal Server Error | Unexpected server-side failure |
Validation errors (400)
Validation uses Zod. Each failed field is a separate entry in theerror array using the format fieldPath: message:
Rate limiting (429)
Affiliate and Reseller endpoints are rate-limited per API token / JWT.Retry-After response header (if present) and wait
that many seconds before retrying.