post
https://{store}/api/rest/sales2/orders/bill
This endpoint creates an Invoice.
It can also create a Shipment for the invoiced Items.
Required Top-Level Parameters
Each of the following five (5) Parameters must be included in the correct order to properly make this API call.
If you are not sending data for one of these five (5) parameters, it should be included in the call with null value.
{
"orderIncrementId": "100000024",
"itemsQty": { "106537": 15 },
"comment": null,
"shipmentData": null,
"extraData": { "send_email": 0, "due_date": "2023-09-19" }
}
| Param | Notes |
|---|---|
orderIncrementId | The increment ID of the order to create the invoice for. |
itemsQty | Array of objects. Object key is itemId and the value is qty. (ex. [{ "311": "2" }] Would bill 2 of order item 311) The Order Item ID that is used will always be the Parent ID in the event of a Configurable/Grouped/Bundled product. |
Packaged Items will use their packaged qty. So if 2 cases of 15 were ordered. The ordered_qty will be 30 but the qty entered would be 2. This can be ignored by using the ignore_qty_multiplier flag in extraData. | |
comment | Message to send to create on invoice for customer to see. (Optional) |
shipmentData | Used when shipping at the same time as invoicing. Array of ShipmentData OR true. When set to true it will ship all items/quantities that are being invoiced. |
extraData | Used to set custom totals. Uses ExtraData |
ShipmentData
| Param | Notes |
|---|---|
ship_items | Object key is itemId and the value is qty. (ex. { "311": "2", "312": "1" } Would ship 2 of order item 311 and 1 of order item 312) The Order Item ID that is used will always be the Parent ID in the event of a Configurable/Grouped/Bundled product. (Optional, will use all items/quantities that are being invoiced if not provided.) |
ship_immediately | (Boolean) If set to true then the shipment will be created at the time of the request. If set to false it will configure the shipment to be created when the bill is paid and the invoice is created. (Default: false) |
tracking | Array of TrackingData |
send_email | Accepts a value of 0 or 1. Will send email for new shipment if set to 1. Defaults to 1. |
TrackingData
| Param | Notes |
|---|---|
carrier_code | Code for the shipment carrier used for tracking. A list is available using the Get Carriers method. |
number | Tracking Number |
title | Tracking Carrier title |
ExtraData
| Param | Notes |
|---|---|
totals_info | Object used to set custom totals for invoice. Array of ExtraDataTotal |
ignore_qty_multiplier | This is used to allow the qty_ordered to be directly entered instead of the packaged qty for items that use packaging. |
due_date | This is used to set the due date on the invoice. Do not set this value if setting net terms and the due date should be set automatically. Vaue should be in the format yyyy-MM-dd HH:mm:ss. Time is optional. |
netterm.term | Invoice terms |
netterm.detail | Invoice terms detail |
netterm.xy_days | Invoice Net XY terms days |
netterm.xy_discount_days | Invoice Net XY terms discount days |
netterm.xy_discount_amount | Invoice Net XY terms discount amount in base currency without currency symbol |
netterm.xy_discount_calculation_total | Invoice Net XY terms discount calculation total. Can be default, subtotal, grand_total |
netterm.xy_late_fee | Invoice Net XY terms late fee amount in base currency without currency symbol |
netterm.xy_late_fee_calculation_total | Invoice Net XY terms late fee calculation total. Can be default, subtotal, grand_total |
send_email | Accepts a value of 0 or 1. Will send email for new invoice if set to 1. Defaults to 1. |
comment | Object used for comment config. Setting this value will prevent the comment from immediately adding to the Order Status History and instead will be added as a comment on the invoice itself. CommentConfig |
ExtraDataTotal
| Param | Notes |
|---|---|
code | Total being updated. (shipping, discount, payment_surcharge, tax) |
base_raw_value | Value to set the total to. (number) |
CommentConfig
| Param | Notes |
|---|---|
is_visible_on_front | Accepts a value of 0 of 1. If set to 1 the comment will be visible to the customer in both the email and the My Account section. |
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
