Availability
What is on hand, what is reserved and what is available for one item at one location, with the revision of that balance.
Get availability
GET /inventory/v1/availability
Returns the balance of one item at one location: onHand, reserved, available (on hand minus reserved) and the revision to send with the next command. An item that was never moved reads as zero at revision 0.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
productId | query | string (uuid) | Yesrequired | The item. |
locationId | query | string (uuid) | Yesrequired | The location. It must be one the token covers. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | The balance at its current revision. | Availability |
400 | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. fields names each one. | Error |
401 | The token is missing, expired or not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
429 | The request was refused and not processed: the code is rate_limited. Wait the seconds in the header Retry-After, then send it again with the same operationId. | Error |
503 | The service cannot answer now: the code is unavailable. Send the request again with the same operationId. | Error |
Request
curl
curl "$RDC_BASE_URL/inventory/v1/availability?productId=6cbfcba3-55fd-4cf0-9709-6e75c9717bb3&locationId=b006344d-2fae-4970-bb6f-c32877084b4f" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/inventory/v1/availability?productId=6cbfcba3-55fd-4cf0-9709-6e75c9717bb3&locationId=b006344d-2fae-4970-bb6f-c32877084b4f`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/inventory/v1/availability?productId=6cbfcba3-55fd-4cf0-9709-6e75c9717bb3&locationId=b006344d-2fae-4970-bb6f-c32877084b4f',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/inventory/v1/availability?productId=6cbfcba3-55fd-4cf0-9709-6e75c9717bb3&locationId=b006344d-2fae-4970-bb6f-c32877084b4f');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$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.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/inventory/v1/availability?productId=6cbfcba3-55fd-4cf0-9709-6e75c9717bb3&locationId=b006344d-2fae-4970-bb6f-c32877084b4f");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
"legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
"productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
"locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
"onHand": "68",
"reserved": "10",
"available": "58",
"revision": 5
}