- Cancel a subscription order
Cancels a subscription order.
Cancellation resource.
ID of the canceled subscription order.
Specifies who initiated the cancellation.
Reason for the cancellation.
Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.
Status of the subscription order.
| Enum Value | Description |
|---|---|
| draft | Creates a draft cancellation so that the cancellation and charge can be previewed. |
| confirmed | Confirms a subscription cancellation. Sets the subscription to cancel when the |
| completed | Marks a subscription cancellation as completed. This is a read-only status that is set when the |
| revoked | Revokes a subscription cancellation. |
Date and time when the subscription is deactivated. If this field and churnTimePolicy are omitted, this value defaults to the current time.
Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.
- Mock serverhttps://www.rebilly.com/_mock/catalog/all/subscription-cancellations
- Sandbox serverhttps://api-sandbox.rebilly.com/organizations/{organizationId}/subscription-cancellations
- Live serverhttps://api.rebilly.com/organizations/{organizationId}/subscription-cancellations
- SecretApiKey
- JWT
curl -i -X POST \
https://www.rebilly.com/_mock/catalog/all/subscription-cancellations \
-H 'Content-Type: application/json' \
-H 'REB-APIKEY: YOUR_API_KEY_HERE' \
-d '{
"subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328",
"canceledBy": "merchant",
"reason": "did-not-use",
"description": "string",
"prorated": false,
"status": "draft",
"churnTime": "2019-08-24T14:15:22Z",
"churnTimePolicy": "null",
"lineItems": [
{
"type": "debit",
"description": "string",
"unitPriceAmount": 49.95,
"unitPriceCurrency": "USD",
"quantity": 1,
"periodStartTime": "2019-08-24T14:15:22Z",
"periodEndTime": "2019-08-24T14:15:22Z"
}
]
}'Cancellation created.
Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.
ID of the cancellation.
ID of the canceled subscription order.
ID of the invoice on which the cancellation proration is calculated.
ID of the invoice on which the cancellation fees or credits are applied.
Specifies who initiated the cancellation.
Reason for the cancellation.
Specifies if the customer gets a pro-rata credit for the time remaining between churnTime and subscription next renewal time.
Status of the subscription order.
| Enum Value | Description |
|---|---|
| draft | Creates a draft cancellation so that the cancellation and charge can be previewed. |
| confirmed | Confirms a subscription cancellation. Sets the subscription to cancel when the |
| completed | Marks a subscription cancellation as completed. This is a read-only status that is set when the |
| revoked | Revokes a subscription cancellation. |
Date and time when a subscription is canceled. By default, this occurs when status is confirmed, unless draft is specified.
Date and time when the resource is created. This value is set automatically when the resource is created.
Date and time when the resource is updated. This value is set automatically when the resource is updated.
Date and time when the subscription is deactivated. If this field and churnTimePolicy are omitted, this value defaults to the current time.
Specifies when the subscription is to be deactivated. The churnTimePolicy takes precedence over the churnTime in request.
Items to be added to the new invoice. Proration item is generated and added automatically.
Subtotal of the line items added after the subscription cancellation.
{ "id": "sub_cnl_0YVJ5XVQM9CDP8248ZQX0RDMKV", "subscriptionId": "sub_01HRF27SATGE4Z6PBJE6PD8328", "proratedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "appliedInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "canceledBy": "merchant", "reason": "did-not-use", "description": "string", "prorated": false, "status": "draft", "canceledTime": "2019-08-24T14:15:22Z", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "churnTime": "2019-08-24T14:15:22Z", "churnTimePolicy": "null", "lineItems": [ { … } ], "lineItemSubtotal": { "amount": 49.95, "currency": "USD" }, "_links": [ { … } ] }