Lines

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

Lines don’t have their own GET actions, since they’re included in their entirety when you get orders.

Add a line to an order

POST /v1/companies/5678/orders/93824701/lines Add a new line to an order
  • Only the product_id field is required.
  • 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.

The URI returned in the Location header can only be used to update or remove the line, as GET is not allowed on lines.


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