DELETE/billing/subscription_items/{subscription_item_id}

Cancel a subscription item

Cancel a specific subscription item. The subscription item can be canceled immediately or at the end of the current billing period.

2 parameters
subscription_item_idstringrequired
The ID of the subscription item to cancel
end_nowbooleanoptional
Whether to cancel the subscription immediately (true) or at the end of the current billing period (false, default)
Default:false

7 status codes
200A commerce subscription item.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:commerce_subscription_item
idstringrequired
Unique identifier for the subscription item.
instance_idstringrequired
Unique identifier for the Clerk instance.
statusstringrequired
Current status of the subscription item.
Allowed:activecanceledexpiredendedpast_dueupcomingincompleteabandoned
creditobjectoptional
Credit information (only available in PaymentAttempt events).
creditsobjectoptional
Unified credits breakdown for this subscription item.
plan_idstringrequired
Unique identifier for the associated plan.
price_idstringoptional
Unique identifier for the associated price
planobjectoptional
The associated plan.
plan_periodstringrequired
The billing period for this subscription item.
Allowed:monthannual
payment_methodobjectoptional
The payment method used for this subscription item.
lifetime_paidobjectoptional
Total amount paid over the lifetime of this subscription item.
next_paymentobjectoptional
Information about the next payment.
payer_idstringrequired
Unique identifier for the payer.
payerobjectoptional
The payer associated with this subscription item.
is_free_trialbooleanrequired
Whether this subscription item includes a free trial.
period_startintegerrequired
Unix timestamp (in milliseconds) when the current period started.
period_endintegerrequired
Unix timestamp (in milliseconds) when the current period ends.
proration_datestringoptional
The day the subscription item was prorated from. Only available in some responses.
canceled_atintegerrequired
Unix timestamp (in milliseconds) when the subscription item was canceled.
past_due_atintegerrequired
Unix timestamp (in milliseconds) when the subscription item became past due.
ended_atintegerrequired
Unix timestamp (in milliseconds) when the subscription item ended.
created_atintegeroptional
Unix timestamp (in milliseconds) when the subscription item was created.
updated_atintegeroptional
Unix timestamp (in milliseconds) when the subscription item was last updated.
seatsobjectoptional
Seat quantity for seat-based billing.
totalsobjectoptional
Totals for this subscription item.
400Request was not successful
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
401Authentication invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
403Authorization invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Resource not found
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
422Invalid request parameters
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
500Request was not successful
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 400 is returned: Request was not successful. A 401 is returned: Authentication invalid. A 403 is returned: Authorization invalid. A 404 is returned: Resource not found. A 422 is returned: Invalid request parameters. A 500 is returned: Request was not successful.