API error codes and how to handle them.

Error Codes

All API errors return a JSON body with an error field and optionally a code field and details object.

{
  "error": "Human-readable error message",
  "code": "MACHINE_READABLE_CODE",
  "details": { }
}

Error codes

CodeHTTP StatusDescriptionAction
VALIDATION_ERROR400Request body failed schema validationCheck the details field for specific field errors
UNAUTHORIZED401Missing or invalid API keyVerify your X-API-Key header
FORBIDDEN403Valid key but insufficient permissionsCheck that your key has access to the requested resource
NOT_FOUND404Resource not foundVerify IDs (brand_id, etc.) are correct
CONFLICT409Resource conflict (e.g., duplicate)For events, this means the idempotency_key was already used
RATE_LIMITED429Too many requestsWait and retry. Check X-RateLimit-Remaining header
INTERNAL_ERROR500Server errorRetry with exponential backoff. Contact support if persistent

Handling errors in your integration

Retries: For 500 errors, implement exponential backoff (1s, 2s, 4s, 8s, max 60s). Include the same idempotency_key, as duplicate detection ensures safe retries.

Validation errors: The details field contains per-field errors:

{
  "error": "Validation failed",
  "code": "VALIDATION_ERROR",
  "details": {
    "fieldErrors": {
      "currency": ["String must contain exactly 3 character(s)"],
      "amount": ["Required"]
    }
  }
}

Rate limiting: If you receive a 429, pause sending and respect the rate limit window (1 minute). For high-volume integrations, use batch requests (100 events per request).