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

# Write off an invoice

`PUT /v1/invoices/{invoiceKey}/write-off`

**Note:** This operation is only available if you have [Invoice Settlement](https://docs.zuora.com?resourceId=billing-invoice-settlement) enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://docs.zuora.com?resourceId=billing-invoice-settlement-migration-checklist-and-guide) for more information.

Writes off a posted invoice. 

By writing off an invoice, a credit memo is created and applied to the invoice. The generated credit memo items and credit memo taxation items are applied to invoice items and invoice taxation items based on the configured default application rule. If an invoice is written off, the balance of each invoice item and invoice taxation item must be zero.

If you set the **Create credit memos mirroring invoice items billing rule** to **Yes**, you can write off an invoice even if all its items have zero balance.

**Restrictions**: You cannot write off an invoice if any of the following restrictions is met:
* The balance of an invoice has been changed before Invoice Settlement is enabled.
  For example, before Invoice Settlement is enabled, any credit balance adjustments, invoice item adjustments, or invoice adjustments have been applied to an invoice.
* An invoice contains more than 2,000 items in total, including invoice items, discount items, and taxation items.
See [Invoice Write-off](https://docs.zuora.com?resourceId=billing-write-off-invoices) for more information.

## Path parameters

- `invoiceKey` string, required

## Headers

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

## Request body

- PUTWriteOffInvoiceRequest — 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.
  - `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.
  - `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.
  - `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.
  - `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.
  - `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

- PUTWriteOffInvoiceResponse
  - `creditMemo` object — 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.
  - `success` boolean — Returns `true` if the request was processed successfully.

## Other responses

- `500` — Internal Server Error
- `4XX` — Request Errors

---

[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)
