Docs / Reference

Error codes

Error bodies always have the same shape. Rely on code, not the message: the message is written for humans and may change.

JSON
{ "error": { "code": "duplicate_order", "message": "An invoice for this order_id already exists" } }
When it's safe to retryOn 429, 500, 503, idempotency_in_progress and network errors, using the same Idempotency-Key: no duplicates will be created.

Request and access

HTTPcodeCause and fix
400bad_json, bad_bodyBody isn't JSON, has unknown fields, or sends an amount as a number instead of a string: fix the request
400bad_idempotency_keyKey missing or malformed: 8–128 printable ASCII characters, not starting with d:
400bad_queryInvalid list parameters
401unauthorizedSignature, timestamp, nonce or key problem: see CP-HMAC
403merchant_suspendedMerchant suspended: contact support
403merchant_not_approvedOnboarding incomplete or application under review: finish the setup wizard in the dashboard
403billing_suspendedA fee invoice is unpaid: pay it in the dashboard under “Billing,” and the suspension lifts immediately
404not_foundThe invoice doesn't exist or belongs to someone else
413body_too_largeBody exceeds the limit: trim metadata
429rate_limitedToo many requests: retry with exponential backoff
500internalInternal error: retry with the same Idempotency-Key

Invoices and idempotency

HTTPcodeCause and fix
409duplicate_orderorder_id already used: pick a new one, such as ORDER-1001-2
409idempotency_conflictSame key with a different body
409idempotency_in_progressThe first request is still running: retry in 1–2 s
409invoice_not_payableInvoice expired or closed: create a new one
422invalid_order_id, invalid_price_amount, invalid_price_currency, invalid_return_url, invalid_expires_in_seconds, invalid_metadataA field failed validation: the message explains the rule
422invalid_allowed_assetsNone of the listed assets is available: the message gives the reason for each
422no_assetsNo assets are available at all: check your wallets and assets in the dashboard
422amount_too_smallThe amount is below the minimum for every available asset

Currency selection on the checkout page

The checkout page handles these errors. Your server only sees them if you call select yourself.

HTTPcodeCause
409asset_lockedCurrency change attempted after a payment
409wallet_not_configuredNo active receiving wallet on this network
409wallet_changed, address_conflictRetry the selection
422asset_not_allowedThe asset isn't on the invoice or is no longer allowed
503rate_unavailableNo confirmed rate available: offer a stablecoin
503network_unavailablePayments on this network are temporarily unavailable: choose another

Refunds

HTTPcodeCause
403merchant_inactiveStore suspended or key revoked
409invoice_not_paidNo asset selected on the invoice, so there's nothing to refund
409nothing_to_refundEverything has already been refunded or requested
409too_many_refunds20 open requests on this invoice
409refund_executorThe platform executes this refund, not you
409invoice_status_changedThe invoice status changed after the request: retry with "ack_status_change": true
422amount_exceeds_refundableAmount exceeds what's refundable: lower it or use "full"
422invalid_amount, invalid_address, invalid_tx_hashA field failed validation