Error codes
Error codes provide stable, programmatic identifiers for specific failure conditions.
Use these codes to implement conditional logic in your integration.
Structure
Error codes are returned in the code field of the error object.
Example
{
"type": "card_error",
"code": "card_declined",
"decline_code": "insufficient_funds",
"message": "Your card has insufficient funds.",
"trace_id": "trc_123"
}
Categories
Invalid request errors
Errors caused by invalid input or request structure.
Examples:
parameter_invalidmissing_required_paramamount_too_large
Recommended handling:
- Do not retry
- Fix the request data
- Display validation errors to the user
Authentication errors
Errors caused by missing or invalid credentials.
Examples:
authentication_invalid— theAuthorizationheader is malformed or uses an unsupported formatauthentication_required— the endpoint requires credentials and no supported credential was providedtoken_invalid— the provided access token or API key is invalidtoken_expired— the provided access token has expired
Recommended handling:
- Verify credentials
- Do not retry without fixing authentication
- Compare the masked credential shown in the error message with the credential your integration intended to send
Authorization errors
Errors caused by account context or permission checks after authentication succeeds.
Examples:
account_required— the request requires an account context; provide thePaypercut-Accountheaderaccount_invalid— the authenticated principal cannot access the selected account, or the account does not existmore_permissions_required— the provided credential does not have the required permission for this endpointpermission_denied— the authenticated principal is not allowed to perform the requested operation
Recommended handling:
- Send the
Paypercut-Accountheader when acting on a connected account;X-Paypercut-Accountis accepted as an alias - Verify that the credential belongs to the expected environment and account
- Grant the required permission before retrying
- Do not infer account existence from
account_invalid; the response is intentionally ambiguous
Missing bearer token
{
"type": "invalid_request_error",
"code": "authentication_required",
"doc_url": "https://docs.paypercut.io/developer-resources/error-codes",
"message": "Authentication is required for this endpoint.",
"trace_id": "trc_123"
}
Invalid or expired token
{
"type": "invalid_request_error",
"code": "token_invalid",
"doc_url": "https://docs.paypercut.io/developer-resources/error-codes",
"message": "The provided access token 'sk_test_...dsadas' is invalid.",
"trace_id": "trc_123"
}
Account header required
{
"type": "invalid_request_error",
"code": "account_required",
"doc_url": "https://docs.paypercut.io/developer-resources/error-codes",
"message": "This endpoint requires an account context. Provide the Paypercut-Account or X-Paypercut-Account header.",
"trace_id": "trc_123"
}
Insufficient credential permissions
{
"type": "invalid_request_error",
"code": "more_permissions_required",
"doc_url": "https://docs.paypercut.io/developer-resources/error-codes",
"message": "The provided credential 'sk_test_...abcdef' does not have the required permissions for this endpoint.",
"trace_id": "trc_123"
}
Card errors
Errors caused by card or issuer behavior.
Examples:
card_declinedexpired_cardincorrect_number
Recommended handling:
- Use
decline_codeandadvice_code - Prompt the customer for action if needed
Processing errors
Errors caused by temporary processing issues.
Examples:
processing_errorissuer_unavailable
Recommended handling:
- Retry later
- Do not retry immediately in a tight loop
Rate limiting errors
Errors caused by exceeding request limits.
Examples:
rate_limit_exceeded
Recommended handling:
- Back off and retry later
- Implement exponential backoff
Handling strategy
Determine whether the error is caused by input, authentication, or processing.
Use the code to identify the specific failure condition.
Decide whether to retry, prompt the user, or fail the request.
Best practices
- Treat error codes as stable integration contracts
- Avoid parsing error messages programmatically
- Combine
codewith other fields such asdecline_code - Keep retry logic explicit and controlled

