Centra Get Stock by Variant SKU and Size SKU

Retrieves stock levels from Centra for specified Variant SKU and Size SKU combinations

This action retrieves stock levels from Centra for a list of specified Variant SKU and Size SKU combinations.

Note that you cannot search for stock levels by Variant SKU + Size SKU directly in the Centra APIs. This action works by retrieving stock levels for all products, and then picking out the correct Variant SKU + Size SKU from the resulting list.

This means that for customers with large product catalogues, a lot of data will need to be retrieved. The action is set to retrieve a max of 200 items per API call, and paginate through multiple API calls if there are more items than that to a maximum of 50 pages / API calls.

Consequently this action should be used with care. If you have multiple Variant SKU + Size SKU combinations you need to retrieve stock levels for, they should be input into this action as a list and retrieved all at once, rather than using the action multiple times for every individual combination and triggering excess API calls.

Inputs

In order to use the action in your flow you need to provide it with the following inputs:

InputTypeDescription
SKU ListObjectThis is a list of Variant SKU + Size SKU pairs. Each pair forms a unique combination. The action will search for each pair and return the stock levels.
API KeyStringThe API Key
Base URIStringBase URI - should be in the format clientname.centra.com/api/dg-order-api/xx
Stock Modified AfterOptional StringThe action will only retrieve stock levels for items that have had their stock changed after this date. MUST BE in 'YYYY-MM-DD' format. Can be omitted, in which case all stock levels will be retrieved (no date filter will be applied).

Note: It is highly recommended to set a 'Stock Modified At' field. Without one, the action will paginate through all stock levels that have ever been updated.

Outputs

OutputTypeDescription
Success?BooleanWhether the action ran successfully and any stock levels were found (note that success will return true if stock levels are found for some but not all Variant/Size SKU combinations)
Stock LevelsObjectAn object listing available stock, Variant SKU, Size SKU, full SKU and Country of Origin for each item that was found.

This action uses Centra GetStock endpoint - https://centra.dev/docs/apis/order-api/api-reference#get-stock

Example SKU List Input

[
      { "variantSku": "000007", "sizeSku": "018" },
      { "variantSku": "001747", "sizeSku": "08" },
      { "variantSku": "001747", "sizeSku": "12412" }
]

Example Response

[
    {
      variantSku: '000199',
      sizeSku: '014',
      sku: 'SS24JT966',
      availableStock: 3,
      countryOfOrigin: 'PT'
    },
    {
      variantSku: '001892',
      sizeSku: '014',
      sku: 'SS25WT444',
      availableStock: 0,
      countryOfOrigin: 'CN'
    }
  ]

Error messages

ErrorMeaning
Too many pages - stopped at page 50. Results may be incomplete.The action has paginated through 50 pages of stock levels, and stopped at 50 for safety. The action will output the results list as it currently stands, but some may be missing.
No stock levels foundNo stock levels could be found for any of the input Variant SKU + Size SKU combinations