Skip to main content

Error Codes

Complete list of error codes returned by the X-Pay API.

Error Response Format​

{
"success": false,
"error": {
"code": "error_code",
"message": "Human readable description",
"field": "field_name",
"details": {}
}
}

Authentication Errors (401, 403)​

CodeMessageSolution
unauthorizedMissing or invalid authorizationInclude valid Bearer token
invalid_api_keyAPI key is invalid or expiredCheck your API key
expired_tokenJWT token has expiredLogin again
invalid_tokenToken format is invalidUse valid JWT format
forbiddenAccess deniedCheck permissions
unverified_emailEmail not verifiedComplete verification

Validation Errors (400, 422)​

CodeMessageSolution
invalid_requestRequest body is malformedCheck JSON syntax
missing_fieldRequired field is missingInclude required fields
invalid_fieldField value is invalidCheck field format
invalid_amountAmount must be positive integerUse positive number
invalid_currencyCurrency not supportedUse supported currency
invalid_phone_numberPhone number format invalidUse +XXXXXXXXXXX format
invalid_emailEmail format is invalidUse valid email address
invalid_urlURL format is invalidUse valid http/https URL
too_shortValue is too shortMeet minimum length
too_longValue is too longStay within max length

Payment Errors (400, 402)​

CodeMessageSolution
payment_failedPayment could not be processedRetry or use different method
payment_declinedPayment was declinedContact support or try again
insufficient_balanceAccount has insufficient fundsTop up balance
duplicate_paymentPayment already existsCheck existing payments
payment_cancelledPayment was cancelledCreate new payment
payment_expiredPayment request expiredCreate new payment
provider_errorPayment provider unavailableRetry later
unsupported_methodPayment method not supportedUse supported method

Resource Errors (404, 409)​

CodeMessageSolution
not_foundResource not foundCheck resource ID
already_existsResource already existsUse existing resource
conflictResource state conflictCheck current state
pending_requestAlready have pending requestWait for current request

Rate Limit Errors (429)​

CodeMessageSolution
rate_limitedToo many requestsWait and retry
quota_exceededMonthly quota exceededUpgrade plan or wait

Server Errors (500, 503)​

CodeMessageSolution
internal_errorInternal server errorRetry later
service_unavailableService temporarily downRetry later
timeoutRequest timed outRetry with backoff
database_errorDatabase operation failedRetry later

Webhook Errors​

CodeMessageSolution
invalid_webhook_urlWebhook URL is invalidUse valid https URL
webhook_failedWebhook delivery failedCheck endpoint
webhook_timeoutWebhook timed outRespond faster

Document Upload Errors​

CodeMessageSolution
file_too_largeFile exceeds 10MB limitReduce file size
invalid_file_typeFile type not supportedUse PDF, JPG, or PNG
upload_failedUpload processing failedRetry upload
document_existsDocument already uploadedDelete existing first