On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/invoicing/developer/all/rest/invoicing/invoicing-services-intro/invoicing-services-update-intro.md)  
Filter  
FILTER BY TAG

Update an Invoice {#invoicing-services-update-intro}
====================================================

You can update an invoice if no payment has been made. Include all of the fields that were contained in the original request message in the update request. If you do not include a field that was in the original request message, the field information associated with it will be removed in the updated invoice.  
If you update the customer's email in the customerInformation.email request field, the generated redirect URL in the invoiceInformation.paymentLink response field changes and the previous URL becomes invalid. You can either share the new redirect URL with the customer, or resend the updated invoice using the send invoice request. For more information about how to resend an invoice, see [Send an Invoice](/docs/cybs/en-us/invoicing/developer/all/rest/invoicing/invoicing-services-intro/invoicing-services-send-intro.md "").

Itemized Invoices
:
An invoice can display a single billed amount or list up to 30 billed items. To list the billed items in the invoice, include the items in the request using the line item array fields. An invoice with line items is known as an *itemized* invoice. For more information about how to include line items in your request, see [Including Line Items in an Invoice](/docs/cybs/en-us/invoicing/developer/all/rest/invoicing/invoicing-services-intro/invoicing-services-line-items.md "").

**Installment Payments**
:
Invoices can be paid in installment payments when these fields and values are included in the request. If an invoice is payable in installments, multiple customers can make payments towards the same invoice.

    invoiceInformation.allowPartialPayments
    :
        Set to `true`.


    orderInformation.amountDetails.minimumPartialAmount
    :
        Set to the minimum amount allowed for a partial payment.

**Partner Information**
:
If your merchant account is associated with a `Cybersource` partner, you can include your partner solution ID (PSID) in the request message for tracking and reporting purposes. To include your PSID, use the clientReferenceInformation.partner.solutionId request field and set its field value to your PSID.

Endpoints
---------

Send your API request message to one of these endpoints:  
**Test:** `PUT ``https://apitest.cybersource.com``/invoicing/v2/invoices/`*{id}*  
**Production:** `PUT ``https://api.cybersource.com``/invoicing/v2/invoices/`*{id}*  
**India Production:** `PUT https://api.in.cybersource.com/invoicing/v2/invoices/`*{id}*  
The *`{id}`* is the invoice number from the response to the create invoice request.

Required Fields for Updating an Invoice {#invoicing-services-update-req-fields}
===============================================================================

Include these fields and any additional fields contained in the original request to create the invoice.

invoiceInformation.description
:
This field becomes optional if the line item fields are present in the request message.

invoiceInformation.dueDate
:

[orderInformation.amountDetails.currency](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-currency.md "")
:

[orderInformation.amountDetails.totalAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-total-amount.md "")
:

orderInformation.lineItems\[\].productSku
:

Optional Fields for Updating an Invoice {#invoicing-services-update-opt-fields}
===============================================================================

Include all of the fields contained in the original request. If you do not include a field that was in the original request, the field information associated with it is removed in the updated invoice.

[clientReferenceInformation.partner.solutionId](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-partner-solution-id.md "")
:
Set to your partner solution ID (PSID).

[clientReferenceInformation.partner.developerId](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-partner-developer-id.md "")
:
Set to your developer ID.

customerInformation.company.name
:

customerInformation.email
:

customerInformation.merchantCustomerId
:

customerInformation.name
:

invoiceInformation.allowPartialPayments
:

invoiceInformation.deliveryMode
:

invoiceInformation.description
:
This field is optional when either of these conditions is met:

    * The invoiceInformation.deliveryMode request field is set to `email`.
    * The line item fields are present in the request message.

invoiceInformation.invoiceNumber
:
Set to a unique number to create an invoice number.

    If you do not include this field and a unique value, the invoicing API automatically generates an invoice number for the new invoice.

    > IMPORTANT You cannot update this invoice number after sending the API request.

invoiceInformation.sendImmediately
:

[orderInformation.amountDetails.discountAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-discount-amount.md "")
:

orderInformation.amountDetails.discountPercent
:

orderInformation.amountDetails.freight.amount
:

orderInformation.amountDetails.freight.taxable
:

orderInformation.amountDetails.freight.taxRate
:

orderInformation.amountDetails.minimumPartialAmount
:

orderInformation.amountDetails.subAmount
:

orderInformation.amountDetails.taxDetails.amount
:

orderInformation.amountDetails.taxDetails.rate
:

orderInformation.amountDetails.taxDetails.type
:

[orderInformation.lineItems\[\].discountAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-discount-amount.md "")
:

orderInformation.lineItems\[\].discountRate
:

[orderInformation.lineItems\[\].taxAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-tax-amount-request.md "")
:

[orderInformation.lineItems\[\].taxRate](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-tax-rate.md "")
:

[orderInformation.lineItems\[\].productName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-product-name.md "")
:

orderInformation.lineItems\[\].productSku
:

[orderInformation.lineItems\[\].quantity](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-quantity.md "")
:

[orderInformation.lineItems\[\].totalAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-total-amount.md "")
:

[orderInformation.lineItems\[\].unitPrice](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-line-items-unit-price.md "")
:

Example: Updating an Invoice {#invoicing-services-update-ex-rest}
=================================================================

Endpoint to Update an Invoice

```keyword
https://api.cybersource.com/invoicing/v2/invoices/98761
```

Request

```
{
  "customerInformation": {
    "name": "Tanya Lee",
    "email": "tanya.lee@my-email.world"
  },
  "invoiceInformation": {
    "dueDate": "2019-07-15"
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "2623.64",
      "currency": "USD"
    },
    "lineItems": [
      {
        "productSku": "P653727383",
        "productName": "First line item's name",
        "quantity": "20",
        "unitPrice": "12.05",
        "totalAmount": "247.86"
      }
    ]
  }
}
```

Response to a Successful Request

```keyword
{
  "_links": {
    "self": {
      "href": "/v2/invoices/2670",
      "method": "GET"
    },
    "update": {
      "href": "/v2/invoices/2670",
      "method": "PUT"
    },
    "deliver": {
      "href": "/v2/invoices/2670/delivery",
      "method": "POST"
    },
    "cancel": {
      "href": "/v2/invoices/2670/cancelation",
      "method": "POST"
    }
  },
  "id": "2670",
  "submitTimeUtc": "2024-07-24T19:40:37.289869220Z",
  "status": "SENT",
  "customerInformation": {
    "name": "Tanya Lee",
    "email": "tanya.lee@my-email.world"
  },
  "processingInformation": {
    "requestPhone": false,
    "requestShipping": false
  },
  "invoiceInformation": {
    "invoiceNumber": "2670",
    "dueDate": "2019-07-15",
    "allowPartialPayments": false,
    "paymentLink": "https://businesscenter.cybersource.com/ebc2/invoicing/payInvoice/W447tdnINi5t5wu6QA0KUE2HYWY2rQQ0zXL5b5z6M50w4Ea9FFlcYrEmp09pFlzl?version=v2.1",
    "deliveryMode": "Email"
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": 2623.64,
      "currency": "USD",
      "balanceAmount": 2623.64
    },
    "lineItems": [
      {
        "productSku": "P653727383",
        "productName": "First line item's name",
        "unitPrice": 12.05,
        "quantity": 20,
        "totalAmount": 247.86
      }
    ]
  }
}
```

Request with Optional Fields

```
{
  "customerInformation": {
    "name": "Tanya Lee",
    "email": "tanya.lee@my-email.world",
    "merchantCustomerId": "1234",
    "company": {
      "name": "ABC"
    }
  },
  "invoiceInformation": {
    "description": "This is an updated test invoice",
    "dueDate": "2019-07-15",
    "allowPartialPayments": true,
    "deliveryMode": "none"
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "2623.64",
      "currency": "USD",
      "discountAmount": "126.08",
      "discountPercent": 5,
      "subAmount": 2749.72,
      "minimumPartialAmount": 200,
      "taxDetails": {
        "type": "State Tax",
        "amount": "208.00",
        "rate": "8.25"
      },
      "freight": {
        "amount": "20.00",
        "taxable": true,
        "taxRate": "0.01"
      }
    },
    "lineItems": [
      {
        "productSku": "P653727383",
        "productName": "First line item's name",
        "quantity": "20",
        "unitPrice": "12.05",
        "discountAmount": "13.04",
        "discountRate": "0.0",
        "taxAmount": "0.0",
        "taxRate": "0.0",
        "totalAmount": "247.86"
      }
    ]
  }
}
```

Response to a Successful Request with Optional Fields

```keyword
{
  "_links": {
    "self": {
      "href": "/v2/invoices/2670",
      "method": "GET"
    },
    "update": {
      "href": "/v2/invoices/2670",
      "method": "PUT"
    },
    "deliver": {
      "href": "/v2/invoices/2670/delivery",
      "method": "POST"
    },
    "cancel": {
      "href": "/v2/invoices/2670/cancelation",
      "method": "POST"
    }
  },
  "id": "2670",
  "submitTimeUtc": "2024-07-24T19:46:18.914132825Z",
  "status": "SENT",
  "customerInformation": {
    "name": "Tanya Lee",
    "email": "tanya.lee@my-email.world",
    "merchantCustomerId": "1234",
    "company": {
      "name": "ABC"
    }
  },
  "processingInformation": {
    "requestPhone": false,
    "requestShipping": false
  },
  "invoiceInformation": {
    "invoiceNumber": "2670",
    "description": "This is an updated test invoice",
    "dueDate": "2019-07-15",
    "allowPartialPayments": true,
    "paymentLink": "https://businesscenter.cybersource.com/ebc2/invoicing/payInvoice/W447tdnINi5t5wu6QA0KUE2HYWY2rQQ0zXL5b5z6M50w4Ea9FFlcYrEmp09pFlzl?version=v2.1",
    "deliveryMode": "None"
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": 2623.64,
      "currency": "USD",
      "balanceAmount": 2623.64,
      "discountAmount": 126.08,
      "discountPercent": 5,
      "subAmount": 2749.72,
      "minimumPartialAmount": 200,
      "taxDetails": {
        "type": "State Tax",
        "amount": 208,
        "rate": 8.25
      },
      "freight": {
        "amount": 20,
        "taxable": true,
        "taxRate": 0.01
      }
    },
    "lineItems": [
      {
        "productSku": "P653727383",
        "productName": "First line item's name",
        "unitPrice": 12.05,
        "quantity": 20,
        "discountAmount": 13.04,
        "taxAmount": 0,
        "taxRate": 0,
        "totalAmount": 247.86
      }
    ]
  }
}
```

REST Interactive Example: Update an Invoice {#invoicing-services-update-ex-live}
================================================================================

Click this image to access the interactive code example for updating an invoice.

#### Figure:

Interactive Code [![Image and link to the interactive code example for creating a new
invoice.](/content/dam/documentation/cybs/en-us/topics/payments-processing/payment-services/invoicing/images/invoicing-services-create.png/jcr:content/renditions/original)](https://developer.cybersource.com/api-reference-assets/index.md#invoicing_invoices_update-an-invoice "")  
RELATED TO THIS PAGE

* [Getting Started with REST](https://developer.cybersource.com/docs/cybs/en-us/platform/developer/all/rest/rest-getting-started/restgs-intro.md)
* [Response Codes](https://developer.cybersource.com/api/reference/response-codes.md)
* [API Field Reference Guide](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/rest-api-fields-intro.md)
* [API Reference Sandbox](https://developer.cybersource.com/api-reference-assets/index.md#static-home-section)
* [Business Center Test](https://businesscentertest.cybersource.com/ebc2/)
* [Business Center Production](https://businesscenter.cybersource.com/ebc2/)
* [Customer Support](https://support.visaacceptance.com/)

