Know what is on the shelf, promised and due
Reserve, receive, sell or count. Watch Available move.
- Receipt NIR-2026-0214 arrives from Moara Vadului SRL.
- The sugar line is read: 100 bags.
- It lands on Expected in the sugar balance.
- The balance: 70 on hand, 15 reserved, 55 available.
- Available 55 is under the reorder point of 100.
- Posting the receipt brings the 100 bags into stock.
- Posted: 170 on hand, 155 available, 0 expected.
- The next receipt starts the same way.
Stock
Stock
| White flour, 10 kg bagFA-0010 | Main warehouse | 68 | 10 | 58 | 60 | |
|---|---|---|---|---|---|---|
| Sunflower oil, 1 lUL-0101 | Main warehouse | 180 | 0 | 180 | — | |
| Sugar, 1 kgZA-0201 | Main warehouse | 70 | 15 | 55 | 100 | |
| Rice, 1 kgOR-0620 | Main warehouse | 80 | 0 | 80 | 40 | |
| Dishwashing liquid, 5 lDT-0412 | Main warehouse | 26 | 0 | 26 | — | |
| Paper bags, pack of 100AM-0518 | Main warehouse | 9 | 0 | 9 | — | |
| Cheese, 400 gLA-0307 | Cold room | 86 | 0 | 86 | 48 | |
| Cheese, sold by weightLA-0315 | Cold room | 78.5 kg | 0 kg | 78.5 kg | — | |
| Sunflower oil, 1 lUL-0101 | Shop Piatra-Neamț | 57 | 0 | 57 | — | |
| Rice, 1 kgOR-0620 | Shop Piatra-Neamț | 34 | 0 | 34 | — | |
| Sugar, 1 kgZA-0201 | Shop Piatra-Neamț | 50 | 0 | 50 | — | |
| White flour, 10 kg bagFA-0010 | Shop Piatra-Neamț | 12 | 0 | 12 | — |
Press Enter to open the record.
Movements
| Actions | |||||||
|---|---|---|---|---|---|---|---|
| 19 Nov, 11:40 | Return | RET-2026-0007 | +4 | 0 | 70 | 7 | |
| 17 Nov, 16:00 | Sale | LIV-2026-01811 | -64 | 0 | 66 | 6 | |
| 10 Nov, 15:00 | Sale | LIV-2026-01790 | -60 | -60 | 130 | 5 |
Press Enter to open the record.
Receive
| Actions | |||||
|---|---|---|---|---|---|
| NIR-2026-0201 | Moara Vadului SRL | Main warehouse | 3 Nov 2026 | ||
| NIR-2026-0204 | Moara Vadului SRL | Main warehouse | 3 Nov 2026 | ||
| NIR-2026-0202 | Brânzeturi Obcina SRL | Cold room | 3 Nov 2026 |
Press Enter to open the record.
Reservation CV-1038
- Reserved
- +15
- Revision after
- 3
- Recorded
- 6 Nov, 13:15
- By
- Andrei Pop
Location
Movements
- Return RET-2026-0007Change in on hand: +4
- Sale LIV-2026-01811Change in on hand: -64
- Sale LIV-2026-01790Change in on hand: -60
Every movement stays on the card
Rice, 1 kg, at Shop Roman: till receipt Bon 0411 was entered a second time as a new operation. It had a different operationId, so it was applied twice and the rice fell twice. The correction is a reversal: a new line linked to the second entry, while the line it undoes stays as it was.
| Time | Kind | Document | On hand | On hand after |
|---|---|---|---|---|
| 16 Nov, 12:20 | ReversalReverses Bon 0411 | Bon 0411 | +6 | 24 |
| 16 Nov, 12:00 | SaleReversed | Bon 0411 | -6 | 18 |
| 16 Nov, 12:00 | Sale | Bon 0411 | -6 | 24 |
| 9 Nov, 12:05 | Transfer | TR-2026-0032 | +30 | 30 |
Reserve, receive, sell, count
-
Reserve
Reserved goes up and Available goes down by the same quantity. On hand does not move. The order keeps its place until it is delivered or the reservation is reversed.
Show it: Reserve -
Receive
Posting a receipt adds to On hand and to Available. Until it is posted the goods are only Expected. If the stock changed after the receipt was read, posting is refused; the receipt is read again and sent as a new operation.
Show it: Receive -
Sell
A sale takes from On hand. A sale taken from a reservation also lowers Reserved, so Available is counted once.
Show it: Sell -
Count
A count sets On hand to what was found on the shelf and writes the difference as a movement. A count under what is reserved is refused.
Show it: Count
The same request, sent twice, changes nothing
curl -X POST "$RDC_BASE_URL/inventory/v1/reservations" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "90aebca5-208b-47dd-9e6d-c9159d4aab06",
"customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
"legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
"occurredAt": "2026-11-23T07:12:00Z",
"source": {
"service": "erp",
"documentId": "46091949-3c11-414b-9157-994f3048e568",
"documentType": "sales-order",
"documentRevision": 1
},
"actor": {
"serviceId": "brumar-erp",
"userId": "4e2f591e-3df0-4f36-8741-3e49134249b0"
},
"lines": [
{
"productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
"locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
"quantity": "24",
"expectedRevision": 5
}
]
}'const response = await fetch(`${process.env.RDC_BASE_URL}/inventory/v1/reservations`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "90aebca5-208b-47dd-9e6d-c9159d4aab06",
"customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
"legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
"occurredAt": "2026-11-23T07:12:00Z",
"source": {
"service": "erp",
"documentId": "46091949-3c11-414b-9157-994f3048e568",
"documentType": "sales-order",
"documentRevision": 1
},
"actor": {
"serviceId": "brumar-erp",
"userId": "4e2f591e-3df0-4f36-8741-3e49134249b0"
},
"lines": [
{
"productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
"locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
"quantity": "24",
"expectedRevision": 5
}
]
}),
});
const result = await response.json();import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/inventory/v1/reservations',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '90aebca5-208b-47dd-9e6d-c9159d4aab06',
'customerOrgId': '690fa0e3-547f-4f93-96b7-824475cc3d7c',
'legalCompanyId': 'd84ba982-ca9a-4e91-9566-21bd23f7227b',
'occurredAt': '2026-11-23T07:12:00Z',
'source': {
'service': 'erp',
'documentId': '46091949-3c11-414b-9157-994f3048e568',
'documentType': 'sales-order',
'documentRevision': 1,
},
'actor': {
'serviceId': 'brumar-erp',
'userId': '4e2f591e-3df0-4f36-8741-3e49134249b0',
},
'lines': [
{
'productId': '6cbfcba3-55fd-4cf0-9709-6e75c9717bb3',
'locationId': 'b006344d-2fae-4970-bb6f-c32877084b4f',
'quantity': '24',
'expectedRevision': 5,
},
],
},
)
result = response.json()<?php
$body = <<<'JSON'
{
"operationId": "90aebca5-208b-47dd-9e6d-c9159d4aab06",
"customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
"legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
"occurredAt": "2026-11-23T07:12:00Z",
"source": {
"service": "erp",
"documentId": "46091949-3c11-414b-9157-994f3048e568",
"documentType": "sales-order",
"documentRevision": 1
},
"actor": {
"serviceId": "brumar-erp",
"userId": "4e2f591e-3df0-4f36-8741-3e49134249b0"
},
"lines": [
{
"productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
"locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
"quantity": "24",
"expectedRevision": 5
}
]
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/inventory/v1/reservations');
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);using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/inventory/v1/reservations");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "90aebca5-208b-47dd-9e6d-c9159d4aab06",
"customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
"legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
"occurredAt": "2026-11-23T07:12:00Z",
"source": {
"service": "erp",
"documentId": "46091949-3c11-414b-9157-994f3048e568",
"documentType": "sales-order",
"documentRevision": 1
},
"actor": {
"serviceId": "brumar-erp",
"userId": "4e2f591e-3df0-4f36-8741-3e49134249b0"
},
"lines": [
{
"productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
"locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
"quantity": "24",
"expectedRevision": 5
}
]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response
202 Accepted, the first time and the second
{
"operationId": "90aebca5-208b-47dd-9e6d-c9159d4aab06",
"status": "completed",
"aggregateRevision": 6,
"movementIds": [
"771d53db-5d2c-4a12-b9a6-bb3c86e5eeea"
]
}
409 Conflict, a new operationId on the old revision
{
"code": "revision_conflict",
"message": "A balance has changed since the revision you sent.",
"requestId": "req_4f9d2a7c1b6e8035"
} From the till to the books
- ERP, product
- POS, product
- INV, product
- Accounting, product
Sale from reserved stock
ERP, product
Reserve for the order
Sales order CV-1042 asks INV to set aside 24 bags, with the revision of the balance it read.
- Document
- CV-1042
- On hand
- 68
- Reserved
- 10
- Available
- 58
- Revision
- 5
INV, product
Record the reservation
The balance holds 24 more as reserved. On hand does not change; available falls by 24.
- Document
- CV-1042
- On hand
- 68
- Reserved
- 34
- Available
- 34
- Revision
- 6
POS, product
Sell at the till
The customer collects the order. The till sends Bon 1042: 24 bags sold, all 24 taken from the reservation, with revision 6.
- Document
- Bon 1042
- On hand
- 68
- Reserved
- 34
- Available
- 34
- Revision
- 6
INV, product
Take the sale from the reservation
The sale takes 24 from on hand and releases the same 24 from reserved in one step, so available does not change a second time.
- Document
- Bon 1042
- On hand
- 44
- Reserved
- 10
- Available
- 34
- Revision
- 7
Accounting, product
Book the issue of goods
The event of the sale reaches Accounting, which books the goods that left.
- Document
- Bon 1042
- On hand
- 44
- Reserved
- 10
- Available
- 34
- Revision
- 7
Receipt
ERP, product
Receive the goods
Receipt NIR-2026-0214 lists sugar, flour and rice for the main warehouse. Sugar is expected: 100 more are on their way into the balance.
- Document
- NIR-2026-0214
- On hand
- 70
- Reserved
- 15
- Available
- 55
- Expected
- 100
- Revision
- 7
INV, product
Post the receipt
Each line adds its quantity to on hand and to available. Expected falls back to zero.
- Document
- NIR-2026-0214
- On hand
- 170
- Reserved
- 15
- Available
- 155
- Expected
- 0
- Revision
- 8
Accounting, product
Book the receipt
The event of each movement reaches Accounting, which books the goods that came in.
- Document
- NIR-2026-0214
- On hand
- 170
- Reserved
- 15
- Available
- 155
- Expected
- 0
- Revision
- 8
Stale revision refused and retried
ERP, product
Read the balance
The receipt is prepared against revision 7 of the sugar balance.
- Document
- NIR-2026-0214
- On hand
- 70
- Reserved
- 15
- Available
- 55
- Expected
- 100
- Revision
- 7
INV, product
Another sale lands first
Delivery LIV-2026-01850 takes 5 bags before the receipt arrives. The balance moves to revision 8.
- Document
- LIV-2026-01850
- On hand
- 65
- Reserved
- 15
- Available
- 50
- Expected
- 100
- Revision
- 8
INV, product
Refuse the old revision
The stock changed after you read it. Read it again and retry. Nothing is applied.
- Document
- NIR-2026-0214
- On hand
- 65
- Reserved
- 15
- Available
- 50
- Expected
- 100
- Revision
- 8
ERP, product
Read again, send again
The refusal says to read again and send a new operation: the receipt goes out with revision 8 and a new operationId.
- Document
- NIR-2026-0214
- On hand
- 65
- Reserved
- 15
- Available
- 50
- Expected
- 100
- Revision
- 8
INV, product
Record it once
The receipt is recorded once. Sent again with this operationId, it would return this outcome and change nothing.
- Document
- NIR-2026-0214
- On hand
- 165
- Reserved
- 15
- Available
- 150
- Expected
- 0
- Revision
- 9
What each step writes
| Step | Record created or changed |
|---|---|
| 1 Reserve for the order | Request with operationId and expectedRevision |
| 2 Record the reservation | Reservation movement, revision 6 |
| 3 Sell at the till | Sale with reservedQuantity 24 |
| 4 Take the sale from the reservation | Sale movement, revision 7 |
| 5 Book the issue of goods | Entry for the goods issued |
| Step | Record created or changed |
|---|---|
| 1 Receive the goods | Receipt with its lines |
| 2 Post the receipt | Receipt movement per line |
| 3 Book the receipt | Entry for the goods received |
| Step | Record created or changed |
|---|---|
| 1 Read the balance | Receipt with expectedRevision 7 |
| 2 Another sale lands first | Sale movement, revision 8 |
| 3 Refuse the old revision | Nothing: the operation is not recorded |
| 4 Read again, send again | Receipt with expectedRevision 8 |
| 5 Record it once | Receipt movement, revision 9 |
Questions about stock figures
What is the difference between on hand and available?
On hand is what the books say is on the shelf. Reserved is promised to orders. Available is on hand minus reserved: what you can still promise or sell. Expected is only on its way: it is in no other figure until the receipt is posted.
Can available stock go below zero?
No. A change that would leave a balance with less on hand than reserved is refused as a whole, and none of its lines is applied. The refusal names the reason, and the balance stays as it was.
How do I correct a mistake?
A movement is never edited. A correction is a reversal, a new movement linked to the first one, and both stay on the card. The card keeps who sent each movement, from which document, and the revision the balance reached.
What happens when two systems change the same item at once?
Every change names the revision of the balance it read. The second one reaches a balance that has moved on and is refused. It reads again and sends again. The refusal is a 409 with the code revision_conflict.
What if my till sends the same sale twice?
The sale carries an operationId. The second send returns the first outcome and changes nothing, so a retry after a timeout is safe. A different body under the same operationId is refused as a reuse.
Related guides
-
Before automating replenishment, check these stock signals
Check units, stock movements, reservations and supplier commitments before automating replenishment, then give buyers purchasing suggestions they can explain.
Read the guide: Before automating replenishment, check these stock signals -
When a return should go back into available stock
Connect return arrival, inspection and approved stock release so the warehouse and customer service can trace each item's condition, destination and next action.
Read the guide: When a return should go back into available stock -
Keep two sales channels from promising the same stock
Design stock reservations across sales channels with one authority for accepting commitments, clear expiry rules and recovery for uncertain or repeated requests.
Read the guide: Keep two sales channels from promising the same stock
Proposal for INV
Tell us your locations and the systems that send stock changes, and we scope INV with you.