Skip to main content

Errors

Every error response has the shape:

{ "error": { "code": "validation_error", "message": "The request body is invalid.", "details": { "fields": { "patient.phone": "must be a 10-digit US number" } } } }
CodeHTTP statusMeaning
invalid_api_key401Missing, malformed, unknown, or revoked key.
wrong_environment401A live key used against the sandbox, or a test key against production.
partner_suspended403The partner account is suspended.
validation_error400Request body failed schema or field-level validation (details.fields), or a bad query param on GET /orders / GET /locations.
unavailable_in_state400Patient address is in a restricted state (details.state).
unknown_item400One or more items[].id are not in the catalog (details.ids).
minor_not_eligible400An item is not available to a patient under 18 (details.ids).
unknown_location400preferredLocationId does not match a Quest location (details.id).
idempotency_key_required400Missing, >100-character, or non-[A-Za-z0-9_.-] Idempotency-Key header on POST /orders.
no_payment_method402No payment method on file for the partner.
payment_failed402Stripe declined the charge (details: { declineCode }, which may itself be null), or the PaymentIntent ended in a terminal non-succeeded status — requires_payment_method or canceled (details: { status }, no declineCode in that case).
idempotency_in_progress409Another request with this key is still processing — also returned if you retry within 5 minutes of a 500 internal_error on the same key.
idempotency_conflict409This key was already used with a different request body.
payment_in_flight409The previous attempt's payment outcome is unknown — retry with the same key and body, within the 24-hour idempotency window.
cannot_cancel409The order can no longer be cancelled (details.reason — see §5).
not_found404No such order (also returned for another partner's order id, to avoid leaking existence).
not_ready409Requisition or results have not been issued yet.
internal_error500Something went wrong after a charge may have occurred — retry POST /orders with the same Idempotency-Key within 24 hours (the key is left in_progress, so an immediate retry returns 409 idempotency_in_progress first — that's expected); for DELETE /orders/{id}, contact support with the order id.
payment_provider_error502The payment provider failed or did not respond (Stripe outage, or another non-network Stripe error) — retry with the same Idempotency-Key and body, within 24 hours.
payment_pending502The PaymentIntent is still live (details: { status }processing, requires_action, requires_confirmation or requires_capture); the outcome is not yet known — retry with the same Idempotency-Key and body, within 24 hours.

For anything not covered above, or an order stuck in an unexpected state, contact support@justlabs.health with the order id (and, for webhook issues, the X-JustLabs-Delivery id of the affected delivery).