Check inventory
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"inventory": {
"allowed_actions": [
"create-shipment"
],
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"product_name": "<string>",
"variant_name": "<string>",
"product_image_url": "<string>",
"sku": "<string>",
"free_quantity": 123,
"is_free_item": true,
"selling_price": 123
}
],
"inventory_status": "fulfilled",
"inventory_detail": [
{
"product_id": "<string>",
"variant_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"track_inventory": true,
"allow_backorder": true,
"requested_quantity": 123,
"stock_quantity": 123,
"inventory_status": "fulfilled",
"warehouses": [
{
"warehouse_id": "<string>",
"warehouse_name": "<string>",
"stock_quantity": 123,
"inventory_status": "fulfilled"
}
]
}
],
"recommended_warehouses": [
{
"id": "<string>",
"name": "<string>",
"inventory_status": "fulfilled"
}
]
}
}
}POSAdmin
Check inventory
Verifies stock availability for an order’s unscheduled or store_rejected shipment before it is scheduled.
GET
/
pos
/
orders
/
{order_number}
/
check-inventory
Check inventory
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/pos/orders/{order_number}/check-inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"inventory": {
"allowed_actions": [
"create-shipment"
],
"shipment_items": [
{
"product_id": "<string>",
"variant_id": "<string>",
"quantity": 123,
"product_name": "<string>",
"variant_name": "<string>",
"product_image_url": "<string>",
"sku": "<string>",
"free_quantity": 123,
"is_free_item": true,
"selling_price": 123
}
],
"inventory_status": "fulfilled",
"inventory_detail": [
{
"product_id": "<string>",
"variant_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"track_inventory": true,
"allow_backorder": true,
"requested_quantity": 123,
"stock_quantity": 123,
"inventory_status": "fulfilled",
"warehouses": [
{
"warehouse_id": "<string>",
"warehouse_name": "<string>",
"stock_quantity": 123,
"inventory_status": "fulfilled"
}
]
}
],
"recommended_warehouses": [
{
"id": "<string>",
"name": "<string>",
"inventory_status": "fulfilled"
}
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Order number
Query Parameters
Optional. The fulfillment type to evaluate inventory against. If not provided, the inventory will be checked for the fulfillment_type of the shipment.
Available options:
delivery, collect-in-store Optional. The shipment number to check inventory for. If not provided, the inventory will be checked for the unscheduled shipment of the order.
Was this page helpful?
⌘I