Subscriptions
Update or cancel a subscription
Send `{ "status": "cancelled" }` to cancel now, or `{ "cancel_at_period_end": true }` to let the paid period run out without renewing.
Send { "status": "cancelled" } to cancel now, or { "cancel_at_period_end": true } to let the paid period run out without renewing.
Authorization
secretKey AuthorizationBearer <token>
Your secret key: sk_live_… or sk_test_….
In: header
Path Parameters
id*string
Match
^sub_[0-9a-f]{32}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "https://example.com/subscriptions/sub_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c" \ -H "Content-Type: application/json" \ -d '{}'{ "object": "subscription", "subscription_id": "sub_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c", "status": "active", "product_id": "pdt_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c", "name": "string", "quantity": 0, "recurring_amount": 0, "currency": "AED", "billing_interval": "day", "interval_count": 0, "customer": { "customer_id": "cus_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c", "name": "string", "email": "string" }, "payment_method": { "brand": "string", "last4": "string", "exp_month": 0, "exp_year": 0 }, "current_period_start": "2019-08-24T14:15:22Z", "next_billing_date": "2019-08-24T14:15:22Z", "cancel_at_period_end": true, "cancelled_at": "2019-08-24T14:15:22Z", "cancellation_reason": "requested", "failed_payment_attempts": 0, "next_retry_at": "2019-08-24T14:15:22Z", "checkout_session_id": "cks_3f2b8c1e9a4d4e7b8c2a1d5e6f7a8b9c", "metadata": { "property1": "string", "property2": "string" }, "livemode": true, "created_at": "2019-08-24T14:15:22Z"}