Order Model
The Order model represents an order placed with your shop. Orders consist of OrderItems, which are the Products that are attached to the order. An order can have a Customer attached to it, but this is not required. And order must have a DeliveryMode attached to it to select the method of shipment. The payment attributes are provided for the customer to indicate to the shop when and how payment was made so the shop can verify payment. If payment was received through an online payment system, the shop may store that information in the order if they want.
RESTful Calls
Get All Orders
GET/orders
Get all Orders associated with your account. Note, your account may contain many orders, and retrieving all of them in one call puts an excessive load on the server, as well as requiring a long time to reply. This will typically result in your request timing out. Thus, is it recommended that you use the 'offset' and 'count' parameters to <em>paginate</em> getting all orders. Setup a loop and start with offset 0, and a count that is reasonable (e.g. 20), then increment offset by count for each loop iteration. This request will return only <em>undeleted</em> orders. If you want to rerieve deleted orders as well, setup the <em>deleted</em> parameter.
Request Parameters
This request has no parameters.
Response
Get Order
GET/orders/{id}
Get an order by it's ID.
Request Parameters
Response
Get Order Items
GET/orders/{id}/orderitems
Get all order items for an order specified by id.
Request Parameters
Response
Create Order
POST/orders
Create a new order with the specified order items, delivery mode, and possible customer.
Request Parameters
- product_id - integer
- product_sku - string
- shop_sku - string
Response
Update Order
PATCH/orders/{order_id}
Update an existing order with the specified order items, delivery mode, and possible customer. Only the parameters specified will be updated. If order items are provided, those matching existing attached order items will update only the price and/or quantity. Order items not matching existing attached order items will attach new order items to the order.
Request Parameters
- product_id - integer
- product_sku - string
- shop_sku - string
Response
Delete Order
DELETE/orders/{order_id}
Delete an existing order.
Request Parameters
This request has no parameters.