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

# Update an invoice

`PUT /v1/invoices/{invoiceKey}`

Updates a specific invoice.
The following tutorials demonstrate how to use this operation:
  - <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/leverage-advanced-capabilities/unified-invoicing/invoice-items-of-draft-standalone-invoices/manage-invoice-items-of-draft-standalone-invoices-through-the-rest-api"
  target="_blank">Add and delete invoice items of draft standalone invoices</a>
  - <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/leverage-advanced-capabilities/unified-invoicing/due-dates-of-draft-standalone-invoices-editing/edit-the-due-date-on-draft-standalone-invoices-through-the-rest-api"
  target="_blank">Edit due dates of draft standalone invoices</a>
  - <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/leverage-advanced-capabilities/unified-invoicing/invoice-item-prices-and-custom-fields-of-draft-standalone-invoices-editing/edit-the-invoice-item-prices-and-custom-fields-of-standalone-invoices-through-the-rest-api"
  target="_blank">Edit invoice item prices and custom fields of draft standalone invoices</a>

## 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

- PutInvoiceType — Container for custom fields of an Invoice object.
  - `autoPay` boolean — Whether invoices are automatically picked up for processing in the corresponding payment run. By default, invoices are automatically picked up for processing in the corresponding payment run.
  - `comments` string — Additional information related to the invoice that a Zuora user added to the invoice.
  - `dueDate` string, date — The date by which the payment for this invoice is due.
  - `invoiceDate` string, date — The new invoice date of the invoice. The new invoice date cannot fall in a closed accounting period. You can only specify `invoiceDate` or `dueDate` in one request. Otherwise, an error occurs.
  - `invoiceItems` PutInvoiceItemType[] — Container for invoice items, The maximum number of items is 1,000.
    - `accountingCode` string — The accounting code associated with the invoice item.
    - `accountsReceivableAccountingCode` string — The accounting code for accounts receivable.
    - `adjustmentLiabilityAccountingCode` string — The accounting code for adjustment liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `adjustmentRevenueAccountingCode` string — The accounting code for adjustment revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `amount` number — The amount of the invoice item. - For tax-inclusive invoice items, the amount indicates the invoice item amount including tax. - For tax-exclusive invoice items, the amount indicates the invoice item amount excluding tax.
    - `bookingReference` string — The booking reference of the invoice item. **Note**: This field is only available if `id` is null.
    - `chargeDate` string — The date when the invoice item is charged, in `yyyy-mm-dd hh:mm:ss` format.
    - `chargeName` string — The name of the charge associated with the invoice item. This field is required if the `productRatePlanChargeId` field is not specified in the request.
    - `contractAssetAccountingCode` string — The accounting code for contract asset. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `contractLiabilityAccountingCode` string — The accounting code for contract liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `contractRecognizedRevenueAccountingCode` string — The accounting code for contract recognized revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `deferredRevenueAccountingCode` string — The accounting code for the deferred revenue, such as Monthly Recurring Liability. **Note:** This field is only available if you have Zuora Finance enabled.
    - `delete` boolean — Indicates whether to delete the existing invoice item. **Note**: Set this field to `true` and specify an item `id` to delete an item.
    - `description` string — The description of the invoice item.
    - `discountItems` PutDiscountItemType[] — Container for discount items. The maximum number of discount items is 10.
      - `accountingCode` string — The accounting code associated with the discount item.
      - `accountsReceivableAccountingCode` string — The accounting code for accounts receivable.
      - `adjustmentLiabilityAccountingCode` string — The accounting code for adjustment liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `adjustmentRevenueAccountingCode` string — The accounting code for adjustment revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `amount` string, number, required — The amount of the discount item. - Should be a negative number. For example, `-10`. - Always a fixed amount no matter whether the discount charge associated with the discount item uses the [fixed-amount model or percentage model](https://docs.zuora.com?resourceId=billing-fixed-amount-model-and-percentage-model). - For tax-exclusive discount items, this amount indicates the discount item amount excluding tax. - For tax-inclusive discount items, this amount indicates the discount item amount including tax.
      - `bookingReference` string — The booking reference of the discount item.
      - `chargeDate` string — The date when the discount item is charged, in `yyyy-mm-dd hh:mm:ss` format.
      - `chargeName` string — The name of the charge associated with the discount item. This field is required if the `productRatePlanChargeId` field is not specified in the request.
      - `contractAssetAccountingCode` string — The accounting code for contract asset. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `contractLiabilityAccountingCode` string — The accounting code for contract liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `contractRecognizedRevenueAccountingCode` string — The accounting code for contract recognized revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `deferredRevenueAccountingCode` string — The accounting code for the deferred revenue, such as Monthly Recurring Liability. **Note:** This field is only available if you have Zuora Finance enabled.
      - `description` string — The description of the discount item.
      - `id` string — The unique ID of the discount item.
      - `itemType` string — The type of the discount item.
      - `purchaseOrderNumber` string — The purchase order number associated with the discount item.
      - `recognizedRevenueAccountingCode` string — The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges. **Note:** This field is only available if you have Zuora Finance enabled.
      - `revRecCode` string — The revenue recognition code.
      - `revRecTriggerCondition` 'ContractEffectiveDate' | 'ServiceActivationDate' | 'CustomerAcceptanceDate' — The date when revenue recognition is triggered.
      - `revenueRecognitionRuleName` string — The name of the revenue recognition rule governing the revenue schedule. **Note:** This field is only available if you have Zuora Finance enabled.
      - `sku` string — The SKU of the invoice item. The SKU of the discount item must be different from the SKU of any existing product.
      - `unbilledReceivablesAccountingCode` string — The accounting code for unbilled receivables. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
      - `unitPrice` string, number — The per-unit price of the discount item. If the discount charge associated with the discount item uses the percentage model, the unit price will display as a percentage amount in PDF. For example: if unit price is 5.00, it will display as 5.00% in PDF.
      - `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 invoice item's synchronization with 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 invoice item was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
    - `excludeItemBillingFromRevenueAccounting` boolean — The flag to exclude the invoice item from revenue accounting. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `id` string — The unique ID of the invoice item. - Specify this field when updating or deleting an existing memo item. - Do not specify this field when creating a memo item.
    - `itemType` string — The type of the invoice item.
    - `productRatePlanChargeId` string — The ID of the product rate plan charge that the invoice item is created from. If you specify the ID of a product rate plan charge in this field, no matter whether the following fields are specified with values, the following fields use the values from the corresponding product rate plan charge instead of the specified values: - `chargeName` - `sku` - `uom` - `taxCode` - `taxMode` - `accountingCode` - `deferredRevenueAccountingCode` - `recognizedRevenueAccountingCode` **Note**: Do not specify the invoice item `id` when specifying this field.
    - `purchaseOrderNumber` string — The purchase order number associated the invoice item.
    - `quantity` string, number — The number of units for the invoice item.
    - `recognizedRevenueAccountingCode` string — The accounting code for the recognized revenue, such as Monthly Recurring Charges or Overage Charges. **Note:** This field is only available if you have Zuora Finance enabled.
    - `revRecCode` string — The revenue recognition code.
    - `revRecTriggerCondition` 'ContractEffectiveDate' | 'ServiceActivationDate' | 'CustomerAcceptanceDate' — The date when revenue recognition is triggered.
    - `revenueRecognitionRuleName` string — The name of the revenue recognition rule governing the revenue schedule. **Note:** This field is only available if you have Zuora Finance enabled.
    - `serviceEndDate` string, date — The service end date of the invoice item.
    - `serviceStartDate` string, date — The service start date of the invoice item.
    - `sku` string — The SKU of the invoice item. The SKU of the invoice item must be different from the SKU of any existing product.
    - `taxCode` string — The tax code identifies which tax rules and tax rates to apply to the invoice item. **Note:** - This field is only available if you have Taxation enabled. - If the values of both `taxCode` and `taxMode` fields are changed to `null` when updating a standalone invoice, the corresponding `invoiceItems` > `taxItems` field and its nested fields specified in the creation request will be removed.
    - `taxMode` 'TaxInclusive' | 'TaxExclusive' — The tax mode of the invoice item, indicating whether the amount of the invoice item includes tax. **Note:** - This field is only available if you have Taxation enabled. - If the values of both `taxCode` and `taxMode` fields are changed to `null` when updating a standalone invoice, the corresponding `invoiceItems` > `taxItems` field and its nested fields specified in the creation request will be removed.
    - `unbilledReceivablesAccountingCode` string — The accounting code for unbilled receivables. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
    - `unitPrice` string, number — The per-unit price of the invoice item.
    - `uom` string — The unit of measure.
    - `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 invoice item's synchronization with 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 invoice item was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).
  - `transferredToAccounting` 'Processing' | 'Yes' | 'No' | 'Error' | 'Ignore' — Whether the invoice was transferred to an external accounting system.
  - `templateId` string — The ID of the invoice template associated with the invoice. **Note**: This field is only available if you have the <a href="https://docs.zuora.com?resourceId=billing-attributes-for-flexible-billing" target="_blank">Flexible Billing Attributes</a> feature enabled.
  - `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 invoice's synchronization with 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 invoice was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).

## Response `200`

OK

- PutInvoiceResponseType — Container for custom fields of an Invoice object.
  - `accountId` string — The ID of the customer account associated with the invoice.
  - `amount` number — The total amount of the invoice.
  - `autoPay` boolean — Whether invoices are automatically picked up for processing in the corresponding payment run.
  - `balance` number — The balance of the invoice.
  - `cancelledById` string, nullable — The ID of the Zuora user who cancelled the invoice.
  - `cancelledOn` string, nullable — The date and time when the invoice was cancelled, in `yyyy-mm-dd hh:mm:ss` format.
  - `comment` string, nullable — Comments about the invoice.
  - `createdById` string — The ID of the Zuora user who created the invoice.
  - `createdDate` string — The date and time when the invoice was created, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-01 15:31:10.
  - `creditBalanceAdjustmentAmount` number — **Note:** This filed is only available if you have the Credit Balance feature enabled and the Invoice Settlement feature disabled. The currency amount of the adjustment applied to the customer's credit balance.
  - `currency` string — A currency defined in the web-based UI administrative settings.
  - `discount` number — The discount of the invoice.
  - `dueDate` string, date — The date by which the payment for this invoice is due.
  - `id` string — The unique ID of the invoice.
  - `invoiceDate` string, date — The date on which to generate the invoice.
  - `number` string — The unique identification number of the invoice.
  - `postedById` string, nullable — The ID of the Zuora user who posted the invoice.
  - `postedOn` string, nullable — The date and time when the invoice was posted, in `yyyy-mm-dd hh:mm:ss` format.
  - `status` 'Draft' | 'Posted' | 'Canceled' | 'Error' | 'Split' — The status of the invoice. **Note:** - The `Split` status is applicable only when you use <a href="https://docs.zuora.com/en/zuora-billing/bill-your-customer/invoice-management/split-invoices/split-invoices-overview" target="_blank">Split Invoice feature</a>. - When an invoice is split, its status changes from `Draft` to `Split`, and the newly created invoices retain a reference to the original invoice.
  - `success` boolean — Returns `true` if the request was processed successfully.
  - `targetDate` string, date, nullable — The target date for the invoice, in `yyyy-mm-dd` format. For example, 2017-07-20.
  - `taxAmount` number — The amount of taxation.
  - `templateId` string — The ID of the invoice template associated with the invoice.
  - `totalTaxExemptAmount` number — The calculated tax amount excluded due to the exemption.
  - `transferredToAccounting` 'Processing' | 'Yes' | 'No' | 'Error' | 'Ignore' — Whether the invoice was transferred to an external accounting system.
  - `updatedById` string — The ID of the Zuora user who last updated the invoice.
  - `updatedDate` string — The date and time when the invoice was last updated, in `yyyy-mm-dd hh:mm:ss` format. For example, 2017-03-02 15:36:10.
  - `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 invoice's synchronization with 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 invoice was synchronized with NetSuite. Only available if you have installed the [Zuora Connector for NetSuite](https://www.zuora.com/connect/app/?appId=265).

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