pos-check-order-inventory
Method: GET
Path: /pos/orders/{order_number}/check-inventory
Tags: Orders
Summary
Check inventory
Description
Verifies stock availability for an order's unscheduled or store_rejected shipment before it is scheduled.
Pos SDK Usage
SDK Method: pos.checkInventory()
Example:
typescript
// Check the order's unscheduled shipment
const { data, error } = await pos.checkInventory({
order_number: "ORD-2024-001234"
});
if (error) {
console.error("Failed to check inventory:", error.message);
} else {
const inventory = data.inventory;
console.log(`Inventory Status: ${inventory?.inventory_status}`);
console.log(`Shipment Items:`, inventory?.shipment_items);
console.log(`Recommended Warehouses:`, inventory?.recommended_warehouses);
console.log(`Inventory Detail:`, inventory?.inventory_detail);
console.log(`Allowed Actions:`, inventory?.allowed_actions);
}
// Check a specific shipment, evaluated as an in-store collection
const { data: pickupData } = await pos.checkInventory(
{ order_number: "ORD-2024-001234" },
{
shipment_number: "SHIP-2024-001234",
fulfillment_type: "collect-in-store"
}
);
console.log(`Can fulfill from store:`, pickupData?.inventory?.inventory_status);TypeScript Definition
typescript
"pos-check-order-inventory": {
parameters: {
query?: {
/** @description Optional. The fulfillment type to evaluate inventory against. If not provided, the inventory will be checked for the `fulfillment_type` of the shipment. */
fulfillment_type?: "delivery" | "collect-in-store";
/** @description Optional. The shipment number to check inventory for. If not provided, the inventory will be checked for the `unscheduled` shipment of the order. */
shipment_number?: string;
};
header?: never;
path: {
/** @description Order number */
order_number: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message?: string;
success?: boolean;
content?: {
inventory?: components["schemas"]["CheckInventoryResponse"];
};
};
};
};
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["CheckInventoryResponse"] | CheckInventoryResponse |
Parameters
- fulfillment_type (query): Optional. The fulfillment type to evaluate inventory against. If not provided, the inventory will be checked for the
fulfillment_typeof the shipment. - order_number (path): Order number
- shipment_number (query): Optional. The shipment number to check inventory for. If not provided, the inventory will be checked for the
unscheduledshipment of the order.
Responses
200
OK
OpenAPI Definition
json
{
"operationId": "pos-check-order-inventory",
"summary": "Check inventory",
"description": "Verifies stock availability for an order's unscheduled or store_rejected shipment before it is scheduled.",
"parameters": [
{
"name": "fulfillment_type",
"in": "query",
"description": "Optional. The fulfillment type to evaluate inventory against. If not provided, the inventory will be checked for the `fulfillment_type` of the shipment.",
"required": false,
"schema": {
"type": "string",
"enum": [
"delivery",
"collect-in-store"
]
}
},
{
"name": "order_number",
"in": "path",
"description": "Order number",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "shipment_number",
"in": "query",
"description": "Optional. The shipment number to check inventory for. If not provided, the inventory will be checked for the `unscheduled` shipment of the order.",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"inventory": {
"$ref": "#/components/schemas/CheckInventoryResponse"
}
},
"type": "object"
}
}
}
}
}
}
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Orders"
],
"x-speakeasy-group": "pos"
}Auto-generated from OpenAPI spec and TypeScript definitions