REST API v2.17

Warehouse Batches

Handle warehouses batches used to create transactions on a warehouse.

Get Warehouse Batches

Endpoint

GET sites/{siteid}/warehouses/{warehouseid}/warehousebatches

Parameters

transactiontype

Filter on the type of transaction. ValueDescription10ManualIn20ManualOut30Sales40Refund50StockTaking

warehousebatchstate

Filter on the state of the warehousebatch. ValueDescription10Open20Closed30CancelledDefault: 10

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in warehousebatch.

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 warehousebatch for a warehouse.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches.json

Response

{ "totalcount": 1, "items": [ { "warehousebatchid": 1, "warehouseid": 1, "warehousetransactionid": null, "transactiontype": 10, "datecreated": 1463124692, "warehousebatchstate": 10, "emailowner": "", "comment": "", "shipmentid": null, "externalid": null, "reasoncode": null } ] }

Add Warehouse Batch

Endpoint

POST sites/{siteid}/warehouses/{warehouseid}/warehousebatches

Request body

See warehousebatch for fields.
Required fields:
transactiontype

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 warehousebatchid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches.json { "transactiontype": 50, "emailowner": "info@example.com", "comment": "New Stocktaking" }

Response

2

Get Warehouse Batch

Endpoint

GET sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}

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 warehousebatch.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/2.json

Response

{ "warehousebatchid": 2, "warehouseid": 1, "warehousetransactionid": null, "transactiontype": 50, "datecreated": 1550669775, "warehousebatchstate": 10, "emailowner": "info@example.com", "comment": "New Stocktaking", "shipmentid": null, "externalid": null, "reasoncode": null }

Get Warehouse Batch Items

Endpoint

GET sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems

Parameters

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in warehousebatchitem.

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 warehousebatchitem for a warehousebatch.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/1/warehousebatchitems.json

Response

{ "totalcount": 2, "items": [ { "warehousebatchitemid": 1, "warehousebatchid": 1, "warehouseitemid": 3, "datemodified": 1463131430, "decimalquantity": "25.000", "moneypricein": "3920.00", "emailowner": "info@example.com", "comment": null, "sku": "10038-1" }, { "warehousebatchitemid": 2, "warehousebatchid": 1, "warehouseitemid": 5, "datemodified": 1463131443, "decimalquantity": "5.000", "moneypricein": "3920.00", "emailowner": "info@example.com", "comment": null, "sku": "10038-2" } ] }

Batch Set Warehouse Batch Items

Endpoint

PUT sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems

Request body

See warehousebatchitem for fields. Note! moneypricein is only allowed for transactiontype 10 (ManualIn).
Required fields:
sku

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 or a batch envelope if multiple warehousebatchitems were set.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/2/warehousebatchitems.json [ { "sku": "10038-1", "decimalquantity": "9.000", "emailowner": "info@example.com", "comment": "1 missing" }, { "sku": "10038-2", "decimalquantity": "2.000", "emailowner": "info@example.com", "comment": "" }, { "sku": "10038-3", "decimalquantity": "1.000" } ]

Response

[ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true } ]

Batch Delete Warehouse Batch Items

Endpoint

DELETE sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems

Request body

See warehousebatchitem for fields.
Required fields:
sku

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 or a batch envelope if multiple warehousebatchitems were deleted.

Example

Request

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/warehouses/1/warehousebatches/2/warehousebatchitems.json [ { "sku": "10038-2" }, { "sku": "10038-3" } ]

Response

[ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true } ]

Update Warehouse Batch

Note! Changing the warehousebatchstate from 10 (Open) to 20 (Closed) will trigger the commit of a transaction for the batch items

Endpoint

PUT sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}

Request body

See warehousebatch 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/warehouses/1/warehousebatches/2.json { "warehousebatchstate": 20, "emailowner": "info@example.com", "comment": "Stocktaking has been completed!" }

Response

true