On This Page
REST API
Send an Invoice
You can send an invoice in draft or created mode or resend a sent or partially paid invoice.
Fully paid or canceled invoices cannot be resent.
Use the following resource to send or resend an invoice:
- Test:PUThttps://apitest.cybersource.com/invoicing/v2/invoices/{id}/delivery
- Live:PUThttps://api.cybersource.com/invoicing/v2/invoices/{id}/delivery
- Live in India:PUT https://api.in.cybersource.com/invoicing/v2/invoices/{id}/delivery
For more details, see the Send an Invoice section of the interactive API
Reference.
All
Cybersource
APIs require API authentication. See
Getting Started with the REST API
for details. Request
To send an invoice, pass the invoice ID as a path parameter.
Request example:
POSThttps://apitest.cybersource.com/invoicing/v2/invoices/{id}/delivery
Response
If the request is successful, the API sends or resends the invoice and updates
submitTimeUtc
. The API also sets the invoice
status
depending on:- The invoice's current status
- The value you set for thedeliveryModefield when you created or last updated the invoice.
The following table details the invoice delivery actions and how the invoice status changes
after you send the invoice:
Invoice's Original Status | deliveryMode Value | After you make an invoices/{id}/delivery request |
---|---|---|
DRAFT | email | Emails the invoice to the customer and changes the invoice status to
SENT |
DRAFT | none | Does not email the invoice and changes the status to CREATED .
You can view the invoice at the URL returned in the
invoiceInformation.paymentLink response field. You can choose to
provide your customers with this direct link to the invoice. |
CREATED | email | Emails the invoice to the customer and changes the invoice status to
SENT |
SENT | email | Resends the invoice to the customer and the invoice status remains
SENT |
PARTIAL | email | Emails the invoice to the customer and the invoice status remains
PARTIAL |
The response also includes the invoice details,
_links
and
_supportedActions
. - Link:To get the invoice details again, use theselflink path:https://apitest.cybersource.com/v2/invoices/A123456
- Supported actions:
- Send: Use thedeliveryaction to send a draft or created invoice or to resend a sent or partially paid invoice. Paid or canceled invoices cannot be resent at this time. See Send an Invoice for details.
- Cancellation: Use thecancelationaction to cancel an invoice. See Cancel an Invoice for details.
- Update: Use thePUTHTTP method to update an invoice as long as no payment has been made on the invoice. See Update an Invoice for details.
Response example:
{ "_links": { "self": { "href": "/invoicing/v2/invoices/A123456", "method": "GET" } }, "_supportedActions": [{ "href": "/invoicing/v2/invoices/A123456/delivery", "method": "POST" }, { "href": "/invoicing/v2/invoices/A123456/cancelation", "method": "POST" }, { "href": "/invoicing/v2/invoices/A123456", "method": "PUT" }], "id": "A123456","submitTimeUtc": "2020-02-11T06:32:06Z","status": "SENT", "customerInformation": { "name": "Tanya Lee", "email": "tanya.lee@my-email.world" }, "invoiceInformation": { "invoiceNumber": "A123456", "description": "This is a test invoice", "dueDate": "2019-07-11", "paymentLink": "https://businesscenter.cybersource.com/invoicing/payInvoice/ c7UI9Vz8rdhXbc8FdK6SaoeOATON4TQLhbd5lfib9UCyywvZLhIrSuYYNFMynMDd" }, "orderInformation": { "amountDetails": { "totalAmount": "2623.64", "currency": "USD", "balanceAmount": "2623.64", "discountAmount": "126.08", "discountPercent": "5", "subAmount": "2749.72", "taxDetails": { "type": "State Tax", "amount": "208.04", "rate": "8.25" }, "freight": { "amount": "20.00", "taxable": "true" } }, "lineItems": [{ "productSku": "P653727383", "productName": "First line item's name", "quantity": "21", "unitPrice": "120.08" }] }