2xx range mean the request succeeded. Codes in the 4xx range mean the request failed because of something in the request (a missing field, bad credentials, a resource that doesn’t exist). Codes in the 5xx range mean something went wrong on Tender’s side or with an upstream provider.
Response envelope
Every response, success or error, uses the same envelope. Success:data is an object, an array or null, depending on the endpoint.
Error envelope
statusis always"error".messagedescribes the failure. For authentication errors it is a code such asNOT_ALLOWEDorINVALID_REQUEST_SIGNATURE(see Authentication).datais usually{}ornull. Some endpoints put extra context in it, for example{"txId": "…", "status": "completed"}when a payment can no longer be cancelled.
message if you need detail. Don’t parse message text for control flow except where an endpoint page documents a specific message.
HTTP status codes
The API does not return
422. Validation errors are always 400.
Validation errors
Request bodies, query strings and path parameters are validated before the request is processed.- A validation failure returns HTTP 400.
-
Only the first failing rule is reported, as a plain string in
message: - Unknown body fields are silently ignored. They are removed before processing and do not cause an error, so a misspelt optional field is simply dropped. Check field names against the endpoint page.
-
Values are converted to the documented type where possible (for example,
"10"to10for a numeric field).
String input rules
All string values in bodies, query strings and path parameters are cleaned before validation:- leading and trailing whitespace is trimmed;
- HTML tags,
javascript:and inline event-handler patterns such asonload=are removed; - object keys that start with
$or contain.are dropped.
$ \ ( ) < >, and are limited to 500 characters unless the endpoint page states another limit. A field that breaks these rules fails validation with a 400.
Working with errors
When you receive a400:
- Check that the body matches the documented schema (field names, types and required fields).
- Check path parameters such as
{id}or{reference}; a malformed ID returns"Invalid resource ID format". - Read
message: it names the first field that failed.
401 or 403, see Authentication.
When you receive a 409 on a payout, see Idempotency.
When you receive a 429, wait until the window resets (the RateLimit-Reset header gives the seconds remaining) before retrying.
For 500 and 503, retry with exponential backoff. For payouts, retry with the same Idempotency-Key so the payout can’t be created twice.
If an error persists with a payload you believe is correct, capture the full response body and contact support@tender.cash.