POST api/v1/ProductStock

Retrieve various stock related data values for a specific or all products
You can send either product code or product id dending on what you have stored

Request Information

URI Parameters

None.

Body Parameters

StockParams
NameDescriptionTypeAdditional information
apiKey

Please contact Caliq support to get your key

string

Required

ProductCode

Specify product code to get stock figure for or leave empty to get all

string

Required

ProductID

Specify product id to get stock figure for or leave zero to get all

integer

Required

ProductIDList

If you want to get for multiple ID's, the list of product IDs you want returned, can be empty if using codes

Collection of integer

Required

ProductCodeList

If you want to get for multiple ID's, the list of product Codes you want returned, can be empty if using ID's

Collection of string

Required

OnlyReturnChanges

If true will only return items with stock change since last call

boolean

Required

Request Formats

application/json, text/json

Sample:
{
  "apiKey": "sample string 1",
  "ProductCode": "sample string 2",
  "ProductID": 3,
  "ProductIDList": [
    1,
    2
  ],
  "ProductCodeList": [
    "sample string 1",
    "sample string 2"
  ],
  "OnlyReturnChanges": true
}

application/xml, text/xml

Sample:
<StockParams xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <apiKey>sample string 1</apiKey>
  <ProductCode>sample string 2</ProductCode>
  <ProductID>3</ProductID>
  <ProductIDList>
    <int>1</int>
    <int>2</int>
  </ProductIDList>
  <ProductCodeList>
    <string>sample string 1</string>
    <string>sample string 2</string>
  </ProductCodeList>
  <OnlyReturnChanges>true</OnlyReturnChanges>
</StockParams>

Response Information

Resource Description

Returns:
200 OK Returns a collection of product stock data
400 Bad Request - parameters supplied cannot be properly interpreted
401 Not Authorised if supplied api key is not valid
204 No Content if the requested product code or product id don't exist
503 Service Unavailable

Stock
NameDescriptionTypeAdditional information
StockData

Collection of StockProduct

None.

Response Formats

application/json, text/json

Sample:
{
  "StockData": [
    {
      "ID": 1,
      "Code": "sample string 2",
      "NextPOInQty": 3,
      "NextPOInStatus": "sample string 4",
      "NextPOInDate": "sample string 5",
      "LastReceived": "sample string 6",
      "AvailableNow": 7,
      "Physical": 8,
      "NextAvailableQty": 9,
      "NextAvailableDate": "sample string 10",
      "NextAvailableStatus": "sample string 11",
      "NextAvailableText": "sample string 12",
      "NextAvailableQty2": 13,
      "NextAvailableDate2": "sample string 14",
      "NextAvailableStatus2": "sample string 15",
      "NextAvailableText2": "sample string 16",
      "Buffers": [
        {
          "ID": 1,
          "AccountNo": "sample string 2",
          "Qty": 3
        },
        {
          "ID": 1,
          "AccountNo": "sample string 2",
          "Qty": 3
        }
      ]
    },
    {
      "ID": 1,
      "Code": "sample string 2",
      "NextPOInQty": 3,
      "NextPOInStatus": "sample string 4",
      "NextPOInDate": "sample string 5",
      "LastReceived": "sample string 6",
      "AvailableNow": 7,
      "Physical": 8,
      "NextAvailableQty": 9,
      "NextAvailableDate": "sample string 10",
      "NextAvailableStatus": "sample string 11",
      "NextAvailableText": "sample string 12",
      "NextAvailableQty2": 13,
      "NextAvailableDate2": "sample string 14",
      "NextAvailableStatus2": "sample string 15",
      "NextAvailableText2": "sample string 16",
      "Buffers": [
        {
          "ID": 1,
          "AccountNo": "sample string 2",
          "Qty": 3
        },
        {
          "ID": 1,
          "AccountNo": "sample string 2",
          "Qty": 3
        }
      ]
    }
  ]
}

application/xml, text/xml

Sample:
<Stock xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <StockItem>
    <ID>1</ID>
    <Code>sample string 2</Code>
    <NextPOInQty>3</NextPOInQty>
    <NextPOInStatus>sample string 4</NextPOInStatus>
    <NextPOInDate>sample string 5</NextPOInDate>
    <LastReceived>sample string 6</LastReceived>
    <AvailableNow>7</AvailableNow>
    <Physical>8</Physical>
    <NextAvailableQty>9</NextAvailableQty>
    <NextAvailableDate>sample string 10</NextAvailableDate>
    <NextAvailableStatus>sample string 11</NextAvailableStatus>
    <NextAvailableText>sample string 12</NextAvailableText>
    <NextAvailableQty2>13</NextAvailableQty2>
    <NextAvailableDate2>sample string 14</NextAvailableDate2>
    <NextAvailableStatus2>sample string 15</NextAvailableStatus2>
    <NextAvailableText2>sample string 16</NextAvailableText2>
    <Buffers>
      <Buffer>
        <ID>1</ID>
        <AccountNo>sample string 2</AccountNo>
        <Qty>3</Qty>
      </Buffer>
      <Buffer>
        <ID>1</ID>
        <AccountNo>sample string 2</AccountNo>
        <Qty>3</Qty>
      </Buffer>
    </Buffers>
  </StockItem>
  <StockItem>
    <ID>1</ID>
    <Code>sample string 2</Code>
    <NextPOInQty>3</NextPOInQty>
    <NextPOInStatus>sample string 4</NextPOInStatus>
    <NextPOInDate>sample string 5</NextPOInDate>
    <LastReceived>sample string 6</LastReceived>
    <AvailableNow>7</AvailableNow>
    <Physical>8</Physical>
    <NextAvailableQty>9</NextAvailableQty>
    <NextAvailableDate>sample string 10</NextAvailableDate>
    <NextAvailableStatus>sample string 11</NextAvailableStatus>
    <NextAvailableText>sample string 12</NextAvailableText>
    <NextAvailableQty2>13</NextAvailableQty2>
    <NextAvailableDate2>sample string 14</NextAvailableDate2>
    <NextAvailableStatus2>sample string 15</NextAvailableStatus2>
    <NextAvailableText2>sample string 16</NextAvailableText2>
    <Buffers>
      <Buffer>
        <ID>1</ID>
        <AccountNo>sample string 2</AccountNo>
        <Qty>3</Qty>
      </Buffer>
      <Buffer>
        <ID>1</ID>
        <AccountNo>sample string 2</AccountNo>
        <Qty>3</Qty>
      </Buffer>
    </Buffers>
  </StockItem>
</Stock>