Cancel subscription
POST
/v2/subscriptions/{subscription_id}/cancel
Schedules a CANCEL
action to cancel an active subscription
by setting the canceled_date
field to the end of the active billing period
and changing the subscription status from ACTIVE to CANCELED after this date.
Name | Description |
---|---|
subscription_
Required
|
The ID of the subscription to cancel. |
Response Fields
Name | Description |
---|---|
errors
|
Errors encountered during the request. |
subscription
|
The specified subscription scheduled for cancellation according to the action created by the request. |
actions
Beta
|
A list of a single |
Examples
POST
/v2/subscriptions/{subscription_id}/cancel
cURL
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/subscriptions/910afd30-464a-4e00-a8d8-2296eEXAMPLE/cancel \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Response JSON
{
"subscription": {
"id": "910afd30-464a-4e00-a8d8-2296eEXAMPLE",
"location_id": "S8GWD5R9QB376",
"plan_id": "6JHXF3B2CW3YKHDV4XEM674H",
"customer_id": "CHFGVKYY8RSV93M5KCYTG4PN0G",
"card_id": "ccof:qy5x8hHGYsgLrp4Q4GB",
"start_date": "2021-10-20",
"canceled_date": "2021-10-20",
"paid_until_date": "2021-11-20",
"status": "ACTIVE",
"created_at": "2021-10-20T21:53:10Z",
"version": 1594311617331,
"timezone": "America/Los_Angeles",
"source": {
"name": "My App"
}
}
}