POST /subscriptions/{subscription-id}/cancel_for_items
Cancels the specified subscription.
Subscription ramps
If ramps are scheduled for the subscription, this operation deletes any ramps that are set to become effective on or after the subscription's cancellation time.
Contract terms
If the subscription has contract terms, it can only be canceled by terminating the contract using the contract_term_cancel_option
. The contract term and the subscription are canceled together.
Contract terms parameters
- contract_term_cancel_option
- cancel_at
- credit_option_for_current_term_charges
- unbilled_charges_option
- account_receivables_handling
- refundable_credits_handling
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
Path parameters
Name | Type | Required | Description |
---|---|---|---|
subscription-id |
String | Yes |
Request headers
Name | Type | Required | Description |
---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Possible values:
|
chargebee-business-entity-id |
String | No |
If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation. |
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header |
chargebee-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
cancel_option |
String | No |
If the subscription does not have a contract term:Determines when to cancel the subscription. If the subscription has a contract term:This parameter is not applicable.
* end_of_billing_term - This is used to cancel a subscription either at the end of the advance term, if it's billed for future renewals or at the end of its current billing cycle * end_of_term - This is used to cancel a subscription at the end of the current billing cycle * immediately - This is used to cancel the subscription with immediate effect * specific_date - This is used to cancel a subscription on a specified date. The change occurs as of the date/time defined in Possible values:
|
end_of_term |
Boolean | No |
(Deprecated) Use Applicable only when the subscription does not have contract terms. Set this to Default value: false |
cancel_reason_code |
String | No |
Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Subscriptions > Subscription Cancellation. Must be passed if set as mandatory in the app. The codes are case-sensitive. |
refundable_credits_handling |
String | No |
If the subscription does not have a contract term:Specifies how to handle refundable credits when canceling immediately (i.e., If the subscription has a contract term:Specifies how to handle refundable credits when Possible values:
|
unbilled_charges_option |
String | No |
If the subscription does not have a contract term:Specifies how to handle unbilled charges when canceling immediately (i.e., If the subscription has a contract term:Specifies how to handle unbilled charges when Possible values:
|
account_receivables_handling |
String | No |
If the subscription does not have a contract term:Specifies how to handle past due invoices when canceling immediately (i.e., If the subscription has a contract term:Specifies how to handle past due invoices when Possible values:
|
contract_term_cancel_option |
String | No |
Required when the subscription has a contract term. Determines when to cancel the subscription along with the contract term. * terminate_immediately - Cancels the subscription and contract term immediately. Sets the contract term's Prevents the contract term from renewing and schedules the subscription for cancellation at the end of the contract term. * specific_date - Cancels the subscription and contract term on the date specified by Cancels the subscription and contract term at the end of the current billing cycle. Sets Possible values:
|
cancel_at |
Integer | No |
If the subscription does not have a contract term:Specifies the date and time when the subscription should be canceled. Do not use this parameter when If the subscription has a contract term:Applicable only when BackdatingYou can set a past date to backdate the cancellation. Backdating is allowed only if the following conditions are met:
|
invoice_date |
Integer | No |
The document date displayed on the invoice PDF. The default value is the current date. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if
|
credit_option_for_current_term_charges |
String | No |
If the subscription does not have a contract term:Specifies how to handle credits for current term charges when canceling immediately (i.e., If the subscription has a contract term:Specifies how to handle credits for current term charges when Possible values:
|
subscription_items |
Object | No |
Parameters for subscription_items |
subscription_items.unit_price[] |
Array | No |
The termination fee. In case it is quantity-based, this is the fee per unit. |
subscription_items.unit_price_in_decimal[] |
Array | No |
When price overriding is enabled for the site, the price or per-unit price of the item can be set here. The value set for the item price is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when multi-decimal pricing is enabled. |
subscription_items.item_price_id[] |
Array | No |
The unique |
subscription_items.quantity[] |
Array | No |
The quantity associated with the termination fee. Applicable only when the item_price for the termination charge is quantity-based. |
subscription_items.quantity_in_decimal[] |
Array | No |
The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. |
subscription_items.service_period_days[] |
Array | No |
The service period of the termination fee---expressed in days---starting from the current date. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.