Get Stock for all Products
GET/inventories
Returns all products and their associated stock.
Request
Query Parameters
Possible values: <= 10000
The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the page length store setting is used.
The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the the page length store setting is used.
Responses
- 200
- 500
Success. All products and their stock values are returned
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
data Inventory[]
The unique identifier of the product.
Possible values: [stock
]
Default value: stock
The type represents the object being returned. Always stock
.
The total amount of stock we have.
The amount of stock available for purchase.
The amount of paid for stock, also known as reserved.
links object
Links are used to allow you to move between requests. Single entities use a self parameter with a link to that specific resource. Sometimes, there aren’t enough entities for a project to fill multiple pages. In this situation, we return some defaults, instead of expecting you as a consumer to check for these special cases.
Property | Description |
---|---|
current | Always the current page. |
first | Always the first page. |
last | null if there is only one page. |
meta object
timestamps StockTimestamps
The date and time a stock was created and last updated.
The date and time the stock was created.
The date and time the stock was last updated.
results object
The results for this response for the entire collection.
The total number of records for this response for the entire collection.
page object
The maximum number of records per page for this response.
The current offset by number of records per page for this response.
The current number of records for this response per page.
The total number of records for this response per page.
{
"data": [
{
"id": "f976dace-450f-4a5d-8877-d119c5a550a1",
"type": "stock",
"total": 100,
"available": 75,
"allocated": 25
}
],
"links": {
"current": "?page[offset]=0&page[limit]=25",
"first": "?page[offset]=0&page[limit]=25",
"last": "?page[offset]=0&page[limit]=25"
},
"meta": {
"timestamps": {
"created_at": "2017-07-21T17:32:28Z",
"updated_at": "2017-07-21T17:32:28Z"
},
"results": {
"total": 50
},
"page": {
"limit": 100,
"offset": 0,
"current": 1,
"total": 50
}
}
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors ErrorBody[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred."
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": 500
}
]
}