ReferenceError codes

Error codes

This is the exhaustive lookup table for every error code the platform emits today. It complements the conceptual Errors guide (the body shape, how FlightdeckError surfaces failures in the SDK, and the “a failed read is never an empty result” rule) — read that first if you have not. This page is the reference: match a code here to learn its typical status, what it means, and how to fix it.

Branch your code on code, never on message. The code is a stable, machine-matchable string; the message wording is unstable and may name the offending field, scope, or resource id.

The error body

Every non-2xx response is JSON with a single nested error object:

{
  "error": {
    "code": "invalid_body",
    "message": "url and a non-empty events array are required",
    "correlationId": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed"
  }
}
FieldPresenceMeaning
error.codealwaysStable machine-matchable string. This is what the tables below key on.
error.messagealwaysHuman-readable explanation. May name a field/scope/id. Do not parse it.
error.correlationIdoptionalA request-correlation id. Present when the platform attached one; absent otherwise. Include it verbatim in any support report so the failure can be traced in the logs.

The body is always nested under error — there is no top-level code. In the SDK, read err.body.error.code.

How to read the status column

A single code can carry more than one HTTP status depending on the surface that raised it (for example invalid_tenant is normally 400, but a few internal paths surface it as 422 or 500). The tables give the typical status and note the exceptions. Handle failures on the status class first (4xx = your request, 5xx = the server), then refine on code.

⚠️

A 503 is an honest “we could not find out” — a dependency read was unavailable. It is never a laundered empty result. Retry a 503 with backoff; never turn it into [], 0, or a 2xx “nothing here”.

Cross-cutting codes

These are raised by nearly every resource. They are listed once here rather than repeated in every section below.

CodeStatusMeaningHow to resolve
invalid_body400The JSON request body failed validation (missing/typed-wrong field).Fix the body against the route’s documented shape. The message names the first offending field.
invalid_json400The request body was not parseable JSON.Send well-formed JSON and a correct Content-Type.
invalid_query400A query parameter is malformed or out of range (e.g. a bad limit/offset).Correct the query string.
invalid_params400A path/route parameter is malformed.Correct the path segment.
invalid_tenant400The tenant ref in the path is malformed. (A few internal paths surface it as 422 or 500.)Use a well-formed tenant slug.
invalid_value400A supplied value is outside its allowed set.Send an allowed value; the message names it.
invalid_status400A supplied status value is not a recognized status.Send a valid status.
missing_idempotency_key400A money-mutating call arrived without the required Idempotency-Key header.Send a deterministic Idempotency-Key (see Money invariants).
unauthorized401No valid credential — the key/token is missing, malformed, unknown, or revoked.Send a valid Authorization: Bearer fdk_... (or the route’s token).
forbidden403Authenticated, but the credential lacks the route’s required scope.Issue/use a key carrying the required scope (see Scopes).
not_found404No such resource for this tenant. Returned cross-tenant too, so a probe cannot tell “not yours” from “does not exist”.Verify the id and that it belongs to your tenant.
already_exists409The resource already exists (a uniqueness conflict).Fetch the existing resource instead of re-creating it.
precondition_failed412The resource was not in the state the action requires, or changed concurrently.Re-read current state and retry.
rate_limited429A verification or management limiter is spent.Respect the retry-after header and back off (see Rate limits).
internal_error500An unexpected server-side failure.Retry with backoff; report the correlationId if it persists.
lookup_unavailable503A dependency read failed — not an empty result.Retry with backoff.
lookup_failed500 / 503A read failed. 503 when a dependency was unreachable; 500 for an unexpected failure.Retry with backoff.
read_unavailable503A backing read was unavailable.Retry with backoff.
db_error500A database operation failed unexpectedly.Retry with backoff; report the correlationId.

Authentication and credentials

Raised by the credential-verification and operator gates (@dscodotco/stores, @dscodotco/identity) and by scoped-key issuance. See Authentication and Scopes.

CodeStatusMeaningHow to resolve
unauthorized401The fdk_ key or token is missing, malformed, unknown, or revoked.Send a valid credential.
invalid_token401The supplied token (session/preview/storefront) is invalid or expired. One operator path surfaces it as 403.Obtain a fresh token.
invalid_session401The session token is invalid or expired.Re-authenticate.
signature_verification_failed401An inbound signed request failed HMAC verification (webhook gateway).Sign with the correct secret over the exact raw bytes.
auth_unavailable503The credential/session check itself could not complete (the auth dependency was unavailable).Retry with backoff. This is fail-closed — the request was refused, not admitted.
forbidden403The credential lacks the route’s required scope.Use a key carrying the scope; see Scopes.
scope_escalation403A key-issuance request asked for a scope the issuing key does not itself hold.Request only scopes the issuing key already has (issuance is subset-gated).
not_an_operator403The route requires an operator credential; the caller is not an operator.Use an operator credential for operator-only routes.
operator_restricted403The action is restricted to operators (or a role the caller lacks).Perform the action from an operator surface.
email_unverified403The action requires a verified email and the caller’s email is unverified.Verify the email, then retry.

Rate limiting

See Rate limits for full behavior.

CodeStatusMeaningHow to resolve
rate_limited429The credential-verification (or a management) limiter is spent.Read retry-after (seconds) and wait at least that long before retrying.
velocity_exceeded429A checkout velocity gate tripped (too many attempts for this order/scope).Back off; this is a distinct, non-oracle-sensitive 429 the storefront can retry on.
db_error / select_failed503The verification limiter’s backing store was unavailable, so the request was refused fail-closed (message: “rate limiter unavailable”) rather than admitted unmetered. The underlying database code is surfaced verbatim.Retry with backoff.

Checkout and the money path

Raised by @dscodotco/checkout (placement, refund, cancel, edit, returns) and by the @dscodotco/payments failure codes it surfaces. Several of these come from domain Result codes mapped to HTTP status by checkout’s status mappers, so the same code can mean the same thing across the operator and merchant routes. All mutating routes require an Idempotency-Key; a retried key replays the original outcome (see Money invariants).

Placement and payment

CodeStatusMeaningHow to resolve
missing_idempotency_key400A checkout/refund/cancel/edit call arrived without Idempotency-Key.Send a deterministic idempotency key.
invalid_card400card.ccnumber and card.ccexp are required for this charge and were missing/malformed.Supply valid card fields.
invalid_amount400An amount (e.g. a partial-refund amount_cents) is missing, non-integer, or out of range.Send a positive integer-cents amount within bounds.
invalid_subscription_consent400A subscribe request lacked the required auto-renewal consent.Capture and pass explicit subscription consent.
zero_amount_checkout_unsupported501A zero-total checkout is not supported.Ensure the order has a chargeable total.
card_declined402The card was declined.Ask the shopper for another card. Do not auto-retry.
payment_declined402The charge was declined (payment or fraud floor).Show a decline; do not auto-retry the same card.
provider_declined402The payment provider declined the transaction.Show a decline; try another instrument.
payment_outcome_indeterminate502The provider returned an indeterminate result — the platform cannot confirm capture.Do not re-charge blindly; reconcile against the order before retrying (the idempotency key protects a safe retry).
order_tender_record_failed500The order was charged but recording a tender line failed.Retry (idempotent); report the correlationId if it persists.
replay_lost500An idempotent replay’s original outcome could not be re-read.Retry with backoff; report the correlationId.

@dscodotco/payments codes surfaced at checkout

CodeStatusMeaningHow to resolve
intent_not_found404No payment intent matches.Verify the intent id.
intent_not_authorized409The intent has no provider authorization to capture.Re-authorize before capture.
charge_not_found404No charge matches the supplied charge_id.Verify the charge id.
refund_exceeds_charge409The requested refund is greater than the charge.Refund at most the captured amount.
invalid_intent_status409The intent is not in a state the action allows.Re-read the intent’s status.
capture_reservation_conflict409A concurrent capture conflicted on the reservation.Retry after backoff.
nothing_to_refund409There is nothing left to refund on the charge.No action — the charge is already fully refunded.

Order actions (refund / cancel / edit)

CodeStatusMeaningHow to resolve
order_not_found404No such order for this tenant/shopper.Verify the order id.
order_item_not_found404No such line item on the order.Verify the item id.
already_refunded409The order is already fully refunded.No action needed.
order_fulfilled_use_returns409A shipped/delivered order cannot be cancelled.Use a return (RMA) instead of cancel.
order_not_editable409The order is not in an editable state.Only edit orders that are still editable.
coupon_gone409A coupon applied to the order no longer exists at re-price time.Re-price without the missing coupon.
conflict409A concurrent modification conflicted.Re-read and retry.
empty_order412The edit/reprice would leave the order with no lines.Keep at least one line.
invalid_quantity400 / 412A line quantity is invalid. 400 on edit; 412 in the pricing engine.Send a valid positive quantity.
tax_provider_unsupported422The store’s manifest declares a tax provider the engine cannot compute — the order was refused, not under-charged (fail-closed tax).Configure a supported tax provider.
invalid_order_status500The order carries an unrecognized status (data integrity).Report the correlationId.

Returns (RMA)

CodeStatusMeaningHow to resolve
return_not_found404No such return.Verify the return id.
return_line_not_found404No such line on the return.Verify the line id.
already_in_status409The return/order is already in the requested status.No action needed.
invalid_transition409The requested state change is not legal from the current state.Re-read current state; follow a legal transition.
empty_return412The return has no lines.Include at least one line.
return_exceeds_ordered412A returned quantity exceeds what was ordered.Return at most the ordered quantity.
duplicate_return_line412The same line appears twice in the return.De-duplicate the lines.

Gift-card redemption at checkout

CodeStatusMeaningHow to resolve
gift_card_not_found404No gift card matches that code.Verify the code.
gift_card_void409The gift card is void.Use a valid card.
gift_card_empty409The gift card has no remaining balance.Use a card with balance.
nothing_to_redeem409There is nothing to redeem against this order.No action needed.

Commerce and catalog

Raised by @dscodotco/commerce (public catalog, pricing groups, operator transitions).

CodeStatusMeaningHow to resolve
product_not_found404No such product.Verify the slug/id and that the product is active.
variant_not_found404No such variant.Verify the variant id.
coupon_not_found404The coupon code does not exist.Use a valid coupon code.
coupon_inactive412The coupon exists but is not active.Use an active coupon.
coupon_exhausted412The coupon has no redemptions left.Use a different coupon.
price_not_found404No pricing-group price matches.Verify the group/variant.
group_not_found404No such pricing group.Verify the group id.
invalid_asset_ref400An image ref is not asset:<storeKey>/<sha256>.<ext>.Send a well-formed asset ref (see Media).
invalid_slug400A slug is malformed.Use a URL-safe slug.
slug_taken409The slug is already used by another resource.Choose a different slug.
invalid_transition409An operator order transition is illegal from the current state.Follow a legal transition.

Media

Raised by @dscodotco/media (upload presign, finalize).

CodeStatusMeaningHow to resolve
unsupported_content_type400The content_type is not on the allowlist, or is valid only for another kind (e.g. a PDF outside coa_document).Upload an allowed type for the kind.
invalid_sha256400sha256 is not 64 lowercase hex chars.Send the correct content hash.
invalid_asset_ref400The asset ref is malformed.Use asset:<storeKey>/<sha256>.<ext>.
presign_unavailable503The presign step could not complete.Retry with backoff.
confirm_unavailable503The uploaded object could not be confirmed to exist at finalize.Retry the finalize after re-uploading.

Domains and provenance

Raised by the self-serve custom-domain flow (@dscodotco/stores, @dscodotco/provenance). See Custom domains.

CodeStatusMeaningHow to resolve
invalid_hostname400The hostname is malformed.Send a valid FQDN.
invalid_domain400The domain value is invalid.Correct the domain.
no_partnership404No partnership/claim exists for this host.Register the domain first.
not_verifiable409The claim has no DCV challenge to verify.Re-request the claim to get a challenge.
not_verified409An edge attach was attempted on a domain that is not yet verified.Verify the domain first.
dns_unavailable503The DNS/verification check could not complete.Retry with backoff.

Stores and site builder

Raised by @dscodotco/stores (store, manifest, site versions, preview tokens).

CodeStatusMeaningHow to resolve
store_not_found409The store could not be resolved for this action.Verify the credential’s tenant.
store_suspended409The store is suspended.Contact the operator.
store_live409The action is refused because the store is live.Perform it before going live, or via the correct route.
invalid_manifest400The submitted manifest failed validation.Fix the manifest against the schema (see Site builder).
invalid_theme400A theme token/value is invalid.Use valid theme tokens.
invalid_version400A version reference is malformed.Use a valid version id.
version_not_found404No such site version.Verify the version id.
no_version409There is no version to act on (e.g. publish with none).Save a draft first.
invalid_preview_token404The preview token is invalid or expired.Mint a fresh preview token.
manifest_missing500The active manifest could not be read.Retry; report the correlationId.
untrusted_sign_in_url400A supplied sign-in URL is not on the trusted allowlist.Use a trusted URL.

Subscriptions

Raised by @dscodotco/subscriptions.

CodeStatusMeaningHow to resolve
invalid_subscription400The subscription reference/body is invalid.Verify the subscription id/body.
invalid_interval400The billing interval is invalid.Use a supported interval.
invalid_interval_count400The interval count is invalid.Use a positive integer count.
invalid_next_bill_at400The next-bill timestamp is invalid.Send a valid future ISO-8601 instant.

Gift cards

Raised by @dscodotco/giftcards (issue/list surface).

CodeStatusMeaningHow to resolve
gift_card_not_found404No gift card matches that code.Verify the code.
gift_card_void409The gift card is void.Use a valid card.
gift_card_empty409The gift card has no remaining balance.Use a card with balance.
invalid_amount400The issue amount is invalid.Send a positive integer-cents amount.
gift_card_unavailable503The gift-card read/write could not complete.Retry with backoff.

Store credit (cash)

Raised by @dscodotco/cash (merchant store-credit sub-app).

CodeStatusMeaningHow to resolve
invalid_amount400The grant amount is invalid.Send a positive integer-cents amount.
balance_unavailable503The balance read could not complete.Retry with backoff.
ledger_unavailable503The ledger read could not complete.Retry with backoff.
store_credit_unavailable503The store-credit surface could not complete a read/write.Retry with backoff.

Inventory

Raised by @dscodotco/inventory (items, vendors, purchase orders, receive-against-PO) and @dscodotco/fulfillment allocation.

CodeStatusMeaningHow to resolve
invalid_supplier404No such supplier/vendor.Verify the supplier id.
insufficient_stock409The requested quantity exceeds available inventory.Reduce quantity or restock.
invalid_item_count400An item count is invalid.Send a valid positive count.
invalid_ref400A reference (e.g. lot/PO ref) is malformed.Correct the reference.

Fulfillment

Raised by @dscodotco/fulfillment (queue, allocate/label/ship/deliver).

CodeStatusMeaningHow to resolve
not_found404No such fulfillment row for this tenant.Verify the id.
precondition_failed412The row was not in the state the action requires.Re-read the queue row and retry.

Fraud

Raised by @dscodotco/fraud (ban blocklist, checks).

CodeStatusMeaningHow to resolve
ban_not_found404No such ban entry.Verify the ban id.
ban_list_unavailable503The ban-list read could not complete.Retry with backoff.
fraud_check_unavailable503A fraud check could not complete.Retry with backoff.
check_unavailable503A check dependency was unavailable.Retry with backoff.
velocity_exceeded429A velocity gate tripped.Back off and retry.
velocity_events_unavailable503The velocity-events read could not complete.Retry with backoff.

Affiliates

Raised by @dscodotco/affiliates (merchant workspace, commission approval).

CodeStatusMeaningHow to resolve
member_not_found404No such affiliate/member.Verify the affiliate id.
affiliate_unavailable503An affiliate read could not complete.Retry with backoff.
affiliates_unavailable503The affiliates surface could not complete a read.Retry with backoff.
commission_unavailable503A commission read/write could not complete.Retry with backoff.
commissions_unavailable503The commissions list could not complete.Retry with backoff.

Marketing

Raised by @dscodotco/marketing (campaigns, audiences, segments, steps).

CodeStatusMeaningHow to resolve
invalid_audience_query400The audience predicate failed to compile.Fix the predicate; the message describes the compile errors.
invalid_segment_query400 / 500A segment query is malformed (400) or failed to read (500).Correct the query.
invalid_filter_query400A filter query is malformed.Correct the filter.
segment_not_found400The audience references a segment that does not exist.Reference an existing segment.
invalid_step400A campaign step is invalid.Fix the step definition.
invalid_template400A step names a template outside the closed comms registry.Use a registered template.
not_triggerable409The campaign type cannot be triggered this way (e.g. abandoned_cart enrolls via the cart-idle sweep).Use the campaign’s own enrollment path.
invalid_type400A campaign/entity type value is invalid.Use a supported type.

Comms

Raised by @dscodotco/comms (transactional email).

CodeStatusMeaningHow to resolve
invalid_recipient400The recipient is invalid.Send a valid recipient.
invalid_email400The email address is malformed.Send a valid address.
invalid_template400The template is not in the closed registry.Use a registered template.
recipient_suppressed403The recipient is on the suppression list.Do not send; respect the suppression.
recipient_opted_out403The recipient has opted out.Do not send; respect the opt-out.
unsubscribe_unconfigured503The unsubscribe surface is not configured.Configure unsubscribe before sending.
send_failed502The send failed at the provider.Retry with backoff.

Persons

Raised by @dscodotco/persons (CDP).

CodeStatusMeaningHow to resolve
invalid_person400The person reference/body is invalid.Verify the person id/body.
not_tripped409No tripped guardrail exists for this tenant.No action needed.
resolve_unavailable503A person-resolve read could not complete.Retry with backoff.
intake_unavailable503The intake read/write could not complete.Retry with backoff.

Media assets and documents (provenance / COA)

Raised by the provenance and document surfaces.

CodeStatusMeaningHow to resolve
invalid_entity_type400The entity type is not recognized.Use a supported entity type.
invalid_doc_type400The document type is not recognized.Use a supported document type.
invalid_expires_at400The expiry timestamp is invalid.Send a valid future ISO-8601 instant.

Billing

Raised by @dscodotco/merchant-billing (read-only merchant invoices/statement).

CodeStatusMeaningHow to resolve
not_found404No such invoice/statement for this tenant.Verify the id.
read_unavailable503The billing read could not complete.Retry with backoff.

Workflow and webhooks gateway

Raised by @dscodotco/workflow and the inbound gateway (edges/webhooks-gateway).

CodeStatusMeaningHow to resolve
unknown_workflow404No such workflow.Verify the workflow id.
run_missing500A workflow run row could not be read.Retry; report the correlationId.
unknown_tenant404The inbound delivery names a tenant the gateway cannot resolve.Verify the tenant mapping.
unknown_provider404The inbound delivery names an unrecognized provider.Verify the provider route.
missing_event_id400The inbound delivery lacks the provider event id needed to dedupe.Ensure the provider sends its event id.
signature_verification_failed401The inbound signature did not verify.Sign with the correct secret over the raw bytes.
publish_failed502The inbound delivery was stored, but fan-out onto the event bus failed.Retry with backoff; the provider’s own delivery retry is the recovery path (the delivery was persisted, never lost).
dedup_unavailable503The dedup store was unavailable.The gateway fails closed; the provider will retry.
deliveries_unavailable503The delivery ledger read could not complete.Retry with backoff.
transaction_unavailable503A transaction could not begin/commit.Retry with backoff.

Analytics and reporting

Raised by @dscodotco/analytics (merchant reporting).

CodeStatusMeaningHow to resolve
invalid_timezone400The requested timezone is invalid.Send an IANA timezone.
invalid_filter_query400A report filter is malformed.Correct the filter.
list_unavailable503A report read could not complete.Retry with backoff.
account_unavailable503An account read could not complete.Retry with backoff.
registry_unavailable503A registry read could not complete.Retry with backoff.

Other unavailability codes

The *_unavailable family always means the same thing: a dependency read could not complete, and the platform refused to fake a result. All are 503 and all are safe to retry with backoff. Beyond those already listed above, you may also see: scan_unavailable, confirm_unavailable, resolve_unavailable, store_credit_unavailable, commission_unavailable. Treat every member of this family identically.

Content and validation edge cases

CodeStatusMeaningHow to resolve
unsupported_content_type400The Content-Type is not accepted for this route/kind.Send an accepted content type.
invalid_url422A supplied URL is well-formed but not acceptable here.Send an acceptable URL.
invalid_forward_url400A forward/callback URL is invalid.Send a valid URL.
validation_error422A well-formed request was semantically unprocessable.Correct the semantics; the message explains.
  • Errors — the body shape and the SDK’s FlightdeckError.
  • Scopes — what forbidden and scope_escalation are about.
  • Rate limits — what rate_limited / 429 mean.
  • Money invariants — idempotency keys and the money path.