Errors and retries

How the Subscriptions REST API reports refusals: the error shape, HTTP statuses, common codes, and when a retry is safe.

Last updated: 2026-11-09

Every refusal has the same shape: a code to branch on, a plain-English message, and a failure field that says what a retry would do.

Error response
{
  "error": {
    "code": "SUBSCRIPTION_NOT_FOUND",
    "message": "The selected subscription is not available for this customer.",
    "failure": "permanent"
  }
}

What a retry does

failureMeaningWhat to do
permanentThe same request fails the same way until something changes.Don't retry as is. Fix the request or read the subscription again.
temporaryIt may work later.Retry later with the same Idempotency-Key.
(absent)The outcome is unknown: the change may or may not have happened.Read the subscription before you retry.

HTTP statuses

StatusWhen
401API_KEY_REQUIRED, API_KEY_INVALID
403API_KEY_SCOPE_REQUIRED, PERMISSION_REQUIRED (the teammate lost access or permission), CUSTOMER_SUBSCRIPTION_ACTION_NOT_ALLOWED
404Any code ending in _NOT_FOUND, such as CUSTOMER_NOT_FOUND or SUBSCRIPTION_NOT_FOUND
422Codes starting with INVALID_, IDEMPOTENCY_KEY_REQUIRED, CUSTOMER_QUERY_REQUIRED, PRODUCT_QUERY_REQUIRED, and INVALID_REQUEST when a field is missing
409The request is valid, but the subscription's current state refuses it
503A temporary failure, such as Shopify being unavailable. Try again later.

Common codes

CodeWhat it means
INVALID_REQUESTA required field is missing. The message names it.
CUSTOMER_NOT_FOUNDNo customer with that customer_id in this workspace.
SUBSCRIPTION_NOT_FOUNDThe subscription isn't this customer's, or isn't a Chargezen and Shopify subscription.
INVALID_BILLING_OCCURRENCEThe order named for order now or a next-order change is no longer the right one. Read upcoming orders again.
CANNOT_REMOVE_LAST_SUBSCRIPTION_LINEA subscription keeps at least one item. Cancel it instead.
SUBSCRIPTION_SWAP_PRICE_CHANGEDThe replacement's price or quantity changed since you listed swap options. List them again.
SUBSCRIPTION_SWAP_OPTION_UNAVAILABLEThe replacement isn't offered anymore. Choose another one.
ORDER_NOW_PAYMENT_FAILEDThe payment for order now didn't go through. Nothing was charged.
SUBSCRIPTION_SELECTION_STALEThe plan or price changed since you listed plans. Nothing was created; list plans again.
CUSTOMER_SUBSCRIPTIONS_UNAVAILABLEChargezen couldn't read the subscription's details. It's temporary; try again.
Branch on the code, show the message

Write your logic against code. The message is written for people to read.

Was this page helpful?

Need more help? Contact support