Skip to main content

Stream API Errors

This page documents the error response format and the standardized error codes returned by Stream API endpoints. The goal is to provide a stable, predictable contract for client applications and integrators.

Error response envelope​

All handled errors return a response body in this format:

{
"error": {
"code": "STREAM_ERROR",
"message": "Something wrong happened, please contact support.",
"additional_info": "Optional human-readable details"
}
}
  • code: A stable error code from StreamErrorCodes.
  • message: A user‑facing message associated with the code.
  • additional_info: Optional, best‑effort details to aid debugging.

HTTP status codes​

HTTP statusMeaning
400The request is invalid.
401The API key is missing or invalid.
403The API key doesn't have permission for this action or resource.
404The resource doesn't exist.
409Another request changed the invoice or payment at the same time, or is still changing it. The code says whether to retry; see Invoice and payment errors.
410The resource is no longer available.
422The request failed validation, or a value conflicts with an existing record.
503A temporary failure on Stream's side; nothing was changed. Retry after a short wait.

Stream error codes​

The following codes are used across all Stream API endpoints:

CodeMessage
STREAM_ERRORSomething wrong happened, please contact support.
STREAM_UNKNOWN_ERRORUnknown exception happened; this exception will be handled as soon as possible.
PHONE_ALREADY_REGISTEREDPhone is already registered.
INVALID_PARAMETERSRequest input is not valid.
INVOICE_FINALISEDInvoice is finalised and cannot undergo this action.
PAYMENT_REFUNDED_ALREADYDuplicate action; payment has already been refunded.
PAYMENT_REFUNDED_FAILEDCould not refund payment; processor failed.
PAYMENT_GATEWAY_ONE_REFUND_ONLYThe payment gateway allows only one refund per payment, and this payment has already been refunded once. Money is still left on the payment; contact support to refund the rest.
DUPLICATE_CONSUMERConsumer already exists.
DUPLICATE_PAYMENTA payment with the given information already exists.
PERMISSION_FORBIDDENPermission forbidden.
PRODUCT_USED_IN_FINALIZED_INVOICEProduct cannot be updated; it is used by a finalized invoice.
COUPON_USED_IN_FINALIZED_INVOICECoupon cannot be updated; it is used by a finalized invoice.

Invoice and payment errors​

These codes come from invoice and payment actions. Several of them mean another request is working on the same invoice or payment at the same moment, for example a payer paying while you cancel. In that case the whole request is undone: nothing was changed, and a retry is safe unless the table says otherwise.

CodeHTTPReturned byWhat happenedWhat to do
INVOICE_ROW_LOCKED409Invoice cancel and edit, subscription cancel and uncancel, mark a payment as paid, refund, auto-charge on demandAnother action is updating the same invoice or its payments right now: a payment, refund, cancellation, edit, accounting sync or the automatic expiry.Retry after a few minutes. Auto-charge on demand: fetch the payment first; the card may already have been charged.
INVOICE_CANCEL_CONFLICT409Invoice cancel, subscription cancelThe invoice changed while it was being canceled.Fetch the invoice again, then retry if it still needs canceling.
INVOICE_REACTIVATION_CONFLICT409Subscription uncancelThe subscription's next invoice changed while it was being reactivated.Fetch the subscription again, then retry.
INVOICE_REACTIVATION_BLOCKED409Subscription uncancelThe payer's card was charged for the subscription's canceled invoice and that charge hasn't been returned yet, so the subscription can't be uncanceled.Don't retry; contact Stream support.
INVOICE_EXPIRED400Mark a payment as paid, auto-charge on demandThe invoice passed its expiry date (expires_at) unpaid and can no longer be paid. additional_info holds the invoice id.Don't retry. Create a new invoice if the payer still needs to pay.
INVOICE_EXPIRY_CONFLICT409Auto-charge on demandThe invoice changed while it was being expired.Fetch the invoice again; if it's expired, see INVOICE_EXPIRED.
PAYMENT_SUCCESS_CONFLICT409Mark a payment as paid, auto-charge on demandThe payment changed while its success was being recorded.Mark as paid: fetch the payment, then retry if it isn't paid. Auto-charge on demand: fetch the payment first; the card may already have been charged.
PAYMENT_LATE_CHARGE_EXPIRED409Auto-charge on demandThe invoice expired while the card was being charged. The charge went through, and Stream is returning the full amount to the card.Don't retry. The payer is notified; create a new invoice if they still need to pay.
PAYMENT_LATE_CHARGE_CANCELED409Auto-charge on demandThe invoice was canceled while the card was being charged. The charge went through, and Stream is returning the full amount to the card.Don't retry. The payer is notified.
PAYMENT_REFUND_CONFLICT409RefundThe payment changed while its refund was being recorded. Nothing was refunded.Fetch the payment, then retry.
PAYMENT_REFUND_BUSY409RefundThe payment is being updated by another process. Nothing was refunded.Retry after a few minutes.
PAYMENT_REFUND_NOT_RECORDED409RefundThe refund went through at the payment gateway but couldn't be saved yet. It is recorded automatically shortly after.Don't refund again: the payer has been (or is being) refunded, and a retry would refund twice.
PAYMENT_REFUND_PENDING400RefundAn earlier refund on this payment is still pending at the payment gateway. Nothing was refunded.Retry once the pending refund completes (check the payment's refunds).
PAYMENT_REFUND_NOT_SENT400RefundThe refund didn't reach the payment gateway. Nothing was refunded.Retry later.
PAYMENT_REFUND_OUTCOME_UNKNOWN400RefundThe payment gateway returned an error without confirming the refund, which may still go through.Check the payment's refunds before trying again.

A 503 with code STREAM_ERROR can come from any of these actions when a Stream service is briefly unavailable. Nothing was changed; retry after a short wait.

Invoice expiry date (expires_at)​

Creating an invoice (POST /v2/invoices) or changing it (PUT /v2/invoices/{invoice_id}, PATCH /v2/invoices/{invoice_id}/inplace) with an expires_at that breaks a rule returns 400 with code STREAM_ERROR and the reason in additional_info:

additional_infoMeaning
expires_at is only supported for one-off invoicesOnly one-off invoices can expire; installment and recurring invoices can't.
expires_at must be in the futureThe expiry time has already passed.
expires_at must be after scheduled_onThe expiry must be later than the invoice's due date.
expires_at can't be changed for an invoice in status <status>The expiry can only be changed while the invoice is DRAFT, CREATED or SENT (PUT), or CREATED (PATCH /inplace).

An expires_at without a timezone (for example 2026-12-01T10:00:00 instead of 2026-12-01T10:00:00Z) returns 422. The expiry edit can also return INVOICE_ROW_LOCKED (above).