Skip to main content

Errors

Every failure returns a standard HTTP status code and a consistent JSON envelope.

Error envelope

code is stable and machine-readable — branch on it. message is human-readable and may change.

Error codes

Notable cases

  • rate_limited — the response carries Retry-After and X-RateLimit-* headers. See Rate Limits.
  • card_required / payment_declined — the order was validated but not created as paid. Fix the card on file and retry with the same external_order_id; the request is idempotent.
  • duplicate_request — you reused an external id with a different body. Replaying the same body is not an error: it returns the original record with 200 instead of 201.
  • not_found vs patient_not_found — resources outside your organization are reported as missing, never as forbidden.

Handling errors in code

5xx errors

An internal_error means the request did not complete. It is safe to retry with exponential backoff — include your external id so the retry is idempotent. Contact info@vitarelay.com if failures persist.