FILTER BY TAG

Update an Invoice

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

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.lineItems[].productSku

Optional Fields for Updating an Invoice

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.
Set to your partner solution ID (PSID).
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.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

Example: Updating an Invoice

Endpoint to Update an Invoice
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
{ "_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
{ "_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

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.