Get stock¶
Order API v1
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¶
string
optional
|
Get products with a specific SKU. |
date/datetime
optional
|
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. |
date/datetime
optional
|
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. |
date/datetime
optional
|
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. |
string
optional
|
Get a product with specified EAN code. |
integer
optional
|
Get a product with specified productId, variantId or stockItemId. |
int
optional
|
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. |
string
optional
|
include=attributes will also make the products include the custom attributes defined for each product and variant. |
string
optional
|
exclude=physicalStock will exclude fetching physical stock which will speed up the fetching of the stock values. |
boolean
optional
|
Response in xml format instead of json. |
Request example¶
1 | 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
string
required
|
ok if success, else no . |
||||||||||||||||||||||||||||||||
array
|
List of the products.
|
||||||||||||||||||||||||||||||||
string
optional
|
Will contain a URL to the previous page. | ||||||||||||||||||||||||||||||||
string
optional
|
Will contain a URL to the next page. |
Response example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | {
"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",
"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",
"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"
}
|