status field in the response envelope to signal success or failure. On error, status is false and message describes the problem.
Error response format
All error responses follow the same envelope as successful ones:Always
false for error responses. Check this field first in your error-handling logic.A human-readable description of what went wrong. Use this for logging and debugging — do not drive conditional logic in your application from this string.
null on all error responses.HTTP status codes
| Status | Meaning | Common cause |
|---|---|---|
200 OK | Request succeeded | — |
201 Created | Resource created | — |
400 Bad Request | Invalid or missing parameters | Required field absent or wrong type |
401 Unauthorized | Authentication failed | Missing, expired, or invalid Authorization token or SECRET_KEY |
403 Forbidden | Insufficient permissions | Token valid but lacks access to this resource |
404 Not Found | Resource does not exist | Invalid ID in the URL path |
422 Unprocessable Entity | Validation error | Field value failed server-side validation |
500 Internal Server Error | Unexpected server error | Retry with exponential backoff |
Handling errors in code
Always check
json.status (the field in the response body) in addition to the HTTP status code. Some error conditions may return 200 with status: false.Authentication errors
If you receive401 Unauthorized, verify that:
- The
Authorizationheader is present and formatted asBearer YOUR_ACCESS_TOKEN. - The
SECRET_KEYheader is present and matches your account’s secret key. - The
businessIdheader is present and valid. - Your access token has not expired — re-authenticate via
POST /auth/signinif needed.