Errors

Docs

Errors

Every error has the same shape. Branch on type and code; show message to a developer, not a buyer.

JSON
{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "providers: Not connected: stripe.",
    "param": "providers",
    "request_id": "01a1…"
  }
}

param names the field at fault, when there is one, and a field's message begins with its name. Quote request_id to support; it's also in the X-Request-Id header.

Types

TypeStatusMeaning
invalid_request_error400, 404, 409, 410Something about the request: a field, an ID, or the state of what it asks to change
authentication_error401No key, or not a valid one
permission_error403A valid key that can't do this, or a website that isn't allowed
idempotency_error409An Idempotency-Key reused for a different request
rate_limit_error429Too many requests; wait Retry-After seconds
api_error5xxOn ShipBill's side; safe to retry with the same Idempotency-Key

Codes

CodeWhen
validation_failedA field is missing or wrong. param names it, such as line_items.0.product.
unauthenticatedNo key, a malformed or unknown key, or a revoked one.
secret_key_requiredA publishable key was used where only a secret key may act.
publishable_key_requiredA secret key was used on a browser endpoint (/v1/embed). Never put a secret key in a page.
origin_not_allowedA browser request from a website not in Payments → Website integration → Allowed websites, or one the list can't hold (a page opened from a file, a LAN address over http), or localhost in live mode, which opens test checkouts only. The message says which. A buy button there shows the buyer a short sentence, and an embedded checkout opens as its own page instead of over yours; both call your onError first. A price preview from there is refused.
embed_not_allowedThe checkout was opened over a different allowed website first; it stays with that one.
not_foundNo object with that ID in this profile and mode. Test keys never see live data.
customer_has_provider_subscriptionsErasing a customer a provider still charges on its own (a subscription it renews automatically). Cancel it at the provider, then erase them.
rate_limitedToo many requests. Wait for Retry-After seconds; the libraries do this for you.
idempotency_key_reusedAn Idempotency-Key was sent again with a different request. Use a new key for a new request.
checkout_unavailableThis profile can't take payments now: no payment provider is enabled in this mode, none of the providers the product allows is, or the account is locked. Connect one in Settings → Payment providers; in test mode the built-in Test provider works without an account.
method_unavailableThe payment method asked for can't take this checkout: no enabled provider offers it for this buyer, currency, or amount. Offer another method, or connect a provider that takes it.
currency_unavailableShipBill doesn't support that currency.
items_unavailableA checkout of several products, or several of one, that no enabled payment provider in its mode can take together: products limited to providers that share none, or a set needing a copy at providers (Polar, Creem) that already keep their 50. The message says which, on line_items. Let the products use a provider in common, enable another, or sell them separately.
quantity_unavailableThe buyer's quantity outside the range the product allows on its payment link's or buy button's checkout, or on a checkout whose quantity is fixed.
custom_amount_unavailableA custom amount in a mode where every enabled provider is a merchant of record. A merchant of record is the legal seller and sells only products it reviewed, so none takes one. Send line_items with a product, or connect a provider that takes a custom amount: Hosted checkout's Custom amounts section lists which do.
no_discountEnding a subscription's discount (DELETE /v1/subscriptions/{id}/discount) when it has none: bought without a coupon, its periods used up, or already ended.
discount_not_endableEnding a subscription's discount at a provider that renews it and can't remove one (Creem, Whop). The message says when it runs out. Those providers aren't sent a subscription whose coupon lasts past the first payment.
addon_not_changeableDropping or adding a subscription's recurring add-on (POST /v1/subscriptions/{id}/addons/{product}) when it can't be changed: the subscription isn't running or is set to end, the product is its own or not one of its recurring add-ons, or the add-on has no price in its currency. The message says which.
coupon_not_applicableThe code in discounts doesn't apply to this checkout: unknown or archived, outside its dates, used up, not for these products or this currency, or on a custom amount. reason says which.
session_not_expirableThe checkout is being paid or is already complete, so it can't be expired.
payment_intent_not_cancellableThe payment intent is paid, or a payment on it is under way at the provider, so it can't be cancelled.
invoice_not_voidableThe invoice is paid or partly paid.
invoice_pdf_pendingThe invoice's PDF is still being drawn. Try again in a few seconds.
subscription_not_renewableThe subscription can't be renewed now, such as one cancelled and already ended.
webhook_url_rejectedThe endpoint address isn't a public https address on port 443.
webhook_endpoint_limitThere are already ten endpoints in this mode.
payload_too_largeThe request body is too large.
internal_errorSomething failed on ShipBill's side. Retry; quote request_id if it persists.

Last checked against the product on 12 October 2026.

NextLibrariesshipbill.js for your pages, @shipbill/js for bundlers, @shipbill/node for your server, and the rules a library for another language meets.