DELETE
Last updated
Was this helpful?
Last updated
Was this helpful?
Cancels a specific subscription contract by setting its status to "CANCELLED". This endpoint also triggers configured integration actions, such as sending a cancellation email via Klaviyo.
/subscriptions/{contractId}
The unique identifier of the subscription contract to be canceled.
The shop domain associated with the subscription contract.
The customer ID associated with the subscription contract. Used for additional validation or for integration actions.
curl -L \
--request DELETE \
--url 'http://localhost:3002/subscriptions/{contractId}?shop=text'
{
"success": true,
"data": {
"id": "text",
"failedBillingCount": 1,
"subscriptionTotal": 1,
"draft": true,
"createdAt": "text",
"notification_at": "2025-02-20T19:09:03.520Z",
"notified": true,
"billingInterval": "text",
"billingIntervalCount": 1,
"maxCycles": 1,
"isPrepaid": true,
"minCycles": 1,
"billingAnchorType": "text",
"billingAnchorDay": 1,
"billingAnchorMonth": 1,
"currencyCode": "text",
"customer": {
"id": "text",
"firstName": "text",
"lastName": "text",
"email": "text",
"phone": "text",
"state": "text",
"createdAt": "text",
"imageUrl": "text",
"addresses": [
{
"id": "text",
"address1": "text",
"address2": "text",
"city": "text",
"company": "text",
"country": "text",
"countryCodeV2": "text",
"firstName": "text",
"lastName": "text",
"phone": "text",
"province": "text",
"provinceCode": "text",
"zip": "text"
}
],
"tags": [
"text"
]
},
"deliveryPrice": 1,
"status": "text",
"shop": "text",
"originOrder": {
"id": "text",
"legacyResourceId": "text",
"name": "text",
"createdAt": "text",
"amount": "text"
},
"orderIds": [
"text"
],
"lines": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"addons": [
{
"id": "text",
"sku": "text",
"title": "text",
"productId": "text",
"variantId": "text",
"variantTitle": "text",
"sellingPlanName": "text",
"displayName": "text",
"sellingPlanId": "text",
"quantity": 1,
"taxable": true,
"handle": "text",
"requiresShipping": true,
"variantImage": {
"url": "text"
},
"currentPrice": {
"amount": "text",
"currencyCode": "text"
},
"lineDiscountedPrice": {
"amount": "text",
"currencyCode": "text"
},
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"discountAllocations": [
{
"discount": "text",
"amount": {
"amount": "text",
"currencyCode": "text"
}
}
],
"pricingPolicy": {
"basePrice": {
"amount": "text",
"currencyCode": "text"
},
"cycleDiscounts": [
{
"adjustmentType": "text",
"afterCycle": 1,
"computedPrice": {
"amount": "text",
"currencyCode": "text"
},
"adjustmentValue": {
"SellingPlanPricingPolicyPercentageValue": {
"percentage": "text"
}
}
}
]
}
}
],
"customAttributes": [
{
"key": "text",
"value": "text"
}
],
"deliveryMethod": {
"shippingOption": {
"code": "text",
"description": "text"
}
}
}
}
Successfully canceled the subscription contract. Returns information about the canceled subscription and any integration actions triggered.