Fetch inventory balance
You can for example retrieve inventory balances for a specific location, or location type. You can also get inventory balances for specific products or variants.
- Authorization setup with the correct scope, and a valid authorization token. See How inventories work.
- A location UUID belonging the inventory, see Fetch inventory locations.
This request returns inventory balances for the STORE
location type of an organization. You can add a since
parameter to limit the data returned. In that case only products/variants changed since the specified date will be included in the response.
1GET /inventory
Example: Fetch balances for location type STORE.
Request
1GET /inventory
Response
1{2"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",3"trackedProducts": [4"b9675342-5ce0-11ec-bf63-0242ac130002",5"24977020-5ce1-11ec-bf63-0242ac130002"6],7"variants": [8{9"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",10"locationType": "STORE",11"productUuid": "b9675342-5ce0-11ec-bf63-0242ac130002",12"variantUuid": "d3b93e04-5ce0-11ec-bf63-0242ac130002",13"balance": "42"14},15{16"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",17"locationType": "STORE",18"productUuid": "24977020-5ce1-11ec-bf63-0242ac130002",19"variantUuid": "f5c98ab2-5ce0-11ec-bf63-0242ac130002",20"balance": "1337"21}22],23"latest": 024}
This request returns inventory balances for products in a specific location defined by the provided location UUID.
1GET /organizations/self/inventory/locations/{locationUuid}
Example: This call retrieves balances for the location 6e5e8d52-5ce0-11ec-bf63-0242ac130002
.
Request
1GET /organizations/self/inventory/locations/6e5e8d52-5ce0-11ec-bf63-0242ac130002
Response
1{2"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",3"trackedProducts": [4"b9675342-5ce0-11ec-bf63-0242ac130002",5"24977020-5ce1-11ec-bf63-0242ac130002"6],7"variants": [8{9"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",10"locationType": "STORE",11"productUuid": "b9675342-5ce0-11ec-bf63-0242ac130002",12"variantUuid": "d3b93e04-5ce0-11ec-bf63-0242ac130002",13"balance": "42"14},15{16"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",17"locationType": "STORE",18"productUuid": "24977020-5ce1-11ec-bf63-0242ac130002",19"variantUuid": "f5c98ab2-5ce0-11ec-bf63-0242ac130002",20"balance": "1337"21}22],23"latest": 024}
This request returns inventory balances for products in a specific location defined by the provided location type.
1GET /organizations/self/inventory/locations/?type={STORE|SOLD|BIN|SUPPLIER}
Example: This call retrieves balances for the location type STORE
.
Request
1GET /organizations/self/inventory/locations/?type=STORE
Response
1{2"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",3"trackedProducts": [4"b9675342-5ce0-11ec-bf63-0242ac130002",5"24977020-5ce1-11ec-bf63-0242ac130002"6],7"variants": [8{9"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",10"locationType": "STORE",11"productUuid": "b9675342-5ce0-11ec-bf63-0242ac130002",12"variantUuid": "d3b93e04-5ce0-11ec-bf63-0242ac130002",13"balance": "42"14},15{16"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",17"locationType": "STORE",18"productUuid": "24977020-5ce1-11ec-bf63-0242ac130002",19"variantUuid": "f5c98ab2-5ce0-11ec-bf63-0242ac130002",20"balance": "1337"21}22],23"latest": 024}
A pure retrieval endpoint where no data is modified. In the request body, you specify a location and a list of products. The endpoint retrieves and returns the current inventory balances for these products in the given location.
The request does the same as "Fetch inventory balance for a location" (GET/organizations/self/inventory/locations/{locationUuid}
). The difference is that this request applies to a specified list of products defined in the header.
1POST /organizations/self/inventory/products
Example: This example retrieves the balances for products b9675342-5ce0-11ec-bf63-0242ac130002
and 24977020-5ce1-11ec-bf63-0242ac130002
in a single call.
Request
1POST /organizations/self/inventory/products
1{2"locationType": "STORE",3"productUuids": ["b9675342-5ce0-11ec-bf63-0242ac130002", "24977020-5ce1-11ec-bf63-0242ac130002"]4}
Response
1{2"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",3"trackedProducts": [4"b9675342-5ce0-11ec-bf63-0242ac130002",5"24977020-5ce1-11ec-bf63-0242ac130002"6],7"variants": [8{9"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",10"locationType": "STORE",11"productUuid": "b9675342-5ce0-11ec-bf63-0242ac130002",12"variantUuid": "d3b93e04-5ce0-11ec-bf63-0242ac130002",13"balance": "42"14},15{16"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",17"locationType": "STORE",18"productUuid": "24977020-5ce1-11ec-bf63-0242ac130002",19"variantUuid": "f5c98ab2-5ce0-11ec-bf63-0242ac130002",20"balance": "1337"21}22],23"latest": 024}
The product list acts as a filter and only returns the requested products.
Returns the inventory balance for a single specific product in a specific location. Locations and products are specified by their UUIDs.
1GET /organizations/self/inventory/locations/{locationUuid}/products/{productUuid}
Example: This example retrieves the inventory balance in location 6e5e8d52-5ce0-11ec-bf63-0242ac130002
for product b9675342-5ce0-11ec-bf63-0242ac130002
.
Request
1GET /organizations/self/inventory/locations/6e5e8d52-5ce0-11ec-bf63-0242ac130002/products/b9675342-5ce0-11ec-bf63-0242ac130002
Response
1{2"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",3"variants": [4{5"locationUuid": "6e5e8d52-5ce0-11ec-bf63-0242ac130002",6"locationType": "STORE",7"productUuid": "b9675342-5ce0-11ec-bf63-0242ac130002",8"variantUuid": "d3b93e04-5ce0-11ec-bf63-0242ac130002",9"balance": "42"10}11]12}