Cancel subscriptions and refund end customers automatically
You can cancel a subscription and subsequently refund the unconsumed part to the end customers through the Zuora UI or REST API.
You can also write off any outstanding balances on the invoices associated with a subscription when canceling the subscription with a refund through the REST API.
Examples
The following examples are provided for your reference:
- Canceling a subscription with different refunds based on the same calculated credit memo
- An example of canceling a subscription with a refund and write-off through the REST API
For more information, see Examples of cancelling a subscription and refund the end customers automatically.
Notes and limitations
Note the following behaviors and limitations when you cancel a subscription with a refund:
- Credit Memo, Payment, and Refund custom fields are not supported. If you have any required Credit Memo, Payment, and Refund custom fields, please do not follow the process described in this article; use the existing cancel subscription, payment, and refund process separately.
- The write-off function is only supported in the REST API but not in the Zuora UI. For more information, see the Create an order operation.
- Through the Zuora UI, you can only cancel a subscription with a refund from the reinvented subscription details page of an active subscription.
- The API request will not return errors if the refunds or invoice write-offs fail. But details of each transaction will be returned in the response body.
- In scenarios where multiple payments need to be refunded, Zuora will refund the payments one by one instead of refunding the same amount to payment evenly.
- Only electronic payments can be refunded automatically. External payments are not supported for now.
- Only subscriptions that are invoiced separately are supported.
Prerequisites
Before canceling a subscription with a refund, ensure that the following requirements are met:
- The Orders feature must have been enabled for your tenant.
- Enable Order UI is checked in Billing Settings > Default Subscription and Order Setting.
- The Invoice Settlement feature must have been enabled for your tenant.
- The Invoice Item Settlement feature must have been enabled for your tenant.
- If you are using the Zuora UI to cancel a subscription with a refund, you need to enable and access the reinvented subscription details page. For more information, see View details of subscriptions through the reinvented UI.
- Invoices and payments must be issued if you want to issue a refund after canceling a subscription.
Check the total payment amounts of a subscription
Before cancelling a subscription with a refund, you need to check the total amount of generated payments for the subscription.
- On the Subscriptions page, search for or filter the subscription.
- Click the Subscription Number of the subscription to open the subscription details page.
- Click the invoice number link in the Associated Events section to open the invoice details page.
- View the total amount of the payments in the Outstanding Balance section.
Cancel a subscription with a refund using the Zuora UI
To cancel a subscription with a refund from the reinvented subscription details page, perform the following steps:
- Click the Cancel on the top-right of the subscription details page. The Cancel Subscription window opens, and the customer account name and account balance are displayed on the top.
- In the Subscription cancellation effective date section, select one of the following dates or specify a Specific Date as the cancellation effective date:
- End of Current Term: If the subscription is an evergreen subscription, the option is unavailable.
- Start of Current Term
- End of Last Invoice Period: If there is no invoice associated with this subscription, the option is unavailable.
- Subscription Start Date
- Specific Date: The default date is today's date.
An estimated credit amount in the final invoice is calculated based on your selection and displayed here and also in the Refund Amount field.
-
In the Do you want to refund payment after the subscription is cancelled? section, check the Refund payment checkbox and specify a value in the Refund Amount field.
Note the following when you specify the refund amount:
- The section is unavailable if there is no invoice associated with this subscription.
- Refer to the estimated credit amount displayed by default and specify a value not greater than the total amount of generated payments for the subscription. See Check the total payment amounts of a subscription.
- If Order and Order Action custom fields were set, update the custom fields in the Additional Information of Order and Additional Information of Cancellation sections, respectively. For more information, see Manage Custom Fields.
- If required custom fields are applied, the custom fields are displayed in an expanded view. After updating the required custom fields, you can click Show optional fields to expand and update the optional custom fields if applied.
- If only optional fields are applied, click Expand to view all fields to expand and update the optional custom fields.
-
Click Submit. The Cancellation Result window opens where you can view a cancellation result including the subscription result.
- If your cancellation succeeds, you can view the following steps.
- Cancel Subscription: You can click the order number link to view the order details.
- Generate and Post Credit Memo: You can click the credit memo number link to view the credit memo details.
- Unapply Payment: You can click the payment number link to view the payment details.
- Refund Payment: You can click the refund number link to view the refund details.
- Apply Credit Memo to Invoices: You can click the Associated Events link to view invoice and credit memo information in the Associated Events section of the subscription details page.
- If your cancellation fails, click Retry Cancel to modify your cancellation and refund, and then click Submit again.
- If your cancellation succeeds, you can view the following steps.
- Click Go To The Cancelled Status Page to open the subscription details page or click Stay On Current Page to close the window. The subscription details page displays details information about the subscription that is in the latest version.
You can only access the cancellation result once. If needed, record the cancellation result before clicking Go To The Cancelled Status Page or Stay On Current Page.
Cancel a subscription with a refund using the REST API
Note that you can only cancel a subscription with a refund through the Create an order operation, you cannot perform the task through the Create an order asynchronously operation.
In the request body of the Create an order operation, you need to specify the following nested fields under processingOptions
to define refund and write-off related information.
Field Name |
Data Type |
Required/Optional |
Description |
---|---|---|---|
refund |
Boolean |
Optional; Default is |
Indicates whether to refund after the subscription cancellation. |
refundAmount |
Number |
Optional; Default is |
Indicates the amount to be refunded. |
writeOff |
Boolean |
Optional; Default is |
Indicates whether to write off the outstanding balance on the invoice after refunding. |
writeOffBehavior |
Object |
Optional; Default is |
The financial information of the credit memo items that are generated to write off the invoice balance. Note:
See |
You can view the status of each refund and write-off transaction in the refund
and writeOff
fields in the response body.
The following request would help solve the issue described in an example of canceling a subscription with a refund and write-off through the REST API.
Request | POST /v1/orders/ |
---|---|
Request Body |
{ "orderDate": "$Today", "existingAccountNumber": "$AccountNum", "subscriptions": [ { "subscriptionNumber": "$SubscriptionNum", "orderActions": [ { "type": "CancelSubscription", "triggerDates": [ { "name": "ContractEffective", "triggerDate": "2022-04-30" }, { "name": "ServiceActivation", "triggerDate": "2022-04-30" }, { "name": "CustomerAcceptance", "triggerDate": "2022-04-30" } ], "cancelSubscription": { "cancellationPolicy": "SpecificDate", "cancellationEffectiveDate": "2022-04-30" } } ] } ], "processingOptions": { "runBilling": true, "billingOptions": { "documentDate": "2022-04-30", "targetDate": "2022-04-30" }, "refund": true, "refundAmount": 800, "writeOff": true } } |
Note that to use the above request body directly, you need to replace the values, including the pre-defined variables, with your own data.
Below is the response returned:
Response Body |
{ "success": true, "orderNumber": "O-00000014", "accountNumber": "A%00026270", "status": "Completed", "subscriptionNumbers": ["A-S00020477"], "creditMemoNumbers": ["CM100000123"], "refunds": [{ "number": "R-00009564", "status": "Success" }], "writeOff": [{ "invoiceNumber": "INV00051208", "amount": 100.00, "status": "Success", "failedReason": null }] } |
---|
The refunds
and writeOff
fields display refund and write-off results.
How does the auto-refund and write-off during subscription cancellation work?
- If the cancel & refund request is submitted either through the UI or API, an auto-refund process is automatically initiated.
- If the cancel & refund request including write off is submitted through the API, an auto-refund and write-off process is automatically initiated.
For more information, see Auto-refund and write-off process during subscription cancellation.