Errors

View as Markdown

Errors always have the same body: { "status_code", "error", "code", "message", "details" }. Branch on code, which is stable; message explains how to fix the problem.

The error object

Every error response has this shape. Each endpoint lists the errors it can return.

  • status_codeinteger

    HTTP status code, repeated in the body.

  • errorstring

    Short label matching the HTTP status.

  • codestring

    Stable machine-readable error code in snake_case. Branch on this, never on message.

  • messagestring

    What went wrong and how to fix it, written to be shown to a person.

  • detailsobjectOptional

    Extra structured context when it helps, for example the list of invalid fields. When a refusal is fixed in the 3DAPI dashboard (billing, store, compliance or plan), fix_url links to the page that fixes it.

Example
{
  "status_code": 404,
  "error": "Not Found",
  "code": "product_not_found",
  "message": "Product prd_bfP0GSqKoZFrD72H5Os0rc7HV9XP6eQJu was not found.",
  "details": {}
}

HTTP status codes

StatusMeaning
200 OK

It worked.

201 Created

It worked and created something; the body is the new object.

202 Accepted

Accepted for processing; the work happens afterwards and the body is empty.

204 No Content
400 Bad Request

The request is malformed: a bad parameter, cursor or expand path.

401 Unauthorized

The API key is missing or not valid.

402 Payment Required

A payment was needed and failed, or the balance is too low.

403 Forbidden

The key lacks a scope, or the account must change something first.

404 Not Found

The object does not exist, or belongs to another account.

409 Conflict

The object is in a state that does not allow this right now.

422 Unprocessable Entity

The body is well formed but breaks a rule; details says which.

429 Too Many Requests

Too many requests; slow down and retry.

503 Service Unavailable

The service is unavailable; retry with backoff.

Codes worth handling

Branch on code, never on message. These come up across many endpoints; the rest are listed on the endpoint that returns them.

validation_failed

A field is missing or has the wrong type or value. details lists the fields.

missing_scope

The API key does not carry the scope this endpoint needs.

invalid_cursor

A pagination cursor was edited or is not from this list.

invalid_expand

An expand[] path is not offered by this endpoint.

idempotency_key_reused

The same Idempotency-Key was sent with a different body.

plan_limit_reached

Your plan limit is reached. details.fix_url points at upgrading.

payment_failed

The charge to your saved card failed; nothing was created.

insufficient_balance

The wallet balance does not cover the purchase.

Fixes in the dashboard

Extra structured context when it helps, for example the list of invalid fields. When a refusal is fixed in the 3DAPI dashboard (billing, store, compliance or plan), fix_url links to the page that fixes it.

Retries and rate limits

A 4xx other than 429 will fail again until the request changes: read code and fix the request. A 429 or 503 is temporary: wait and retry with exponential backoff, and send the same Idempotency-Key when retrying a write.

Every endpoint except the health check can answer 429 with code rate_limited; wait for the number of seconds in the Retry-After header. The limits are in Rate limits.

Every error code

Each code with the statuses it comes with and the endpoints that return it. The OpenAPI document lists them per response in x-error-codes.

CodeStatusReturned by
account_blacklisted40393 endpoints
account_service_unavailable503change_integrator_password, request_integrator_email_change
actor_not_allowed40394 endpoints
already_approved409create_approval_request
ambiguous_credentials401102 endpoints
amount_out_of_range422start_top_up, update_wallet_settings
api_key_not_found404revoke_api_key
api_request_not_found404get_api_request
approval_in_review409create_quote, create_approval_request
approval_request_not_found404get_approval_request
attachment_not_found404, 422create_product, update_product, get_attachment
auto_top_up_needs_card409remove_card
awaiting_payment409cancel_integrator_order
billing_details_not_found404get_billing_details
billing_details_required409start_card_setup, start_top_up
cannot_publish409publish_product
card_not_found404make_card_default, remove_card
card_payments_unavailable503create_integrator_order, start_card_setup, complete_card_setup, remove_card, start_top_up
card_removal_failed503remove_card
card_setup_not_found404complete_card_setup
category_not_found404, 422create_product, update_product, create_variant, update_variant, get_category
combination_slots_mismatch422create_product, add_design, update_design
compliance_blocked403create_integrator_order
compliance_document_not_found404delete_compliance_document
country_not_eu_or_uk422set_eu_responsible_person
credential_not_allowed40395 endpoints
currency_not_supported422create_product, create_variant, update_variant, create_integrator_order
current_password_incorrect422change_integrator_password
custom_label_not_found422create_product, update_product
daily_quote_limit_reached429create_quote
design_belongs_to_stock409update_design, delete_design
design_in_use409delete_design
design_not_found404get_design, update_design, delete_design
design_not_in_product422create_product, create_variant, update_variant
duplicate_design_key422create_product
duplicate_image422create_extra, update_extra
duplicate_item422review_qc_ticket, create_qc_ticket, create_stock_purchase
email_not_sent503request_integrator_email_change
email_taken409create_integrator_account, request_integrator_email_change
email_unchanged400request_integrator_email_change
eu_responsible_person_not_found404remove_eu_responsible_person
event_not_found404get_event, get_event_deliveries, resend_event
event_type_not_subscribed409resend_event
extra_not_approved4227 endpoints
extra_not_found404, 4229 endpoints
file_too_large422create_upload
file_type_not_allowed422create_upload
image_not_found422create_product, update_product
import_issue_not_found404get_import_issue
in_review422create_approval_request
insufficient_balance402, 422create_integrator_order, create_stock_purchase, create_withdrawal
invalid_api_key401102 endpoints
invalid_discount_code400create_order
invalid_expand40048 endpoints
invalid_period400get_integrator_analytics
invalid_session401102 endpoints
invoice_or_payment_link_required400create_withdrawal
key_limit_reached409create_api_key
material_in_use422update_design
material_not_allowed422create_product, create_variant, update_variant, create_integrator_order
material_not_found404, 4228 endpoints
material_slots_mismatch422create_integrator_order
missing_credentials401102 endpoints
missing_scope40393 endpoints
no_saved_card409start_top_up
not_a_conversation409send_qc_message
not_a_quality_check409review_qc_ticket
not_awaiting_review409review_qc_ticket
not_enough_ready_quotes422create_approval_request
not_found422create_approval_request
not_ready422create_approval_request
not_your_turn409send_qc_message
option_in_use422update_product
option_mismatch422create_product, create_variant, update_variant
order_item_not_found404create_qc_ticket
order_not_cancellable409cancel_order, cancel_integrator_order
order_not_eligible409create_qc_ticket
order_not_found404cancel_order, get_order, get_integrator_order, cancel_integrator_order, create_qc_ticket
payment_failed402create_order, create_integrator_order
payout_details_not_found404get_payout_details
photo_not_on_item422review_qc_ticket
plan_limit_reached403create_product, publish_product, create_stock, create_stock_purchase, set_stock_restock
price_below_minimum422create_product, create_variant, update_variant
product_not_found4049 endpoints
production_unavailable409create_integrator_order
purpose_not_allowed403create_upload
qc_item_not_found404review_qc_ticket
qc_ticket_not_found404review_qc_ticket, send_qc_message, get_qc_ticket
quantity_exceeds_ordered422create_qc_ticket
quote_not_approved422create_integrator_order
quote_not_eligible422create_approval_request
quote_not_found404get_quote, create_integrator_order, estimate_integrator_order_shipping
quote_not_ready422create_integrator_order, estimate_integrator_order_shipping
quote_rejected422create_integrator_order, estimate_integrator_order_shipping
rate_limited429110 endpoints
region_not_available422create_stock_purchase, set_stock_restock
region_not_found404get_region
sales_price_below_production422create_integrator_order
same_password400change_integrator_password
scope_not_allowed422create_api_key
shipping_destination_not_served422create_integrator_order, estimate_integrator_order_shipping
shipping_zone_not_found404get_shipping_quote
signup_unavailable503create_integrator_account, resend_integrator_confirmation
sku_already_used409create_product, create_variant, update_variant
slot_count_mismatch422create_stock, add_stock_design
slug_taken409create_product, update_product
stock_batch_not_found404list_stock_batch_usage, get_stock_batch
stock_not_approved409, 422create_product, create_variant, update_variant, create_stock_purchase
stock_not_found404, 42211 endpoints
suggestions_unavailable422create_integrator_order
tax_form_required422save_billing_details
ticket_closed409send_qc_message
too_many_buckets400get_integrator_analytics
too_many_primary_images422create_product, update_product, create_stock, update_stock
too_many_variants422create_product, create_variant
unknown_attachment422create_stock, update_stock
unknown_design_key422create_product
unknown_image422create_stock, update_stock, create_extra, update_extra
unknown_requirement422upload_compliance_document
unknown_upload42210 endpoints
upload_already_used42210 endpoints
upload_expired42210 endpoints
upload_limit_reached409create_quote
upload_missing42210 endpoints
upload_purpose_mismatch42210 endpoints
validation_failed40064 endpoints
variant_managed_by_channel409update_variant
variant_needs_design_or_stock422create_product, create_variant, update_variant
variant_not_found404update_variant, delete_variant
variant_not_orderable422create_order
vat_number400save_billing_details
vat_number_invalid422create_integrator_order
weak_password400create_integrator_account, change_integrator_password
webhook_endpoint_disabled409resend_event
webhook_endpoint_limit_reached409create_webhook_endpoint
webhook_endpoint_not_found404update_webhook_endpoint, delete_webhook_endpoint, rotate_webhook_endpoint_secret, send_test_webhook_event, list_webhook_endpoint_deliveries, resend_event
webhook_url_not_allowed422create_webhook_endpoint, update_webhook_endpoint
withdrawal_cooldown409create_withdrawal
withdrawal_invoice403create_upload
withdrawal_not_found404cancel_withdrawal
withdrawal_not_pending409cancel_withdrawal
withdrawal_pending409create_withdrawal