Skip to main content

Edit invoice item prices and custom fields of draft standalone invoices

Zuora

Edit invoice item prices and custom fields of draft standalone invoices

After a standalone invoice is created without posting, you can edit the invoice item prices and custom fields of the draft standalone invoice through the Zuora UI or REST API.

Assume that after creating a draft standalone invoice, you want to edit its invoice item prices and custom fields for some reason. In this scenario, you can edit the invoice item prices and custom fields of the draft standalone invoice through the Zuora UI and REST API.

Edit the invoice item prices and custom fields of standalone invoices through the Zuora UI

To edit the invoice item price and custom fields of a draft standalone invoice through the Zuora UI, perform the following steps:

  1. Navigate to Billing > Invoices.
  2. On the All Invoices page, click the invoice that you want to edit the invoice item price and custom fields for.
  3. On the invoice details page, click more > Edit Invoice.
    The invoice editing page is displayed.
  4. In the Invoice Details area, click Edit in the row specific to the invoice item that you want to update the price for. 
  5. In the Edit a Charge window that opens, edit the following information:
    1. In the Pricing area, enter the new unit price of the item in the Price (Currency) field.
    2. In the Additional Information area, update the values of the custom fields that you want to change.
    3. Optional: In other areas, update other information for the invoice if needed.
    4. Click Save to save the changes.
  6. On the invoice editing page, click Save Updates to save the changes.

The invoice item price and custom fields of the standalone invoice are updated, and its details page is displayed directly after editing.

Edit the invoice item prices and custom fields of standalone invoices through the REST API

You can use the Update an invoice operation to edit the invoice item price and custom fields of a draft standalone invoice, or the Update invoices operation to edit the invoice item prices and custom fields of multiple draft standalone invoices in one single request.

In the aforementioned scenario, you have to provide a new price in theinvoiceItems > price field and new custom field values in the request body of the Update an invoice operation.

To edit the invoice item price and custom fields of a draft standalone invoice through the Zuora REST API, perform the following steps:

  1. Determine the mandatory fields that you need for editing the invoice item price and custom fields of a standalone invoice, including:
    • Path parameter: invoiceId
    • Request field: invoiceItems > price
    • Request field: custom fields to change
  2. Use the Update an invoice operation to edit the invoice item price and custom fields of a draft standalone invoice.

The following sample API request edits the invoice item price and two custom fields of a draft standalone invoice:

Request PUT /v1/invoices/{invoiceId}
Request body
{
    "autoPay": true,
    "comments": "Invoice comments",
    "invoiceItems": [
        {
            "unitPrice": 120,
            "InvoiceDetails_Date_Optional__c": "2021-08-01",
            "InvoiceDetails_Date_Required__c": "2021-08-01",
            "amount": 360,
            "id": "2c92c8fb7ae2ed7b017ae5d464ac693c"
        }
    ]
}

After the sample API request is submitted, the following sample API response is returned:

Request PUT /v1/invoices/{invoiceId}
Response body
{
  "id": "2c92c8fb7ae2ed7b017ae5d4647d693b",
  "number": "INV00001508",
  "accountId": "2c92c8fb7ae2ed67017ae5c126a361ea",
  "invoiceDate": "2021-02-01",
  "currency": "USD",
  "targetDate": null,
  "dueDate": "2021-03-03",
  "postedOn": null,
  "postedById": null,
  "status": "Draft",
  "amount": 360.000000000,
  "taxAmount": 0.000000000,
  "totalTaxExemptAmount": 0.000000000,
  "balance": 360.000000000,
  "comment": "Invoice comments",
  "autoPay": true,
  "transferredToAccounting": "No",
  "creditBalanceAdjustmentAmount": 0.000000000,
  "createdDate": "2021-07-26 19:38:59",
  "createdById": "2c92c8fe78a9a0740178a9b0b06c007a",
  "updatedDate": "2021-07-29 03:04:11",
  "updatedById": "2c92c8fe78a9a0740178a9b0b06c007a",
  "cancelledOn": null,
  "cancelledById": null,
  "InvoiceNumber__c": null,
  "Invoice_Text_Required_Default__c": "Invoice Default Text",
  "Invoice_Date_Required__c": null,
  "IntegrationId__NS": null,
  "IntegrationStatus__NS": null,
  "Invoice_Picklist_Required_Default__c": "inv_first",
  "Invoice_Text_Optional__c": null,
  "Invoice_Picklist_Optional__c": "inv_first",
  "Invoice_Date_Optional__c": null,
  "Entity__c": "STD",
  "SyncDate__NS": null,
  "success": true
}