Skip to main content

Cancel subscriptions and write off all unpaid invoices

Zuora

Cancel subscriptions and write off all unpaid invoices

An end customer has a subscription with an invoice balance equal to the invoice total amount. No payment nor credit memo was created. In this case, if you want to cancel the subscription and stop the end customer from making a further payment, you can write off all unpaid invoices during subscription cancellation. By writing off all unpaid invoices, credit memos are automatically generated and applied to invoices to make the balance of the invoice 0, which saves the end customer’s effort to create credit memos manually after the subscription cancellation.

Prerequisites

Before you cancel a subscription and write off all unpaid invoices, ensure that the following requirements are met:

  • The Orders and Workflow features must have been enabled. To enable the Workflow feature, click the Workflow tab on the left navigation panel.
  • The Invoice Settlement feature must have been enabled to access write-off settings.
  • If you are using the Zuora UI:
  • Invoices must be issued first. For example, bill run has been created. 

Cancel a subscription and write off all unpaid invoices using the Zuora UI

You can cancel a subscription and write off all existing unpaid invoices from the reinvented subscription details page.

To complete the task, perform the following steps:

  1. On a reinvented subscription details page, click the down arrow on the Cancel drop-down button  Cancel subscription drop-down button.png , and select the Cancel & Write Off option. The Cancel Subscription window opens, and the customer account name and account balance are displayed on the top.
  2. Click the calendar icon calendar-icon.png under the Subscription cancellation effective date and specify a cancellation effective date.
  3. If you want to write off all unpaid invoices, then leave the Write off all unpaid invoices as Yes; Otherwise, toggle it to No. 
  4. If you want to generate the final invoice, toggle the Generate the final invoice to Yes.

    If you want to cancel the subscription in the middle of the billing period and write off the outstanding invoice, Zuora recommends you set the toggle to Yes for the following reasons:

    • If the toggle is Yes and the generated final invoice is a credit memo, Zuora applies this credit memo to the corresponding outstanding invoice and only writes off the remaining balance of all unpaid invoices.
    • If the toggle is Yes and the generated invoice is an invoice, Zuora writes off all unpaid invoices.
    • If the toggle is No, Zuora writes off all unpaid invoices, and the next scheduled bill run may generate another invoice or credit memo.
  5. If Order and Order Action custom fields are set, update the custom fields in the Additional Information of Order and Additional Information of Cancellation Order Action sections, respectively. For more information, see Manage Custom Fields.
  6. Click Submit.
  7. Once a confirmation window pops up, click Submit in the window. The Cancellation Result window opens, and you can view the following information associated with the cancelled subscription:
    • Credit memo
    • Invoice
    • Order 

    You can only access the cancellation results window once. You will be redirected away from this page once you click any link in this window.

    Record the cancellation results before clicking any link. Otherwise, reopen the subscription details page to find these results in the Automation History section.

  8. Click one of the following:

    • Go To The Cancelled Status Page: The subscription in the cancelled status with its details page is displayed.

    • Stay On Current Page: The subscription in the expired status with its details page is displayed.

Cancel a subscription and write off all unpaid invoices using the REST API

You can only cancel a subscription and write off all unpaid invoices through the Create an order operation, and you cannot perform the task through the Create an order asynchronously operation.

In the request body of the Create an order operation, specify the following nested fields under processingOptions to define write-off related information.

Write-off related nested fields

Field Name

Data Type

Required/Optional

Description

writeOff

Boolean

Required

Indicates whether to write off all outstanding balance on the invoice.

To write off all unpaid invoices, set this value to true.

writeOffBehavior

Object

Optional

The financial information of the credit memo items that are generated to write off the invoice balance. 

Note: 

  • All the credit memo items (CMI) that are used to write off the invoice will be applied with the same financial information.
  • The financial information specified here will not be added to CMIs generated from the unconsumed services of the canceled subscription.

See writeOffBehavior in the request body of the Create an order operation for details.

runBilling Boolean Required 

Indicates if the current request needs to generate an invoice. The invoice will be generated against all subscriptions included in this order.

To avoid generating the final invoice, set it to false.

documentDate string <date> Required The Invoice Date displayed on the invoice in UI.
targetDate string <date> Required

Date through which to calculate charges if an invoice is generated. See What is a Target Date?

The Target Date displayed on the invoice in UI.

collectPayment Boolean Required 

Indicates if the current request needs to collect payments. 

To write off all unpaid invoices, set this value to false

You can view the status of each write-off transaction in the writeOff fields in the response body.

Below is a request example.

Request POST /v1/orders/
Request Body
{
"orderDate": "2023-05-24",
"existingAccountNumber": "A00000850",
"customFields": {},
"category": "NewSales",
"subscriptions": [
{
"subscriptionNumber": "A-S00002089",
"orderActions": [
{
"type": "CancelSubscription",
"customFields": {},
"triggerDates": [
{
"name": "CustomerAcceptance",
"triggerDate": "2023-05-24"
},
{
"name": "ServiceActivation",
"triggerDate": "2023-05-24"
},
{
"name": "ContractEffective",
"triggerDate": "2023-05-24"
}
],
"cancelSubscription": {
"cancellationPolicy": "SpecificDate",
"cancellationEffectiveDate": "2023-05-24"
}
}
]
}
],
"processingOptions": {
"runBilling": false,
"writeOff": true,
"billingOptions": {
"documentDate": "2023-05-24",
"targetDate": "2023-05-24"
},
"collectPayment": false
}
}

To use the above request body directly, replace the values, including the pre-defined variables, with your own data.

Below is the response returned:

Response Body
{
"success": true,
"orderNumber": "O-00005009",
"accountNumber": "A00000850",
"status": "Completed",
"subscriptionNumbers": [
"A-S00002089"
],
"writeOff": [
{
"invoiceNumber": "INV00029461",
"amount": 30.00,
"status": "Success",
"writeOffCreditMemoNumber": "CM00000340"
}
]
}

The writeOfffields display write-off results.