Lines

Lines (also called order lines, sale lines or line items) describe the products included in an order.

Get all lines in an order

GET /v1/companies/5678/orders/93824701/lines Get all lines in an order

Adding lines to an order

POST /v1/companies/5678/orders/93824701/lines Adding new lines to an order
  • One or more lines can be added in a single request.
  • Only the product_id field is required.
  • Lines can include option_sets to specify option sets for the product. Each option set contains an option_set_id and an array of options.
  • Only either modifiers or option_sets may be specified on a line, not both.
  • unit_price should only be specified if you want to override the default site pricing of the product. It should be specified as an ex tax price, and the current taxes that are set for that product will then be applied.
  • unit_price_inc_tax can also be specified if you want to override the default site pricing of the product. It should be specified as price inclusive of tax. It will only be applied if unit_price is not specified
  • Use price_variation for percentage based discounts and surcharges. The value works as a coefficient of the line's subtotal. For example, 0.9 means a 10% discount, and 1.15 means a 15% surcharge.
  • Use price_fixed_variation for fixed currency based discounts and surcharges. For example, -2.00 means a $2.00 discount, and 1.15 means a $1.15 surcharge.
  • price_variation and price_fixed_variation cannot both be specified on the same line.
  • price_variation and price_fixed_variation cannot be specified on lines with option_sets.

Add a line with product availability

  • If the line item has invalid product availability and the order status is either ON_HOLD, PENDING, or COMPLETE, the request will be rejected with HTTP 400 and the following response: "error_description": "Product (199547) is out of stock."

Update a line

Before an order is accepted, you can update lines.

PUT /v1/companies/5678/orders/93824701/lines/1 Update a line
  • If you supply a modifiers array, all previously added modifiers will be overwritten. You should treat this array as a discreet value to be overwritten.
  • unit_price should only be specified if you want to override the default site pricing of the product. It should be specified as an ex tax price, and the current taxes that are set for that product will then be applied.
  • unit_price_inc_tax can also be specified if you want to override the default site pricing of the product. It should be specified as price inclusive of tax. It will only be applied if unit_price is not specified

Update a line with product availability

  • If the line item has invalid product availability and the order status is either ON_HOLD, PENDING, or COMPLETE, the request will be rejected with HTTP 400 and the following response: "error_description": "Product (199547) is out of stock."

Delete a line

DELETE /v1/companies/5678/orders/93824701/lines/1 Delete a line