error code and a human-readable message to help you diagnose the issue.
A typical error response looks like this:
Error response shape
HTTP status code reference
400 Bad Request
400 Bad Request
What it means: The request body is malformed, contains invalid field types, is missing a required field, or contains a logically invalid combination of fields.Common causes:
- Missing a required field (e.g., omitting
bankAccountIdon a payment request). - Sending both
contactIdandpayableIdin the samePOST /v1/paymentsrequest — these fields are mutually exclusive. - Sending malformed JSON (e.g., unquoted string values, trailing commas).
message field in the error response — it will identify the specific field or conflict. Double-check your request body against the API spec.403 Forbidden
403 Forbidden
What it means: Your token is valid and authenticated, but your account or role does not have permission to perform the requested action.Common causes:
- Attempting to access a resource that belongs to a different organization.
- Trying to use a feature (e.g.,
NEXT_AVAILABLEclearing) that has not been enabled for your account.
404 Not Found
404 Not Found
What it means: The resource you referenced does not exist, or your account does not have access to it. Cleo Pay returns 404 (rather than 403) for resources you cannot access, to avoid leaking information about resource existence.Common causes:
- Typo in a resource ID (e.g.,
payable_01hwxyz123vs.payable_01hwxyz124). - Referencing a resource that was deleted or belongs to another organization.
GET /v1/contacts) to confirm the ID is correct and accessible.409 Conflict
409 Conflict
What it means: The request conflicts with the current state of a resource. The most common cause is duplicate detection.Common causes:
- Creating a contact that shares a name or email with an existing contact, without setting
allowDuplicates: true.
"allowDuplicates": true in the request body. Otherwise, retrieve the existing contact and update it instead of creating a new one.422 Unprocessable Entity
422 Unprocessable Entity
What it means: The request is well-formed and authenticated, but the data is semantically invalid — it fails a business rule.Common causes:
amountCentsis less than1(minimum payment is 1 cent).scheduledAtis today’s date or in the past.totalAmountCentson a payable is less than1.- A field value is outside its allowed range or format.
message field carefully. It will describe the specific rule that was violated (e.g., "scheduledAt must be a future date").429 Too Many Requests
429 Too Many Requests
What it means: You have exceeded the API rate limit.Common causes:
- Sending too many requests in a short window (e.g., unbounded parallel requests without throttling).
Retry-After response header if present — it indicates how many seconds to wait before retrying.500 Internal Server Error
500 Internal Server Error
What it means: An unexpected error occurred on the Cleo Pay server. This is not caused by your request.How to fix: Retry the request after a short delay. If the issue persists, contact Cleo Pay support and provide the request ID from the response headers if available.
Common integration mistakes
The following mistakes account for the majority of errors seen in new integrations:Debugging tips
- Always read the
messagefield. Cleo Pay error responses include a human-readable description that directly identifies the problem. - Log request IDs. Include request/response logging in your integration so you can correlate errors with specific API calls.
- Use the staging environment (
https://api.cleo-pay.com) for development and testing to avoid affecting production data.