---
title: "Write off an invoice asynchronously"
method: POST
path: "/v1/invoices/{invoiceKey}/write-off-async"
tags: ["Invoices"]
---

# Write off an invoice asynchronously

`POST /v1/invoices/{invoiceKey}/write-off-async`

Asynchronously writes off a posted invoice. By writing off an invoice, a credit memo is created and applied to the invoice. If the
invoice contains more than 2,000 items, this operation is performed asynchronously. Use the [Retrieve invoice write-off async job](https://developer.zuora.com/v1-api-reference/api/invoices/retrieveinvoicewriteoffasyncjob)
operation to track the status of the async job. 

**Note:** This operation is only available if you have <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/adjust-invoice-amounts/invoice-settlement/get-started-with-invoice-settlement/invoice-settlement-overview"
  target="_blank">Invoice Settlement</a> enabled. This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement,
see <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/adjust-invoice-amounts/invoice-settlement/invoice-settlement-migration-checklist-and-guide"
target=“_blank”>Invoice Settlement Enablement and Checklist Guide</a> for more information.

## Path parameters

- `invoiceKey` string, required

## Headers

- `Accept-Encoding` string
- `Content-Encoding` string
- `Authorization` string
- `Zuora-Track-Id` string
- `Zuora-Entity-Ids` string
- `Zuora-Version` string
- `Zuora-Org-Ids` string

## Request body

- WriteOffInvoiceRequest — Container for Credit Memo fields provided by the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `comment` string — Comments about the write-off. The comment is used as the comment of the credit memo generated by writing off the specified invoice.
  - `amount` number — The write off amount of the invoice. **Note**: This field is available only if you have enabled the enhanced write-off permission for your tenant. Contact <a href="https://support.zuora.com/hc/en-us" target="_blank">Zuora Global Support</a> to enable this permission.
  - `revenueImpacting` 'Yes' | 'No' — Indicates whether this write off operation impacts the revenue. If `revenueImpacting` = `Yes`, the deferred revenue accounting code will be automatically selected from the associated invoice The **Exclude Billing Item From Revenue** field will be automatically set to **Yes** by default for such non-revenue impacting write off credit memos, and this setting cannot be changed. This enhancement helps ensure that only revenue-impacting items are synchronized with Zuora Revenue, reducing unnecessary data processing. If `revenueImpacting` = `No`, users can select an accounting code such as bad-debt expense accounting code for the write off operation. **Note**: This field is available only if you have enabled the enhanced write-off permission for your tenant. Contact <a href="https://support.zuora.com/hc/en-us" target="_blank">Zuora Global Support</a> to enable this permission.
  - `nonRevenueWriteOffAccountingCode` string — Specify the accounting code for the non revenue write off. Available only if `revenueImpacting` = `no`. **Note**: This field is available only if you have enabled the enhanced write-off permission for your tenant. Contact <a href="https://support.zuora.com/hc/en-us" target="_blank">Zuora Global Support</a> to enable this permission.
  - `items` CreditMemoItemFromWriteOffInvoice[] — Container for items. This field is optional. **Note:** * If specified, you must specify ALL the items of the invoice. The entire balance of the invoice will be written off, you cannot just write off some items of the invoice. * This field is available only if you have enabled the enhanced write-off permission for your tenant. Contact <a href="https://support.zuora.com/hc/en-us" target="_blank">Zuora Global Support</a> to enable this permission.
    - `comment` string — Comments about the credit memo item.
    - `financeInformation` object — Container for the finance information related to the credit memo item.
      - `deferredRevenueAccountingCode` string — The accounting code for the deferred revenue, such as Monthly Recurring Liability.
      - `onAccountAccountingCode` string — The accounting code that maps to an on account in your accounting system.
      - `recognizedRevenueAccountingCode` string — The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges.
      - `revenueRecognitionRuleName` string — The name of the revenue recognition rule governing the revenue schedule.
    - `invoiceItemId` string — The ID of the invoice item.
    - `serviceEndDate` string, date — The service end date of the credit memo item.
    - `amountWithoutTax` number — The write off amount of the invoice item excluding tax.
    - `serviceStartDate` string, date — The service start date of the credit memo item.
    - `skuName` string — The name of the charge associated with the invoice.
    - `unitOfMeasure` string — The definable unit that you measure when determining charges.
    - `excludeItemBillingFromRevenueAccounting` boolean — Specifies whether to exclude this item from revenue accounting.
    - `taxationItems` object[] — Container for the taxation items of the credit memo item. **Note**: * This field is available only if you are on the latest Zuora API version, or you set the `Zuora-Version` request header to `239.0` or [a later available version](https://developer.zuora.com/v1-api-reference/api-versions/#minor-version).
      - `amount` number — The credit memo taxation amount.
      - `taxationItemId` string — The Id of the debit memo item.
  - `memoDate` string, date — The date when the credit memo was created, in `yyyy-mm-dd` format. The memo date must be later than or equal to the invoice date. The default value is the date when you write off the invoice.
  - `reasonCode` string — A code identifying the reason for the transaction. The value must be an existing reason code or empty. If you do not specify a value, Zuora uses the default reason code `Write-off`.
  - `IntegrationId__NS` string — ID of the corresponding object in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `IntegrationStatus__NS` string — Status of the credit memo's synchronization with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `Origin__NS` string — Origin of the corresponding object in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `SyncDate__NS` string — Date when the credit memo was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `Transaction__NS` string — Related transaction in NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).

## Response `200`

OK

- WriteOffInvoiceAsyncJobResponse
  - `processId` string — The ID of the process that handles the operation.
  - `reasons` object[] — The container of the error code and message. This field is available only if the `success` field is `false`.
    - `code` string — The error code of response.
    - `message` string — The detail information of the error response
  - `requestId` string, uuid — Unique identifier of the request.
  - `success` boolean — Indicates whether the call succeeded.
  - `id` string — The ID of the operation job.
  - `status` 'Pending' | 'Processing' | 'Processed' | 'Error' — Job status of the Invoice Settlement async job.
  - `operationType` 'AsyncCreditMemoApply' | 'AsyncCreditMemoUnapply' — Operation type of the Invoice Settlement async job.
  - `referenceId` string — The ID of the business object which is being operated.
  - `referenceType` 'CreditMemo' — Reference type of the Invoice Settlement async job.
  - `error` string, nullable — The error message if the operation fails.
  - `creditMemo` WriteOffInvoiceResponseCreditMemo — Container for the credit memo that is automatically generated when writing off invoices.
    - `id` string — The ID of the credit memo that is created when the invoice is written off.

## Other responses

- `500` — Internal Server Error
- `4XX` — Invalid input

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
