REST API v2.8

Examples

Get stock count for products in a warehouse

In this example we're getting the items from warehouse 1. Use the fields parameter to specify what to get and set num to a high value to get all products.

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehouseitems.json?fields=sku,decimaltotal,decimalreserved,decimalavailable&num=100000 { "totalcount": 14, "items": [ { "sku": "10038-3", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "10038-4", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "10038-1", "decimaltotal": "34.000", "decimalreserved": "0.000", "decimalavailable": "34.000" }, { "sku": "10038-5", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "10038-2", "decimaltotal": "7.000", "decimalreserved": "0.000", "decimalavailable": "7.000" }, { "sku": "83537-0", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "83428-0", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "83531-0", "decimaltotal": "5.000", "decimalreserved": "0.000", "decimalavailable": "5.000" }, { "sku": "44051-0", "decimaltotal": "4.000", "decimalreserved": "0.000", "decimalavailable": "4.000" }, { "sku": "44079-0", "decimaltotal": "8.000", "decimalreserved": "0.000", "decimalavailable": "8.000" }, { "sku": "83424-0", "decimaltotal": "4.000", "decimalreserved": "0.000", "decimalavailable": "4.000" }, { "sku": "54051-1", "decimaltotal": "81.000", "decimalreserved": "0.000", "decimalavailable": "81.000" }, { "sku": "54051-2", "decimaltotal": "82.000", "decimalreserved": "0.000", "decimalavailable": "82.000" }, { "sku": "54051-3", "decimaltotal": "76.000", "decimalreserved": "0.000", "decimalavailable": "76.000" } ] }

Register products to a warehouse

When new products arrive to the warehouse they should be registered in a transaction as ManualIn (ie transactiontype 10). A transaction is made by creating a batch, then adding items to the batch and then finally committing the batch.

Note! Don't use StockTaking (ie transactiontype 50) when registering new products. StockTaking doesn't use moneypricein, which makes the stock value invalid. StockTaking should only be used for Stock Taking.

Step 1 - Create the batch (of transactiontype ManualIn)

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches.json { "transactiontype": 10, "emailowner": "info@example.com", "comment": "Summer collection" } 3

Step 2 - Add products to the batch.

The warehousebatchid returned 3 which we use in the endpoint path. Note that we are sending all products in one request, which makes the response return an array with the same number of items.

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/3/warehousebatchitems.json [ { "sku": "10038-1", "decimalquantity": "9.000", "moneypricein": "125.00" }, { "sku": "10038-2", "decimalquantity": "2.000", "moneypricein": "135.00" }, { "sku": "10038-3", "decimalquantity": "1.000", "moneypricein": "145.00" } ] [ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true } ]

Step 3 - Commit the batch

At this final stage we're about to commit the batch and create a warehouse transaction from it.

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/3.json { "warehousebatchstate": 20 } true

Update price lists

This will update the price for the default pricelist. Add pricelistid (eg. ?pricelistid=2) as an argument to change price for another price list.

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/products.json [ { "productid": 12, "moneyprice": "990.00" }, { "productid": 13, "moneyprice": "1090.00" } ] [ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true } ]

Add a webshop booking

This examples adds a booking which can be processed and paid for in Sitoo POS. Note that the ordertypeid is 100 for booking). The return value is the orderid for the booking.

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/orders.json { "ordertypeid": 100, "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", "vatvalue": 25, "vouchervalue": 20, "ispercentage": false }, { "productname": "Sofa Stressless", "sku": "83537-0", "quantity": 1, "moneyrowprice": "106.00", "vatvalue": 6 } ] } 11515