Skip to content

Retry a subscription cycle's off-session charge

POST
/orders/{id}/retry-subscription-charge
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/orders/example/retry-subscription-charge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "invoiceId": "example" }'

Staff-triggered retry of one subscription cycle invoice’s off-session charge, scoped to an invoice belonging to this order’s own subscription. Returns the charge outcome as data — a decline or an unusable saved method is not an error response. When the customer has several cards and none is the default the outcome is card_choice_required and nothing is charged: choose a card and charge the invoice with POST /invoices/{id}/charge. A subscription whose collectionMethod is SEND_INVOICE has no charge to retry and returns 422. Requires the orders.retry_subscription_charge permission.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

Media typeapplication/json
object
invoiceId
required

The cycle invoice to retry; must belong to this order’s own subscription.

string
>= 1 characters

Example generated

{
"invoiceId": "example"
}

The charge outcome.

Media typeapplication/json
object
data
required
object
result
required

Outcome of an off-session charge attempt: the card was charged; Stripe took the money but recording it failed (never retry); the customer has several cards and none was chosen; no usable saved card exists; the invoice was not payable; the card was declined; or Stripe could not be reached.

One of:
object
amount
required
number
kind
required
string
Allowed value: charged
paymentIntentId
required
string

Example

{
"data": {
"result": {
"kind": "charged"
}
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.