Error Codes

Standard HTTP status codes and their meanings.

Common statuses

StatusMeaningTypical cause
400Bad RequestMissing or malformed parameter
401UnauthorizedMissing/expired token or invalid signature
403ForbiddenInsufficient permission, IDOR block
404Not FoundResource does not exist
409ConflictDuplicate (e.g. order_id reused)
422Unprocessable EntityValidation failure
429Too Many RequestsRate limit exceeded — see Retry-After: 60 header
500Internal Server ErrorServer-side failure (retry advised)

CP-Auth specific errors

error codeMeaning
invalid_grantCode expired/reused or redirect_uri mismatch
invalid_clientIncorrect client_id or client_secret
unsupported_grant_typegrant_type value is not supported
pkce_requiredcode_challenge is missing
pkce_verifier_mismatchcode_verifier does not match the original challenge

Sample response:

{
  "error": "invalid_grant",
  "error_description": "Authorization code is expired or already used"
}

Rate limit response

HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/json
 
{"detail": "Rate limit exceeded"}