Stock insights API (0.1.0)
Download OpenAPI specification:Download
Use this API to get insights into the current allocations and reservation for a product at a fulfillment node.
The API returns reservations, allocations and future allocations for that product.
The allocations and reservations are not grouped on purpose to keep the load on the service and database to a minimum especially since the stock-http container is used for routing to get unallocated item counts. The list of allocations and reservations each have a limit of 1000 items. For simplicity, there will be no pagination provided.
Get ATP insights.
Retrieves the allocations and reservations by ATP keys in your business.
Authorizations:
query Parameters
| product_id required | string The product ID of the item. |
| fulfillment_node_id required | string The fulfillment node ID of the store/warehouse. |
Responses
Response samples
- 200
- 400
- 500
{- "product_id": "10000102",
- "fulfillment_node_id": "US01",
- "allocations": [
- {
- "order_uuid": "5ca1548c-d228-4f98-a54e-c54bbba0a204",
- "item_uuid": "3409090f-1881-486e-9e2d-2278020e5655",
- "created_at": "2022-01-31T20:00:00Z"
}, - {
- "order_uuid": "5ca1548c-d228-4f98-a54e-c54bbba0a204",
- "item_uuid": "236a3594-2db2-4491-a5b4-9741ce680b03",
- "created_at": "2022-01-31T20:00:00Z"
}
], - "reservations": [
- {
- "order_uuid": "5ca1548c-d228-4f98-a54e-c54bbba0a204",
- "item_uuid": "3409090f-1881-486e-9e2d-2278020e5655",
- "created_at": "2022-01-31T20:00:00Z",
- "expires_at": "2022-01-31T20:30:00Z"
}, - {
- "order_uuid": "5ca1548c-d228-4f98-a54e-c54bbba0a204",
- "item_uuid": "236a3594-2db2-4491-a5b4-9741ce680b03",
- "created_at": "2022-01-31T20:00:00Z",
- "expires_at": "2022-01-31T20:30:00Z"
}
], - "future_allocations": [
- {
- "order_uuid": "017b8d63-76a8-46fc-b53a-4e2af8594427",
- "item_uuid": "aaf13724-94a3-11ec-b909-0242ac120002",
- "created_at": "2022-01-31T20:00:00Z"
}, - {
- "order_uuid": "017b8d63-76a8-46fc-b53a-4e2af8594427",
- "item_uuid": "ba44378a-94a3-11ec-b909-0242ac120002",
- "created_at": "2022-01-31T20:00:00Z"
}
]
}Get unallocated items
Retrieves the count for unallocated items for a specified set of ATP keys, where
ATP keys are defined as a combination of the product ID and fulfillment location.
The number of unallocated items returned in the response payload is the number of items that are sellable on hand, after removing the number of safety stock items and allocations.
Note: This API only supports requesting for 2000 items. If more items need to be requested, use multiple requests.
Authorizations:
Request Body schema: application/json
A list of ATP keys
required | Array of objects [ 1 .. 2000 ] items | ||||
Array ([ 1 .. 2000 ] items)
| |||||
Responses
Request samples
- Payload
{- "atp_keys": [
- {
- "product_id": "1000012",
- "fulfillment_node_id": "US01"
}
]
}Response samples
- 200
- 500
{- "items": [
- {
- "product_id": "1000012",
- "fulfillment_node_id": "US01",
- "count": 10
}, - {
- "product_id": "1000012",
- "fulfillment_node_id": "US02",
- "count": 12
}
]
}Get unallocated items for a product
Retrieves the count for unallocated items for the specified product ID. In this request, the ATP keys are defined as a combination of the same product ID and different fulfillment locations.
The number of unallocated items returned in the response payload is the number of items that are sellable on hand, after removing the number of safety stock items and allocations.
Note: This API only supports requesting for 2000 items. If more items need to be requested, use multiple requests.
Authorizations:
query Parameters
| product_id | string The product ID of the item. |
Responses
Response samples
- 200
- 400
- 500
{- "items": [
- {
- "product_id": "1000012",
- "fulfillment_node_id": "US01",
- "count": 10
}, - {
- "product_id": "1000012",
- "fulfillment_node_id": "US02",
- "count": 12
}
]
}Get ATP by product ids
Retrieves the atp for the specified product IDs.
Note: This API only supports requesting for 2000 items. If more items need to be requested fetch the next
page. The boolean has_more and the number total_count indicates if there are more pages to be fetched.
Authorizations:
Request Body schema: application/json
A list of ATP keys
| products required | Array of strings non-empty |
| page_number required | number multiple of 1 >= 1 The page number of paginated response. The page number starts at 1 |
| page_size required | number multiple of 1 [ 1 .. 2000 ] The max size of the paginated response. This value should not be more than 2000. |
Responses
Request samples
- Payload
{- "products": [
- "1000001",
- "1000002",
- "1000003"
], - "page_number": 1,
- "page_size": 500
}Response samples
- 200
- 400
- 500
{- "items": [
- {
- "product_id": "1000012",
- "fulfillment_node_id": "US01",
- "atp": 35
}, - {
- "product_id": "1000012",
- "fulfillment_node_id": "DC01",
- "atp": 100
}
], - "has_more": false
}