Skip to main content
POST
Cancels one recurring add-on (a plan with addOn: true) on the customer’s subscription. The base plan and any other add-ons are untouched.
  • timing: "period_end" (the default): the item becomes canceling, with endsAt at the period end. Its features and credits last until then, and the renewal bills the subscription without it, with no proration. The item then ends.
  • timing: "immediately": the item ends now, and its credits and features end with it. Stripe stops billing it from now on, and nothing is refunded or credited.
  • itemId is an id from the subscription’s items in List customer subscriptions; customerId goes in the query string.
  • Send an Idempotency-Key header, and reuse it on every retry of the same cancellation. Without one the request is refused with 400 idempotency_key_required.
  • The base plan’s item is refused with 400 item_not_cancellable: stop its renewal with Stop or resume renewal, which ends the whole subscription.
  • An item that already ended is 409 item_ended. A change on the subscription still waiting on payment is 409 subscription_change_pending, and a downgrade scheduled for the period end is 409 downgrade_scheduled: cancel the downgrade first. While an add-on is canceling, attaching another add-on, upgrading or downgrading is 409 subscription_change_pending until the renewal.
  • Cancelling an add-on that is already canceling at the period end returns that cancellation.
Needs the Billing permission.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

idempotency-key
string

Required: identifies this one cancellation. Reuse it on every retry; a key lasts 24 hours.

Maximum string length: 255

Path Parameters

itemId
integer
required

The item's id from the subscription's items in List customer subscriptions.

Required range: x <= 2147483647

Query Parameters

customerId
string
required

Your ID for the customer, such as your user ID.

Required string length: 1 - 255

Body

application/json
timing
enum<string>

period_end (the default): the add-on and its features and credits stay until the bill's period end, and the renewal bills without it. immediately: it ends now, its credits and features with it, and nothing is refunded or credited.

Available options:
period_end,
immediately

Response

The cancellation, and the item as it stands now

itemChangeId
integer
required
timing
enum<string>
required
Available options:
period_end,
immediately
status
enum<string>
required

applied: the add-on ended now. scheduled: it ends at the period end. closed: Stripe refused the change and nothing changed.

Available options:
applied,
scheduled,
closed
item
object
required