v1
latestOpenAPI 3.1.02026-07-24170121.2 MBCancel a Subscription
This API cancels a previously created subscription.
patch/v1/subscriptions/{id}/cancel
Path parameters
idstring required
id here represents a specific subscription that should be canceled.
Response
200
Example response
{
"data": {
"object": "Subscription",
"id": "xlRP0jgPllljAXog",
"customer_id": "jDPAnVxA4xPDVpKM",
"billing_type": 1,
"canceled_at": 1726163436,
"current_period_end": 1726407240,
"current_period_start": 1726061640,
"plan_ref": "n2pv6j6p2pvj3Ygq",
"start_at": 1726407240,
"status": "canceled",
"message": "canceled - to be canceled on 2024-09-15",
"tax_percent": 5.8,
"trial_end": 1726407240,
"trial_days": 4,
"trial_start": 1726061640,
"created_at": 1726061640,
"updated_at": 1726163436,
"plan": {
"data": {
"object": "Plan",
"plan_id": "plan_d2b50d00",
"amount": 99,
"interval": "day",
"interval_count": 1,
"name": "test",
"statement_descriptor": "dfghdfhg",
"currency": "usd",
"created_at": 1724503321,
"updated_at": 1724505447
}
}
},
"meta": {
"include": [
"plan"
]
}
}