Warehouse Batches
Add Warehouse Batch
post /sites/{siteid}/warehouses/{warehouseid}/warehousebatches.jsonSite ID. (Use eshopid of the site for this parameter).
Warehouse ID.
{ "transactiontype": 50, "emailowner": "info@example.com", "comment": "New Stocktaking"}2| HTTP Status Code Summary | |
|---|---|
| 200 | Returns warehousebatchid |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Get Warehouse Batches
get /sites/{siteid}/warehouses/{warehouseid}/warehousebatches.jsonFilter on transaction type. Accepts either a single TransactionType enum value (e.g. 10) or a comma-separated list (e.g. 10,50,60). When omitted, no filter is applied and every transactiontype is returned, including cycle counts (60).
Filter on batch state. Accepts either a single WarehouseBatchState enum value (e.g. 10) or a comma-separated list (e.g. 10,20). Defaults to 10 (Open) when omitted.
Filter on show stock flag.
Free-text search across the warehouse batch's textual fields (e.g. name, comment,
instructions, emailowner, externalid, reasoncode). The value is split on whitespace
and each token must match at least one searchable field (case-insensitive substring match).
Filter on warehousebatches with datestart starting from the timestamp provided.
Filter on warehousebatches with datestart up to and including the timestamp provided.
Filter on warehousebatches with dateend starting from the timestamp provided.
Filter on warehousebatches with dateend up to and including the timestamp provided.
The index of the item to start from. Used for pagination.
Number of items to return.
Comma separated list of fields to return. Use this to query only the fields you are using. See WarehouseBatch object for all fields. Pass fields= to opt-in to additional fields available on warehousebatch (e.g. name, instructions, showstock, datestart, dateend, dateclosed, closedbyuserid).
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
{ "totalcount": 1, "items": [ { "warehousebatchid": 1, "warehouseid": 1, "warehousetransactionid": null, "transactiontype": 10, "datecreated": 1463124692, "warehousebatchstate": 10, "emailowner": "", "comment": "", "shipmentid": null, "externalid": null, "reasoncode": null } ]}| HTTP Status Code Summary | |
|---|---|
| 200 | Returns an envelope with items of type warehousebatch for a warehouse. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Get Warehouse Batch
get /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}.jsonSite ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
{ "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}| HTTP Status Code Summary | |
|---|---|
| 200 | Returns an item of type warehousebatch. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Update Warehouse Batch
put /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}.jsonNote! Changing the warehousebatchstate from 10 (Open) to 20 (Closed) will trigger the commit of a
transaction for the batch items.
The fields name, instructions, showstock, datestart and dateend can only be updated when
the batch's transactiontype is 60 (cycle count). When updating, name must be a non-empty string
and datestart must be less than or equal to dateend.
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
{ "warehousebatchstate": 20, "emailowner": "info@example.com", "comment": "Stocktaking has been completed!"}true| HTTP Status Code Summary | |
|---|---|
| 200 | Successful. Returns true. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Get Warehouse Batch Items
get /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems.jsonThe index of the item to start from. Used for pagination.
Number of items to return.
Filter on items with datelaststocktaking starting from the timestamp provided.
Filter on items with datelaststocktaking up to and including the timestamp provided.
Filter on whether the warehousebatchitem is in scope for the batch. Use true to return only in-scope items, false to return only out-of-scope items. Cycle-count batches only (transactiontype=60); ignored on other batch types.
Comma separated sort fields. Prefix a field with - to reverse direction.
Supported: warehousebatchitemid, datemodified, datelaststocktaking, inscope
(inscope on cycle-count batches only; the sort key is ignored on other batch types).
Default: warehousebatchitemid.
Comma separated list of fields to return. Use this to query only the fields you are using. See WarehouseBatchItem object for all fields. Pass fields= to opt-in to additional fields available on warehousebatchitem (e.g. datelaststocktaking, inscope).
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
Returns an envelope with items of type warehousebatchitem for a warehousebatch.
{ "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" } ]}| HTTP Status Code Summary | |
|---|---|
| 200 | Returns an envelope with items of type warehousebatchitem for a warehousebatch. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Batch Set Warehouse Batch Items
put /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems.jsonSite ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
[ { "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" }][ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true }]| HTTP Status Code Summary | |
|---|---|
| 200 | Returns true or a batch envelope if multiple warehousebatchitems were set |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Batch Delete Warehouse Batch Items
delete /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems.jsonSite ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
[ { "sku": "10038-2" }, { "sku": "10038-3" }][ { "statuscode": 200, "return": true }, { "statuscode": 200, "return": true }]| HTTP Status Code Summary | |
|---|---|
| 200 | Returns true or a batch envelope if multiple warehousebatchitems were deleted |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Get Counted Items for Closed Warehouse Batch
get /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/warehousebatchitems-counted.jsonReturns the counted items for a closed warehousebatch, including stock and value before/after, approved deltas, and product title/variant/binlocation. Responds with HTTP 400 if the batch is not in state 20 (Closed).
The index of the item to start from. Used for pagination.
Number of items to return.
Filter on stock keeping unit (SKU), use comma as separator for multiple values.
Filter on whether the warehousebatchitem is in scope for the batch. Use true to return only in-scope items, false to return only out-of-scope items. Cycle-count batches only (transactiontype=60); ignored on other batch types.
Comma separated sort fields. Prefix a field with - to reverse direction.
Supported: warehousebatchitemid, sku, datemodified, decimaldiff, inscope
(inscope on cycle-count batches only; the sort key is ignored on other batch types).
Default: warehousebatchitemid.
Comma separated list of fields to return. Use this to query only the fields you are using. See WarehouseBatchCountedItem object for all fields.
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
| HTTP Status Code Summary | |
|---|---|
| 200 | Returns an envelope with items of type WarehouseBatchCountedItem. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Get Cycle Count Scope Items
get /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/scope-items.jsonReturns the warehouseitems declared in scope for a cycle-count (transactiontype=60) batch, including product details for display. Responds with HTTP 400 if the batch is not a cycle count.
The index of the item to start from. Used for pagination.
Number of items to return.
Search text matching SKU or product title.
Filter on stock keeping unit (SKU), use comma as separator for multiple values.
Filter on items with datelaststocktaking starting from the timestamp provided.
Filter on items with datelaststocktaking up to and including the timestamp provided.
When true, only return items where available stock is below decimalthreshold.
Comma separated sort fields. Prefix a field with - to reverse direction.
Supported: warehousebatchscopeitemid, warehouseitemid, sku, title,
decimaltotal, decimalreserved, moneytotal, datelaststocktaking, dateadded.
Default: sku.
Comma separated list of fields to return. Use this to query only the fields you are using. See WarehouseBatchScopeItem object for all fields.
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
| HTTP Status Code Summary | |
|---|---|
| 200 | Returns an envelope with items of type WarehouseBatchScopeItem. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Add Cycle Count Scope Item
post /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/scope-items.jsonAdd a single sku to the scope of a cycle-count batch in state Pending (40).
Idempotent — returns true if the row already exists. When the sku has never been
stocked at the warehouse, a warehouse item (zero stock) is created automatically.
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
{ "sku": "100287"}true| HTTP Status Code Summary | |
|---|---|
| 200 | Successful. Returns true. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Replace Cycle Count Scope
put /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/scope-items.jsonReplace-all semantics: the resulting scope equals exactly the sku values supplied
in the body. Rows present today but absent from the body are deleted; rows in the
body but missing today are inserted. An empty array is valid and clears the scope.
Warehouse items (zero stock) are created automatically for skus never stocked at the
warehouse. Duplicate skus (case-insensitive) in the body return HTTP 400. Only
allowed on cycle-count batches in state Pending (40).
Site ID. (Use eshopid of the site for this parameter).
Warehouse ID.
Warehouse Batch ID.
[ { "sku": "100287" }, { "sku": "100288" }]true| HTTP Status Code Summary | |
|---|---|
| 200 | Successful. Returns true. |
| 400 | Invalid request. Data sent from client is invalid. |
| 401 | Missing or bad authentication. |
| 404 | The specified resource was not found. |
| 429 | Too Many Requests. |
| 500 | Internal Server Error. |
Delete Cycle Count Scope Items
delete /sites/{siteid}/warehouses/{warehouseid}/warehousebatches/{warehousebatchid}/scope-items.jsonDelete one or more sku rows from the scope of a cycle-count batch in state
Pending (40). Deleting a sku with no scope row (or never stocked at the warehouse)
is a no-op; no warehouse items are created. Duplicate skus (case-insensitive) in
the body, and an empty array, return HTTP 400. Each row is processed on its own and
reported in a batch envelope, so a row that fails — including a batch that belongs
to another warehouse — is reported as
{"statuscode": 400, "errortext": "