Gale returns consistent and descriptive error responses across all endpoints to help you debug and recover gracefully.

Standard Error Format

{
  "success": false,
  "error_code": 422,
  "error_type": "unprocessable_entity",
  "error_message": "Validation failed: product_internal_id is required.",
  "details": {
    "field_errors": {
      "product_internal_id": ["product_internal_id is required"]
    }
  }
}

Common Status Codes

HTTP CodeMeaningTypical Cause
400Bad RequestMalformed JSON or missing fields
401UnauthorizedMissing or invalid token
403ForbiddenValid token but access not allowed
404Not FoundInvalid ID or resource does not exist
409ConflictInvalid state change (e.g., cancelling a PAID checkout)
422Unprocessable EntityValidation failed (e.g., wrong types or values)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorSomething went wrong on Gale’s side

Debugging Tips

  • Always validate your request body matches the documented schema.
  • Ensure your token is correct, present, and has the right permissions.
  • Watch for detailed field-level errors in the details.field_errors object.
  • For transient errors (429, 500), retry with backoff.
Refer to the Authentication page for more details on token usage.