Error Handling

Every Vouchley API error returns a consistent JSON body with an HTTP status code you can branch on.

Error format

All error responses have the same shape — a JSON object with a detail field containing a human-readable message:

{
  "detail": "Insufficient credits. Purchase a credit pack to continue."
}

Status codes

CodeMeaningWhat to do
200SuccessProcess the response normally.
202Accepted (bulk only)Job queued. Poll GET /v1/jobs/:id for results.
400Bad requestCheck your request body — missing or invalid fields.
401UnauthorizedAPI key is missing, invalid, or revoked.
402Payment requiredCredit balance is zero. Purchase a plan.
404Not foundThe requested resource (check, job) doesn't exist.
422Validation errorRequest body failed schema validation (e.g. invalid email format).
429Rate limitedBack off and retry. See Rate Limits.
500Server errorRetry with backoff. If persistent, contact support.

Common errors

Missing Authorization header — Every request must include Authorization: Bearer vch_.... Double-check your key is set in the environment.

Invalid API key — The key may have been revoked. Check the API Keys page in your dashboard.

Insufficient credits — Your balance is zero. Subscribe to a plan or wait for your next billing cycle if you already have an active subscription.