The RESTful API groups customer orders into batches and generate pick list for each batch. For the API to work properly, create a warehouse profile to obtain API key and warehouse ID, and configure layout. To familiarize with the API features, you may use the online picker in your warehouse profile for testing.
Pick requests are stored for 48 hours before automatic deletion.
The common hash types referenced in the API are:
length float | Item length. |
width float | Item width. |
height float | Item height. |
level string, optional | Shelf level. |
position string, optional | Shelf level position. |
barcode string, optional | Barcode. |
barcodeType string, optional | Barcode type. |
sku string | Item SKU. |
name string | Item name. |
qty integer | Quantity to pick. |
order string | Order ID to which item belongs. |
bin list | Cart bin indices (comma separated) to place item to. |
id string | Order ID. |
bins list | List of integer indices. |
complete boolean | All items are picked after this batch for this order. |
Create a non-blocking request to generate pick lists for customer orders.
{ "batchSize": 10, "pickCarts": [ { "zone": "A", "maxBins": 1, "maxWeight": 100, "weightUnit": "lb", "maxVolume": 75, "volumeUnit": "ft" } ] "orders": [ { "id": "order-1", "items": [ { "sku": "item1", "shelf": "A-10-W", "qty": 1, "weightUnit": "lb", "weight": 0.5, "dimensionUnit": "in", "dimensions": [ { "length": 8, "width": 7, "height": 6 } ] } ] } ] }
{ "status": { "success": true, "messages": ["Data saved succesfully."] }, "request": { "id": "pick_68744279", "status": "processing" } }
Retrieve the status and output of a pick request with given ID.
{ "status": { "success": true, "messages": [] }, "request": { "id": "pick_68744279", "status": "ready" "distance": 378, "batches": [ [ { "id": "0", "zone": "A", "picking": [ { "shelf": "H", "items": [ { "sku": "item1", "qty": 2, "order": "order-1", "bin": [0, 1] } ] }, { "shelf": "K", "items": [ { "sku": "item2", "qty": 1, "order": "order-2", "bin": [2] } ] } ], "orders": [ { "id": "order-1", "bins": [0, 1], "complete": false }, { "id": "order-2", "bins": [2], "complete': true } ], "map": "solvingmaze.com/resource/type/pick_map/id/100-batch-0-zone-A-route.jpg" }, { "id": "0", "zone": "B", "picking": [ { "shelf": "M", "items": [ { "sku": "item3", "qty": 1, "bin": [0], "order": "order-1", } ] } ], "orders": [ { "id": "order-1", "bins": [0], "complete": true, } ], "map": "solvingmaze.com/resource/type/pick_map/id/100-batch-0-zone-B-route.jpg" } ], [ { "id": "1", "zone": "A", "picking": [ { "shelf": "K", "items": [ { "sku": "item7", "qty": 2, "bin": [0], "order": "order-3", } ] } ], "orders": [ { "id": "order-3", "bins": [0], "complete": true, } ], "map": "solvingmaze.com/resource/type/pick_map/id/100-batch-1-zone-A-route.jpg" } ] ] } }
List all pick request IDs and their statuses.
{ "status": { "success": true, "messages": [] }, "requests": [ { "id": "pick_43468534", "status": "processing" }, { "id": "pick_68744279", "status": "ready" } ] }
The following code creates a pick request. It assumes shelf A-10-M is defined in warehouse layout.
<?php
// customer orders
$orders = array();
$orders[] = array(
'id' => 'order1',
'items' => array(
array(
'sku' => 'item1',
'name' => 'A Book',
'qty' => 2,
'shelf' => 'A-10-M',
'weightUnit' => 'lb',
'weight' => 0.5,
'dimensionUnit' => 'in',
'dimensions' => array(
array(
'length' => 8,
'width' => 7,
'height' => 6
)
)
)
)
);
// pick carts
$pickCarts = array();
$pickCarts[] = array(
'zone' => 'A',
'maxBins' => 1,
'maxWeight' => 100,
'maxVolume' => 75,
'weightUnit' => 'lb',
'volumeUnit' => 'ft',
);
// submit pick request
$ch = curl_init("http://api.solvingmaze.com/pick/key/$apiKey/warehouse/$warehouseId");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, true);
$params = array(
'batchSize' => 10,
'orders' => $orders,
'pickCarts' => $pickCarts
);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// print response
echo $response . "\n";
?>
The following code retrieves a pick request.
<?php
// retrieve pick request
$uri = "http://api.solvingmaze.com/pick/key/$apiKey/warehouse/$warehouseId/request/$requestId";
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
// parse response
$responseJson = json_decode($response, true);
if ($responseJson['request']['status'] == 'ready') {
// print pick batches
foreach ($responseJson['request']['batches'] as $batch) {
foreach ($batch as $zoneBatch) {
$batchId = $zoneBatch['id'];
$zone = $zoneBatch['zone'];
echo "Batch $batchId Zone $zone:\n";
// print pick item and location
foreach ($zoneBatch['picking'] as $pick) {
$shelf = $pick['shelf'];
foreach ($pick['items'] as $pickItem) {
$sku = $pickItem['sku'];
$qty = $pickItem['qty'];
echo " pick $qty pcs of item#$sku from $shelf\n";
}
}
}
}
}
?>