Skip to content

Error Codes

Error response shape

All API errors return a consistent JSON structure:

{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "amount must be at least 200 cents",
"details": [
{
"field": "amount",
"message": "must be greater than or equal to 200"
}
]
}
}
FieldDescription
typeError category (see below)
codeMachine-readable code
messageHuman-readable description
detailsArray of field-level errors (validation errors only)

HTTP status codes

StatusMeaning
400Validation error or malformed request
401Missing or invalid authentication credentials
403Authenticated but not permitted for this operation
404Resource not found
409Conflict (e.g. idempotency key reused with different params)
500Internal server error

Error types

TypeDescription
invalid_request_errorRequest is malformed or fails validation
authentication_errorAPI key is missing, invalid, revoked, or expired
permission_errorKey doesn’t have permission for this operation
api_errorInternal server error — retry with exponential backoff

Error code reference

CodeHTTPDescription
invalid_api_key_format401Key does not match expected format
permission_denied403Key is valid but not permitted for this resource
payment_intent_not_found404No payment intent with that ID exists
invalid_payment_method_type400Unsupported type value in payment method create
refund_amount_exceeds_available400Sum of refunds would exceed original payment amount
payment_intent_not_refundable400Payment intent is not in succeeded status
refund_failed400PSP rejected the refund
validation_failed400One or more fields failed validation — check details