> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Update an invoice

PUT https://rest.test.zuora.com/v1/invoices/{invoiceKey}
Content-Type: application/json

Updates a specific invoice.
The following tutorials demonstrate how to use this operation:

* \<a href="[https://knowledgecenter.zuora.com/Zuora\_Billing/Bill\_your\_customers/Bill\_for\_both\_subscription\_and\_non-subscription\_transactions/Unified\_Invoicing/D\_Add\_and\_delete\_invoice\_items\_of\_draft\_standalone\_invoices](https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_for_both_subscription_and_non-subscription_transactions/Unified_Invoicing/D_Add_and_delete_invoice_items_of_draft_standalone_invoices)"
  target="\_blank">Add and delete invoice items of draft standalone invoices\</a>
* \<a href="[https://knowledgecenter.zuora.com/Zuora\_Billing/Bill\_your\_customers/Bill\_for\_both\_subscription\_and\_non-subscription\_transactions/Unified\_Invoicing/Edit\_due\_dates\_of\_draft\_standalone\_invoices](https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_for_both_subscription_and_non-subscription_transactions/Unified_Invoicing/Edit_due_dates_of_draft_standalone_invoices)"
  target="\_blank">Edit due dates of draft standalone invoices\</a>
* \<a href="[https://knowledgecenter.zuora.com/Zuora\_Billing/Bill\_your\_customers/Bill\_for\_both\_subscription\_and\_non-subscription\_transactions/Unified\_Invoicing/Edit\_invoice\_item\_prices\_and\_custom\_fields\_of\_draft\_standalone\_invoices](https://knowledgecenter.zuora.com/Zuora_Billing/Bill_your_customers/Bill_for_both_subscription_and_non-subscription_transactions/Unified_Invoicing/Edit_invoice_item_prices_and_custom_fields_of_draft_standalone_invoices)"
  target="\_blank">Edit invoice item prices and custom fields of draft standalone invoices\</a>

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/billing-documents/invoices/put-update-invoice

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Path parameters

- `invoiceKey` (string, required) — The ID or number of the invoice. For example, 2c92c8955bd63cc1015bd7c151af02ab or INV-0000001.

### Headers

- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).
- `Zuora-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.
- `Zuora-Org-Ids` (string, optional) — Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.
- `Zuora-Version` (string, optional) — The minor API version. For a list of available minor versions, see [API upgrades](https://developer.zuora.com/v1-api-reference/api-upgrades/).

### Body (application/json)

This endpoint expects a PutInvoiceType.

- `autoPay` (boolean, optional) — 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, optional) — Additional information related to the invoice that a Zuora user added to the invoice.
- `dueDate` (date, optional) — The date by which the payment for this invoice is due.
- `invoiceDate` (date, optional) — 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` (list of PutInvoiceItemType, optional) — Container for invoice items, The maximum number of items is 1,000.
- `transferredToAccounting` (enum, optional) — Whether the invoice was transferred to an external accounting system.
  - Allowed values: `Processing`, `Yes`, `No`, `Error`, `Ignore`
- `templateId` (string, optional) — The ID of the invoice template associated with the invoice. **Note**: This field is only available if you have the Flexible Billing Attributes feature enabled.
- `IntegrationId__NS` (string, optional) — 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, optional) — 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, optional) — 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

- `accountId` (string, optional) — The ID of the customer account associated with the invoice.
- `amount` (double, optional) — The total amount of the invoice.
- `autoPay` (boolean, optional) — Whether invoices are automatically picked up for processing in the corresponding payment run.
- `balance` (double, optional) — The balance of the invoice.
- `cancelledById` (string, optional, nullable) — The ID of the Zuora user who cancelled the invoice.
- `cancelledOn` (string, optional, nullable) — The date and time when the invoice was cancelled, in `yyyy-mm-dd hh:mm:ss` format.
- `comment` (string, optional) — Comments about the invoice.
- `createdById` (string, optional) — The ID of the Zuora user who created the invoice.
- `createdDate` (string, optional) — 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` (double, optional) — **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, optional) — A currency defined in the web-based UI administrative settings.
- `discount` (double, optional) — The discount of the invoice.
- `dueDate` (date, optional) — The date by which the payment for this invoice is due.
- `id` (string, optional) — The unique ID of the invoice.
- `invoiceDate` (date, optional) — The date on which to generate the invoice.
- `number` (string, optional) — The unique identification number of the invoice.
- `postedById` (string, optional) — The ID of the Zuora user who posted the invoice.
- `postedOn` (string, optional) — The date and time when the invoice was posted, in `yyyy-mm-dd hh:mm:ss` format.
- `status` (enum, optional) — The status of the invoice. **Note:** * The `Split` status is applicable only when you use Split Invoice feature. * When an invoice is split, its status changes from `Draft` to `Split`, and the newly created invoices retain a reference to the original invoice.
  - Allowed values: `Draft`, `Posted`, `Canceled`, `Error`, `Split`
- `success` (boolean, optional) — Returns `true` if the request was processed successfully.
- `targetDate` (date, optional) — The target date for the invoice, in `yyyy-mm-dd` format. For example, 2017-07-20.
- `taxAmount` (double, optional) — The amount of taxation.
- `templateId` (string, optional) — The ID of the invoice template associated with the invoice.
- `totalTaxExemptAmount` (double, optional) — The calculated tax amount excluded due to the exemption.
- `transferredToAccounting` (enum, optional) — Whether the invoice was transferred to an external accounting system.
  - Allowed values: `Processing`, `Yes`, `No`, `Error`, `Ignore`
- `updatedById` (string, optional) — The ID of the Zuora user who last updated the invoice.
- `updatedDate` (string, optional) — 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, optional) — 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, optional) — 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, optional) — 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).

## Errors

### 500 Internal Server Error

Internal Server Error

- `reasons` (list of ErrorResponseReasonsItems, optional)

### 400 Client Request Error

Request Errors

- `processId` (string, optional) — The ID of the process that handles the operation.
- `reasons` (list of CommonResponseReasonsItems, optional) — The container of the error code and message. This field is available only if the `success` field is `false`.
- `requestId` (string, optional) — Unique identifier of the request.
- `success` (boolean, optional) — Indicates whether the call succeeded.

## Types

### PutInvoiceItemType

Container for custom fields of an Invoice Item object.

- `accountingCode` (string, optional) — The accounting code associated with the invoice item.
- `adjustmentLiabilityAccountingCode` (string, optional) — The accounting code for adjustment liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `adjustmentRevenueAccountingCode` (string, optional) — The accounting code for adjustment revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `amount` (double, optional) — 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, optional) — The booking reference of the invoice item. **Note**: This field is only available if `id` is null.
- `chargeDate` (string, optional) — The date when the invoice item is charged, in `yyyy-mm-dd hh:mm:ss` format.
- `chargeName` (string, optional) — 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, optional) — The accounting code for contract asset. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `contractLiabilityAccountingCode` (string, optional) — The accounting code for contract liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `contractRecognizedRevenueAccountingCode` (string, optional) — The accounting code for contract recognized revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `deferredRevenueAccountingCode` (string, optional) — 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, optional) — 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, optional) — The description of the invoice item.
- `discountItems` (list of PutDiscountItemType, optional) — Container for discount items. The maximum number of discount items is 10.
- `excludeItemBillingFromRevenueAccounting` (boolean, optional, default: false) — 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, optional) — 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, optional) — The type of the invoice item.
- `productRatePlanChargeId` (string, optional) — 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, optional) — The purchase order number associated the invoice item.
- `quantity` (string, optional) — The number of units for the invoice item.
- `recognizedRevenueAccountingCode` (string, optional) — 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, optional) — The revenue recognition code.
- `revRecTriggerCondition` (enum, optional) — The date when revenue recognition is triggered.
  - Allowed values: `ContractEffectiveDate`, `ServiceActivationDate`, `CustomerAcceptanceDate`
- `revenueRecognitionRuleName` (string, optional) — The name of the revenue recognition rule governing the revenue schedule. **Note:** This field is only available if you have Zuora Finance enabled.
- `serviceEndDate` (date, optional) — The service end date of the invoice item.
- `serviceStartDate` (date, optional) — The service start date of the invoice item.
- `sku` (string, optional) — The SKU of the invoice item. The SKU of the invoice item must be different from the SKU of any existing product.
- `taxCode` (string, optional) — 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` (enum, optional) — 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.
  - Allowed values: `TaxInclusive`, `TaxExclusive`
- `unbilledReceivablesAccountingCode` (string, optional) — The accounting code for unbilled receivables. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `unitPrice` (string, optional) — The per-unit price of the invoice item.
- `uom` (string, optional) — The unit of measure.
- `IntegrationId__NS` (string, optional) — 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, optional) — 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, optional) — 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).

### ErrorResponseReasonsItems

- `code` (string, optional) — The error code of response.
- `message` (string, optional) — The detail information of the error response

### CommonResponseReasonsItems

- `code` (string, optional) — The error code of response.
- `message` (string, optional) — The detail information of the error response

### PutDiscountItemType

Container for custom fields of an Discount Item object.

- `amount` (string, 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://knowledgecenter.zuora.com/Billing/Subscriptions/Product_Catalog/B_Charge_Models/B_Discount_Charge_Models#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.
- `accountingCode` (string, optional) — The accounting code associated with the discount item.
- `adjustmentLiabilityAccountingCode` (string, optional) — The accounting code for adjustment liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `adjustmentRevenueAccountingCode` (string, optional) — The accounting code for adjustment revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `bookingReference` (string, optional) — The booking reference of the discount item.
- `chargeDate` (string, optional) — The date when the discount item is charged, in `yyyy-mm-dd hh:mm:ss` format.
- `chargeName` (string, optional) — 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, optional) — The accounting code for contract asset. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `contractLiabilityAccountingCode` (string, optional) — The accounting code for contract liability. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `contractRecognizedRevenueAccountingCode` (string, optional) — The accounting code for contract recognized revenue. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `deferredRevenueAccountingCode` (string, optional) — 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, optional) — The description of the discount item.
- `id` (string, optional) — The unique ID of the discount item.
- `itemType` (string, optional) — The type of the discount item.
- `purchaseOrderNumber` (string, optional) — The purchase order number associated with the discount item.
- `recognizedRevenueAccountingCode` (string, optional) — 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, optional) — The revenue recognition code.
- `revRecTriggerCondition` (enum, optional) — The date when revenue recognition is triggered.
  - Allowed values: `ContractEffectiveDate`, `ServiceActivationDate`, `CustomerAcceptanceDate`
- `revenueRecognitionRuleName` (string, optional) — 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, optional) — The SKU of the invoice item. The SKU of the discount item must be different from the SKU of any existing product.
- `unbilledReceivablesAccountingCode` (string, optional) — The accounting code for unbilled receivables. **Note**: This field is only available if you have the Billing - Revenue Integration feature enabled.
- `unitPrice` (string, optional) — 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, optional) — 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, optional) — 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, optional) — 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).

## Examples

**Request**

```json
{
  "invoiceItems": [
    {
      "amount": 105,
      "id": "8ad084db909fae930190a121c87f5800"
    }
  ]
}
```

**Response**

```json
{
  "accountId": "8ad09be48db5aba7018db604776d4854",
  "amount": 105,
  "autoPay": false,
  "balance": 105,
  "cancelledById": null,
  "cancelledOn": null,
  "comment": null,
  "createdById": "b243314d594646d3b2651aeedd4be47e",
  "createdDate": "2024-07-11 02:31:04",
  "creditBalanceAdjustmentAmount": 0,
  "currency": "USD",
  "discount": 0,
  "dueDate": "2024-08-29",
  "id": "8ad084db909fae930190a121c84957ff",
  "invoiceDate": "2024-07-30",
  "number": "INV00000155",
  "postedById": null,
  "postedOn": null,
  "status": "Draft",
  "success": true,
  "targetDate": null,
  "taxAmount": 0,
  "totalTaxExemptAmount": 0,
  "transferredToAccounting": "Processing",
  "updatedById": "b243314d594646d3b2651aeedd4be47e",
  "updatedDate": "2024-07-11 02:43:45"
}
```

**SDK Code**

```python response
import requests

url = "https://rest.test.zuora.com/v1/invoices/invoiceKey"

payload = { "invoiceItems": [
        {
            "amount": 105,
            "id": "8ad084db909fae930190a121c87f5800"
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript response
const url = 'https://rest.test.zuora.com/v1/invoices/invoiceKey';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"invoiceItems":[{"amount":105,"id":"8ad084db909fae930190a121c87f5800"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go response
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/v1/invoices/invoiceKey"

	payload := strings.NewReader("{\n  \"invoiceItems\": [\n    {\n      \"amount\": 105,\n      \"id\": \"8ad084db909fae930190a121c87f5800\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby response
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/v1/invoices/invoiceKey")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"invoiceItems\": [\n    {\n      \"amount\": 105,\n      \"id\": \"8ad084db909fae930190a121c87f5800\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://rest.test.zuora.com/v1/invoices/invoiceKey")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"invoiceItems\": [\n    {\n      \"amount\": 105,\n      \"id\": \"8ad084db909fae930190a121c87f5800\"\n    }\n  ]\n}")
  .asString();
```

```php response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://rest.test.zuora.com/v1/invoices/invoiceKey', [
  'body' => '{
  "invoiceItems": [
    {
      "amount": 105,
      "id": "8ad084db909fae930190a121c87f5800"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp response
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/v1/invoices/invoiceKey");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"invoiceItems\": [\n    {\n      \"amount\": 105,\n      \"id\": \"8ad084db909fae930190a121c87f5800\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["invoiceItems": [
    [
      "amount": 105,
      "id": "8ad084db909fae930190a121c87f5800"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/v1/invoices/invoiceKey")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```