REST API v2.8

Orders

Collection of orders for a site.

Get Orders

Note that if you want to get order items for an order you need to query a single order.

Endpoint

GET sites/{siteid}/orders

Parameters

orderidfrom

Filter on orders with orderid higher than or equal to the value provided

orderidto

Filter on orders with orderid lower than the value provided

orderdatefrom

Filter on orders with orderdate starting from the timestamp provided

orderdateto

Filter on orders with orderdate ending with the timestamp provided

orderstate

Filter on orderstate. ValueDescription0Open10Closed20Cancelled-1Abandoned

paymentstate

Filter on paymentstate. ValueDescription0None10Pending15Reserved20Successful30Cancelled40Failed

ordertype

Filter on ordertype. ValueDescription10Order100Booking110POSParked

email

Filter on customer email address.

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

sort

Sort the result. Possible values:
orderid-orderidDefault: -orderid

fields

Comma separated list of fields to return. Use this to query only the fields you are using.
Default fields:
orderidemailnamefirstnamelastcompanymoneyfinal_netmoneyfinal_vatmoneytotal_gross_roundoffmoneytotal_gross_allcheckouttypenamedeliverytypenameorderdateorderstateidpaymentstateidordertypeidregisteridwarehouseiddatereservedorderitemspayments

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type order.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/orders.json?num=2

Response

{ "totalcount": 1514, "items": [ { "orderid": 11513, "email": "", "namefirst": "", "namelast": "", "company": "", "moneyfinal_net": "14.15", "moneyfinal_vat": "0.85", "moneytotal_gross_roundoff": "0.00", "moneytotal_gross_all": "15.00", "checkouttypename": "Sitoo POS - Other", "deliverytypename": "", "orderdate": 1463041119, "orderstateid": 10, "paymentstateid": 20, "ordertypeid": 10, "registerid": "{3CCB9848-155A-49E1-7CA8-5F7F78FC3067}", "warehouseid": 1, "datereserved": null, "orderitems": [ { "orderitemid": 0, "orderitemtype": 10, "productid": 24, "productname": "Cookbook", "sku": "121292-4", "productattributes": "", "externalinput": "", "externalinputtitle": "", "unitlabel": "", "quantity": 1, "decimalunitquantity": null, "moneynetpriceperunit": "14.15", "moneypriceorg": "0.00", "vatvalue": 6, "deliveryinfo": "", "moneyitemtotal_net": "14.15", "moneyitemtotal_vat": "0.85", "voucherid": 0, "vouchercode": "", "vouchername": "", "moneyoriginalprice": "14.15", "moneydiscountedprice": "0.00", "moneydiscount": "0.00", "salestaxes": [], "decimalquantitytotal": "1.000", "moneynetpriceperquantity": "14.15" } ], "payments": [] }, { "orderid": 11512, "email": "", "namefirst": "", "namelast": "", "company": "", "moneyfinal_net": "-2392.00", "moneyfinal_vat": "-598.00", "moneytotal_gross_roundoff": "0.00", "moneytotal_gross_all": "-2990.00", "checkouttypename": "Sitoo POS - Other, Card", "deliverytypename": "", "orderdate": 1463041119, "orderstateid": 10, "paymentstateid": 20, "ordertypeid": 10, "registerid": "{3CCB9848-155A-49E1-7CA8-5F7F78FC3067}", "warehouseid": 1, "datereserved": null, "orderitems": [ { "orderitemid": 0, "orderitemtype": 10, "productid": 19, "productname": "Coffee Table", "sku": "44079-0", "productattributes": "", "externalinput": "", "externalinputtitle": "", "unitlabel": "", "quantity": -1, "decimalunitquantity": null, "moneynetpriceperunit": "2392.00", "moneypriceorg": "0.00", "vatvalue": 25, "deliveryinfo": "", "moneyitemtotal_net": "-2392.00", "moneyitemtotal_vat": "-598.00", "voucherid": 0, "vouchercode": "", "vouchername": "", "moneyoriginalprice": "2392.00", "moneydiscountedprice": "0.00", "moneydiscount": "0.00", "salestaxes": [], "decimalquantitytotal": "-1.000", "moneynetpriceperquantity": "2392.00" } ], "payments": [] } ] }

Add Order

Note! You can't delete an order, set orderstate to cancelled instead.

Endpoint

POST sites/{siteid}/orders

Request body

See order for fields.
Required fields:
ordertypeidorderitems
Order item required fields:
productnamequantity

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns orderid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/orders.json { "ordertypeid": 10, "namefirst": "John", "namelast": "Smith", "company": "Company Inc", "phone": "555-1451", "email": "john.smith@example.com", "orderitems": [ { "productname": "Sofa Cosy", "sku": "10038-2", "quantity": 1, "moneyrowprice": "125.00", "vatvalue": 25 }, { "productname": "Sofa Cosy", "sku": "83428-0", "quantity": 2, "moneyrowprice": "250.00", "moneyrowdiscount": "50.00", "vatvalue": 25 }, { "productname": "Sofa Stressless", "sku": "83537-0", "quantity": 1, "moneyrowprice": "106.00", "vatvalue": 6 } ] }

Response

11514

Get Order

Endpoint

GET sites/{siteid}/orders/{orderid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type order.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/orders/11514.json

Response

{ "orderid": 11514, "creditorderid": null, "checkouttypeid": 0, "deliverytypeid": 0, "email": "john.smith@example.com", "namefirst": "John", "namelast": "Smith", "personalid": "", "company": "Company Inc", "phone": "555-1451", "invoice_address": "", "invoice_address2": "", "invoice_zip": "", "invoice_city": "", "invoice_state": "", "invoice_countryid": "", "delivery_address": "", "delivery_address2": "", "delivery_zip": "", "delivery_city": "", "delivery_state": "", "delivery_countryid": "", "comment": "", "commentinternal": "", "customerref": "", "checkoutref": "", "moneytotal_net": "360.00", "moneytotal_vat": "71.00", "moneycheckout_net": "0.00", "moneycheckout_vat": "0.00", "moneytotal_gross_checkout": "0.00", "moneydelivery_net": "0.00", "moneydelivery_vat": "0.00", "moneytotal_gross_delivery": "0.00", "moneyfinal_net": "360.00", "moneyfinal_vat": "71.00", "moneyfinal_salestax": "0.00", "moneytotal_gross_roundoff": "0.00", "moneytotal_gross_all": "431.00", "checkouttypename": "", "checkoutmethodid": 0, "checkoutmethodsubid": 0, "deliverytypename": "", "orderdate": 1543832750, "orderstateid": 0, "paymentstateid": 0, "ordertypeid": 10, "userid_staff": null, "registerid": null, "warehouseid": null, "datereserved": null, "orderitems": [ { "orderitemid": 0, "orderitemtype": 10, "productid": 14, "productname": "Sofa Cosy", "sku": "10038-2", "productattributes": "", "externalinput": "", "externalinputtitle": "", "unitlabel": "", "quantity": 1, "decimalunitquantity": null, "moneynetpriceperunit": "100.00", "moneypriceorg": "0.00", "vatvalue": 25, "deliveryinfo": "", "moneyitemtotal_net": "100.00", "moneyitemtotal_vat": "25.00", "voucherid": 0, "vouchercode": "", "vouchername": "", "moneyoriginalprice": "100.00", "moneydiscountedprice": "0.00", "moneydiscount": "0.00", "salestaxes": [], "decimalquantitytotal": "1.000", "moneynetpriceperquantity": "100.00" }, { "orderitemid": 1, "orderitemtype": 10, "productid": 16, "productname": "Sofa Cosy", "sku": "83428-0", "productattributes": "", "externalinput": "", "externalinputtitle": "", "unitlabel": "", "quantity": 2, "decimalunitquantity": null, "moneynetpriceperunit": "80.00", "moneypriceorg": "0.00", "vatvalue": 25, "deliveryinfo": "", "moneyitemtotal_net": "160.00", "moneyitemtotal_vat": "40.00", "voucherid": 0, "vouchercode": "", "vouchername": "", "moneyoriginalprice": "100.00", "moneydiscountedprice": "80.00", "moneydiscount": "20.00", "salestaxes": [], "decimalquantitytotal": "2.000", "moneynetpriceperquantity": "80.00" }, { "orderitemid": 2, "orderitemtype": 10, "productid": 15, "productname": "Sofa Stressless", "sku": "83537-0", "productattributes": "", "externalinput": "", "externalinputtitle": "", "unitlabel": "", "quantity": 1, "decimalunitquantity": null, "moneynetpriceperunit": "100.00", "moneypriceorg": "0.00", "vatvalue": 6, "deliveryinfo": "", "moneyitemtotal_net": "100.00", "moneyitemtotal_vat": "6.00", "voucherid": 0, "vouchercode": "", "vouchername": "", "moneyoriginalprice": "100.00", "moneydiscountedprice": "0.00", "moneydiscount": "0.00", "salestaxes": [], "decimalquantitytotal": "1.000", "moneynetpriceperquantity": "100.00" } ], "payments": [] }

Update Order

Endpoint

PUT sites/{siteid}/orders/{orderid}

Request body

See order for fields.

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns true if successful.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/orders/11514.json { "namefirst": "Adam", "namelast": "Smith" }

Response

true

Get Order Deliveries

See orderdelivery for fields.

Endpoint

GET sites/{siteid}/orders/{orderid}/orderdeliveries

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type orderdelivery for an order.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/orders/11511/orderdeliveries.json

Response

{ "totalcount": 1, "items": [ { "orderdeliveryid": 10, "orderid": 11511, "warehouseid": 1, "orderdeliveryref": "", "datedelivery": 1463041059, "datecancelled": null, "pluginname": "", "orderdeliveryitems": [ { "orderdeliveryitemid": 14, "orderdeliveryid": 10, "orderitemid": 0, "quantity": 2 }, { "orderdeliveryitemid": 15, "orderdeliveryid": 10, "orderitemid": 1, "quantity": 1 } ] } ] }

Get Order Delivery

See orderdelivery for fields.

Endpoint

GET sites/{siteid}/orders/{orderid}/orderdeliveries/{orderdeliveryid}

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an item of type orderdelivery.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/orders/11511/orderdeliveries.json

Response

{ "totalcount": 1, "items": [ { "orderdeliveryid": 10, "orderid": 11511, "warehouseid": 1, "orderdeliveryref": "", "datedelivery": 1463041059, "datecancelled": null, "pluginname": "", "orderdeliveryitems": [ { "orderdeliveryitemid": 14, "orderdeliveryid": 10, "orderitemid": 0, "quantity": 2 }, { "orderdeliveryitemid": 15, "orderdeliveryid": 10, "orderitemid": 1, "quantity": 1 } ] } ] }

Get Order Log Items

Endpoint

GET sites/{siteid}/orders/{orderid}/orderlogitems

HTTP Response Status

200

OK. Returns data (see below).

400

Bad Request. Invalid syntax, missing required argument or invalid request.

401

Unauthorized. Authorization failed.

404

Resource not found. The url is invalid.

429

Too Many Requests.

500

Internal Server Error.

Returns

Returns an envelope with items of type orderlogitem for an order.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/orders/11511/orderlogitems.json

Response

{ "totalcount": 4, "items": [ { "datelog": 1463041059, "orderid": 11511, "orderlogtypeid": 0, "strvalue": null, "fvalue": null }, { "datelog": 1463041059, "orderid": 11511, "orderlogtypeid": 999, "strvalue": "Kassa 1 (SII0000001500001)\nKvitto #10009\nStaff", "fvalue": null }, { "datelog": 1463041059, "orderid": 11511, "orderlogtypeid": 70, "strvalue": null, "fvalue": 10 }, { "datelog": 1463041059, "orderid": 11511, "orderlogtypeid": 21, "strvalue": "Staff ", "fvalue": null } ] }