Order API - Get Stock
Get stock
Endpoint: GET *base*/stock
Authentication: API Key
This will return product data from Centra with stock info. The values of the stock depends on the connected warehouses for the API-plugin.
Parameters
Get products with a specific SKU.
Get all products modified after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
Get all products which had stock changes after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
Get all products added after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
Get a product with specified EAN code.
Get a product with specified UPC code.
Get a product with specified productId, variantId or stockItemId.
You will get this amount of products, and a "next" parameter in return if there are multiple pages. This will go a lot faster to fetch, instead of fetching all products at once.
include=attributes
will also make the products include the custom attributes defined for each product and variant.
exclude=physicalStock
will exclude fetching physical stock which will speed up the fetching of the stock values.
Response in xml format instead of json.
Request example
GET <base>/stock?[&limit=2][&sku=DCG001][&modified=2016-01-01+12:10:11][&created=2011-01-01] HTTP/1.1
Response
200
Content-type: application/json
ok
if success, else no
.
List of the products.
SKU for this product.
The internal name for this product.
The ID for this product.
SKU for this variant.
ID for this variant.
SKU for this size.
ID for this specific stock item.
The EAN for this product item size.
The UPC for this product item size.
The weight specified for this product.
The unit used for the weight.
kg
lb
Name of the size for this specific product item.
If the product item is active or not.
ISO-Alpha-2 (SE
, US
, GB
etc)
The amount of items in the physical stock. If an order is placed without being shipped, the physical stock of the product does not change. However, as soon as a shipment is completed, the physical stock will decrease.
physicalStock = allocatedStock + availableStock
The amount of items in the physical stock that is currently allocated against orders.
The amount of items in the physical stock that is currently available to sell.
Will contain a URL to the previous page.
Will contain a URL to the next page.
Response example
{
"status": "ok",
"products": [
{
"sku": "12019005",
"productId": 10,
"variantSku": "A",
"variantId": 9,
"sizeSku": "X",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLACK",
"variant": "SVART",
"size": "ONE SIZE",
"stockItemId": 3131,
"ean": "1234567890123",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"countryOfOrigin": "",
"harmCode": "87120030",
"harmDescription": "Cyklar",
"active": 1,
"physicalStock": 5,
"allocatedStock": 1,
"availableStock": 4
},
{
"sku": "12028008",
"productId": 11,
"variantSku": "B",
"variantId": 10,
"sizeSku": "Y",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Man 0 speed BROWN",
"variant": "BRUN",
"size": "ONE SIZE",
"stockItemId": 3132,
"ean": "9876543210123",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"countryOfOrigin": "",
"harmCode": "87120030",
"harmDescription": "CYKEL",
"active": 1,
"physicalStock": 141,
"allocatedStock": 10,
"availableStock": 131
}
],
"previous": "?limit=2&page=2",
"next": "?limit=2&page=3"
}