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

sku

string
optional
Get products with a specific SKU.

modified

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.

stock_modified

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.

created

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.

ean

string
optional
Get a product with specified EAN code.

productId, variantId, stockItemId

integer
optional
Get a product with specified productId, variantId or stockItemId.

limit

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.

include

string
optional
include=attributes will also make the products include the custom attributes defined for each product and variant.

exclude

string
optional
exclude=physicalStock will exclude fetching physical stock which will speed up the fetching of the stock values.

xml

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

status

string
required
ok if success, else no.

products

array

List of the products.

sku

string
SKU for this product.

product

string
The internal name for this product.

productId

integer
The ID for this product.

variantSku

string
SKU for this variant.

variantId

integer
ID for this variant.

sizeSku

string
SKU for this size.

stockItemId

integer
ID for this specific stock item.

ean

string
The EAN for this product item size.

weight

decimal2 (0.00)
The weight specified for this product.

weightUnit

string

The unit used for the weight.

  • kg
  • lb

size

string
Name of the size for this specific product item.

active

boolean
If the product item is active or not.

countryOfOrigin

string
ISO-Alpha-2 (SE, US, GB etc)

physicalStock

int

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

allocatedStock

int
The amount of items in the physical stock that is currently allocated against orders.

availableStock

int
The amount of items in the physical stock that is currently available to sell.

previous

string
optional
Will contain a URL to the previous page.

next

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"
}