Count a location
Ask for a count of a shelf, enter what was counted, count again if needed, and approve the adjustment.
On this page
A count compares the stock the system holds for an item and lot on a shelf with what a person counts there. The stock changes only when the warehouse lead approves the count. The statuses are to-count, counted and approved.
Ask for a count
Name the shelf, the item and its lot. One count of a shelf is open at a time: a second request is refused with count_requested. A pick that was closed short with the reason not-found asks for one by itself, with the reason short-pick.
curl
curl -X POST "$RDC_BASE_URL/warehouse/v1/counts" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "a23f419f-8068-42c1-85a8-f24186ea4ed1",
"locationCode": "A-02-01",
"sku": "ZA-0201",
"lot": "L26-0870",
"by": "mihai-stan"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/counts`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "a23f419f-8068-42c1-85a8-f24186ea4ed1",
"locationCode": "A-02-01",
"sku": "ZA-0201",
"lot": "L26-0870",
"by": "mihai-stan"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/counts',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'a23f419f-8068-42c1-85a8-f24186ea4ed1',
'locationCode': 'A-02-01',
'sku': 'ZA-0201',
'lot': 'L26-0870',
'by': 'mihai-stan',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "a23f419f-8068-42c1-85a8-f24186ea4ed1",
"locationCode": "A-02-01",
"sku": "ZA-0201",
"lot": "L26-0870",
"by": "mihai-stan"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/counts');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/counts");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "a23f419f-8068-42c1-85a8-f24186ea4ed1",
"locationCode": "A-02-01",
"sku": "ZA-0201",
"lot": "L26-0870",
"by": "mihai-stan"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "a23f419f-8068-42c1-85a8-f24186ea4ed1",
"status": "accepted",
"aggregateRevision": 1
} Enter what was counted
Send the quantity counted, 0 or more. The system keeps the stock it held at that moment as system, and difference is counted minus system. A shelf where a picker has scanned a location or an item cannot be counted: the answer is location_busy.
curl
curl -X POST "$RDC_BASE_URL/warehouse/v1/counts/a3000000-0000-4000-8000-000000000002/count" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "f68c9ace-1e54-4920-8b06-bef2039d1b20",
"expectedRevision": 1,
"quantity": "27",
"by": "dan-ilie"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000002/count`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "f68c9ace-1e54-4920-8b06-bef2039d1b20",
"expectedRevision": 1,
"quantity": "27",
"by": "dan-ilie"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000002/count',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'f68c9ace-1e54-4920-8b06-bef2039d1b20',
'expectedRevision': 1,
'quantity': '27',
'by': 'dan-ilie',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "f68c9ace-1e54-4920-8b06-bef2039d1b20",
"expectedRevision": 1,
"quantity": "27",
"by": "dan-ilie"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/counts/a3000000-0000-4000-8000-000000000002/count');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000002/count");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "f68c9ace-1e54-4920-8b06-bef2039d1b20",
"expectedRevision": 1,
"quantity": "27",
"by": "dan-ilie"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "f68c9ace-1e54-4920-8b06-bef2039d1b20",
"status": "accepted",
"aggregateRevision": 2
} Count again
If the number looks wrong, send the count back to to-count. The numbers it held are cleared.
curl
curl -X POST "$RDC_BASE_URL/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/recount" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "09f87735-539b-486b-8516-6f6b8d4b8f1b",
"expectedRevision": 2
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/recount`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "09f87735-539b-486b-8516-6f6b8d4b8f1b",
"expectedRevision": 2
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/recount',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '09f87735-539b-486b-8516-6f6b8d4b8f1b',
'expectedRevision': 2,
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "09f87735-539b-486b-8516-6f6b8d4b8f1b",
"expectedRevision": 2
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/recount');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/recount");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "09f87735-539b-486b-8516-6f6b8d4b8f1b",
"expectedRevision": 2
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "09f87735-539b-486b-8516-6f6b8d4b8f1b",
"status": "accepted",
"aggregateRevision": 3
} Approve the adjustment
Only the warehouse lead approves (approver_required otherwise), never a count the lead entered (own_count), and never when the stock moved after the count (stock_changed): count again. A difference of zero is approved without a movement; any other adds one movement of kind adjust between the shelf and adjustment.
curl
curl -X POST "$RDC_BASE_URL/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/approve" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "4fbe134b-31a3-4323-8804-56154bd99553",
"expectedRevision": 2,
"by": "mihai-stan"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/approve`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "4fbe134b-31a3-4323-8804-56154bd99553",
"expectedRevision": 2,
"by": "mihai-stan"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/approve',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '4fbe134b-31a3-4323-8804-56154bd99553',
'expectedRevision': 2,
'by': 'mihai-stan',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "4fbe134b-31a3-4323-8804-56154bd99553",
"expectedRevision": 2,
"by": "mihai-stan"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/approve');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/warehouse/v1/counts/a3000000-0000-4000-8000-000000000001/approve");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "4fbe134b-31a3-4323-8804-56154bd99553",
"expectedRevision": 2,
"by": "mihai-stan"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "4fbe134b-31a3-4323-8804-56154bd99553",
"status": "accepted",
"aggregateRevision": 3
}