Aurora API: Stock
While 'stock' is strictly speaking a feature of 'Products' it is detailed independently due to some unique services provided to better support the unique nature in which this data is handled.
Get
Deferred: Conditional
Where possible, this endpoint attempts to provide real time responses to allow 3rd parties to integrate with Aurora in the more responsive way possible, however, if the endpoint is not used efficiently, it will differ it's responses as documented here.
Requests to the StockGet method will be deferred where:
- There is no limit or a limit greater than 1000 and none of the following are true:
- There are more than 200 Product References specified (or not specified at all).
- The Interval specified is greater than 30 minutes (or not specified).
To avoid getting deferred responses from this method, please consider limiting requests by the above conditions.
This endpoint supports paging as documented here.
Example request by SKU:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Stock>
<Get>
<RequestID>1</RequestID>
<ProductReferences>
<ProductReference>SKU1</ProductReference>
<ProductReference>SKU2</ProductReference>
<ProductReference>SKU3</ProductReference>
</ProductReferences>
</Get>
</Stock>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example request by Interval (the last day):
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Stock>
<Get>
<RequestID>1</RequestID>
<Interval>PT15M</Interval>
</Get>
</Stock>
</Request>
</Requests>
</AuroraRequestEnvelope>
Since v1.1 of the API, the individual Store Stock levels are returned as show in the example below.
Example response with stores:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
<Data>
<Product>
<ProductReference>SKU1</ProductReference>
<ProductStock>35</ProductStock>
<PreOrderStock></PreOrderStock>
<Stores>
<Store>
<StoreID>1</StoreID>
<StoreReference>XYZ</StoreReference>
<Stock>20</Stock>
</Store>
<Store>
<StoreID>2</StoreID>
<StoreReference>ABC</StoreReference>
<Stock>15</Stock>
</Store>
</Stores>
</Product>
</Data>
</Response>
</Responses>
</AuroraResponseEnvelope>
Request Fields
Field | Values | Version | Description | Required |
---|---|---|---|---|
Interval | String interval | 1.1+ | P indicates the period (required) nY indicates the number of years nM indicates the number of months nD indicates the number of days T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds) nH indicates the number of hours nM indicates the number of minutes nS indicates the number of seconds | No (If not provided, no interval filter is applied, and all products are returned.) |
ProductReferences | Container | 1.0+ | No | |
ProductReferences.ProductReference | String | 1.0+ | This can be the Product or Variation Reference/SKU | No |
ProductReferences.InternalStoreID | String | 1.1+ | This takes the Internal Store Reference/ID given to a product in the Store Stock system | No |
DetailLevel | Minimum or Minimum Products or Minimum Variations or Full | 1.5+ | This allows the client to request varying volumes of data when receiving data back from the server (defaults to "Minimum") Minimum returns individual stock for both products and variations Minimum Products returns individual stock for products only Minimum Variations returns individual stock for variations only Full returns individual stock for products with variation stock grouped within each product | No |
Response fields
Field | Values | API Version | Description | Detail Levels |
---|---|---|---|---|
<br>Product<br> | Container | 1.0+ | Minimum + | |
Product.ProductReference | String | 1.0+ | The main Product Reference or Variation Reference (usually the SKU) assigned to the Product. This will always be a Main Product Reference when Detail Level is Full, but may be either a product or variation reference if not. | Minimum + |
Product.ProductStock | Integer | 1.0+ | The current stock level for a Product. | Minimum + |
Product.PreOrderStock | Integer | 1.0+ | The limit to which this product can be pre-ordered. This can be blank to show that there is no limit. | Minimum + |
Product.Stores | Container | 1.1+ | Minimum + | |
Product.Stores.Store | Container | 1.1+ | Minimum + | |
Product.Stores.Store.StoreID | Integer > 0 | 1.1+ | The Internal ID Aurora uses to identify a Store. | Minimum + |
Product.Stores.Store.StoreReference | String | 1.1+ | The Internal ID Aurora uses to identify a Product. | Minimum + |
Product.Stores.Store.Stock | Integer | 1.1+ | The Internal ID Aurora uses to identify a Product. | Minimum + |
Product.Variations | Container | 1.3+ | Full | |
Product.Variations.Variation | Container | 1.3+ | Full | |
Product.Variations.Variation.VariationReference | String | 1.3+ | The main Product Reference (usually the SKU) assigned to the Product Variation. | Full |
Product.Variations.Variation.VariationStock | Integer | 1.3+ | The current stock level for a Product Variation. | Full |
Product.Variations.Variation.VariationPreOrderStock | Integer | 1.3+ | The limit to which this Product Variation can be pre-ordered. This can be blank to show that there is no limit. | Full |
Update
Since: v1.1
Deferred: No
This method allows the Stock of Products and their Variations to be updated quickly. Stock can be managed at two levels:
- Master Stock level on the products or variations as a whole
- Store Stock level on the products or variations for each individual store
If you manage your stock by store, then the 'Master Stock' levels for each product or variation will be calculated automatically based on a SUM of all stock levels from all stores. This can be prevented by passing the 'generate_stock_from_stores' attribute of the 'Update' tag as 'no'. In this case, the 'Master Stock' levels for the products updated at Store level will not be changed in response to these Store level stock changes. Please see some examples below.
Example request to set master stock:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Stock>
<Update>
<RequestID>1</RequestID>
<ProductReference>SKU1</ProductReference>
<Stock>1</Stock>
<PreOrderStock>1</PreOrderStock>
</Update>
</Stock>
<Stock>
<Update>
<RequestID>2</RequestID>
<ProductReference>SKU2</ProductReference>
<Stock>1</Stock>
<PreOrderStock>1</PreOrderStock>
</Update>
</Stock>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example request to set store stock:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Stock>
<Update>
<RequestID>1</RequestID>
<ProductReference>SKU1</ProductReference>
<StoreReference>XYZ</StoreReference>
<Stock>1</Stock>
</Update>
</Stock>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example request to set store stock while not effecting the master stock:
<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<AuthToken>...</AuthToken>
</Header>
<Requests>
<Request>
<Stock>
<Update generate_stock_from_stores="no">
<RequestID>1</RequestID>
<ProductReference>SKU1</ProductReference>
<StoreReference>XYZ</StoreReference>
<Stock>1</Stock>
</Update>
</Stock>
</Request>
</Requests>
</AuroraRequestEnvelope>
Example response:
<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
<Header>
<Summary>
<Ack>OK</Ack>
<RequestsProcessed>1</RequestsProcessed>
<RequestsSucceeded>1</RequestsSucceeded>
<RequestErrors>0</RequestErrors>
</Summary>
</Header>
<Responses>
<Response>
<RequestID>1</RequestID>
<Ack>OK</Ack>
</Response>
<Response>
<RequestID>2</RequestID>
<Ack>OK</Ack>
</Response>
</Responses>
</AuroraResponseEnvelope>
Request Fields
Field | Values | Description | Required |
---|---|---|---|
RequestID | Integer > 0 | The ID of the Message, assigned to the return messages for error handling | No |
ProductReference | Alpha-numeric String | This is the Product Reference set for the product or variation in Aurora (usually the product SKU) | One of at least ProductReference, ProductEAN, ProductID, VariationID must be provided |
ProductEAN | Alpha-numeric String | This is the Product EAN set for the product or variation in Aurora (usually the product barcode) | One of at least ProductReference, ProductEAN, ProductID, VariationID must be provided |
ProductID | Integer > 0 | This is the Internal Product ID given to the product by Aurora | One of at least ProductReference, ProductEAN, ProductID, VariationID must be provided |
VariationID | Integer > 0 | This is the Internal Variation ID given to the product by Aurora | One of at least ProductReference, ProductEAN, ProductID, VariationID must be provided |
StoreID | Integer > 0 | This is the Internal Store ID given to the product by Aurora | If StoreID is provided then StoreReference cannot be |
StoreReference | Alpha-numeric String | This is the Unique Store Reference set for the store in Aurora | If StoreReference is provided then StoreID cannot be |
Stock | Integer >= 0 | The current stock for the product or variation | This is optional unless a StoreID or StoreReference has been provided |
PreOrderStock | Integer >= 0 or blank | The current pre-order stock for the product or variation (pre-order stock levels are not supported at a Store level) | If StoreReference or StoreID have been provided then this field cannot be |
Updated 8 months ago