Orders
Check inventory
Verifies stock availability for an order’s unscheduled or store_rejected shipment before it is scheduled.
GET
/
orders
/
{order_number}
/
check-inventory
Check inventory
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/{order_number}/check-inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/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/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/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/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/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/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>",
"is_free_item": true,
"free_quantity": 123,
"selling_price": 123,
"seller_detail": {
"id": "<string>",
"trade_name": "<string>",
"legal_name": "<string>",
"business_type": "sole_proprietorship",
"tax_identification_number": "<string>"
}
}
],
"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",
"quantity": 123,
"is_default": false,
"can_collect": true,
"can_ship_parcel": true,
"can_receive_stock": true,
"accepts_returns": true,
"is_checkout_point": true,
"opening_hours": {}
}
],
"total_quantity": 123,
"allowed_quantity": 123,
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": true,
"product_id": "<string>",
"product_variant_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
}
}
],
"recommended_warehouses": [
{
"id": "<string>",
"name": "<string>",
"inventory_status": "fulfilled"
}
],
"packing_detail_available": true,
"order": {
"order_number": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"order_status": "draft",
"payment_status": "pending",
"customer_name": "<string>",
"customer_id": "<string>",
"sub_total": 123,
"shipping_amount": 123,
"total_tax": 123,
"coupon_discount_amount": 123,
"grand_total": 123,
"coupon_code": "<string>",
"coupon_discount_percent": 123
}
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"errors": {},
"content": {},
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>",
"error_id": "<string>"
}Authorizations
Query Parameters
Was this page helpful?
⌘I
Check inventory
curl --request GET \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/{order_number}/check-inventory \
--header 'Authorization: Bearer <token>'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/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/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/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/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/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/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>",
"is_free_item": true,
"free_quantity": 123,
"selling_price": 123,
"seller_detail": {
"id": "<string>",
"trade_name": "<string>",
"legal_name": "<string>",
"business_type": "sole_proprietorship",
"tax_identification_number": "<string>"
}
}
],
"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",
"quantity": 123,
"is_default": false,
"can_collect": true,
"can_ship_parcel": true,
"can_receive_stock": true,
"accepts_returns": true,
"is_checkout_point": true,
"opening_hours": {}
}
],
"total_quantity": 123,
"allowed_quantity": 123,
"packaging": {
"pack_width": 123,
"pack_height": 123,
"pack_length": 123,
"pack_dry_weight": 123,
"units_per_pack": 123,
"vertical_rotation": true,
"product_id": "<string>",
"product_variant_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"shipper_width": 123,
"shipper_height": 123,
"shipper_length": 123,
"shipper_dry_weight": 123,
"units_per_shipper": 123
}
}
],
"recommended_warehouses": [
{
"id": "<string>",
"name": "<string>",
"inventory_status": "fulfilled"
}
],
"packing_detail_available": true,
"order": {
"order_number": "<string>",
"order_date": "2023-11-07T05:31:56Z",
"order_status": "draft",
"payment_status": "pending",
"customer_name": "<string>",
"customer_id": "<string>",
"sub_total": 123,
"shipping_amount": 123,
"total_tax": 123,
"coupon_discount_amount": 123,
"grand_total": 123,
"coupon_code": "<string>",
"coupon_discount_percent": 123
}
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"errors": {},
"content": {},
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>"
}{
"message": "<string>",
"success": true,
"code": "<string>",
"details": "<string>",
"error_id": "<string>"
}