This API sets the inventory count for a product at a particular location. These requests are placed into a queue of jobs that are processed one at a time. Due to this, the best practice is to submit fewer requests with more items per call, rather than numerous requests with a small number of items each.
The maximum number of items that can be sent in one refresh request is 12000, and the total amount should be provided in intervals of 3000 when possible. Due to how these jobs are processed, a request with 6001 items is much less efficient than a request with 6000 items. For example, instead of sending 21000 individual requests with one item each, it would be best to send two calls with 12000 and 9000 items each. Submitting inventory this way reduces the possibility of a bottleneck caused by an overabundance of small jobs being submitted.
Note that there are two endpoints that may be used. Each endpoint is associated with a different API key related to a package – either an “Inventory V5” or “Inventory Specific” package. The Inventory Specific package is the preferred endpoint to use, but some implementations may use Inventory V5 depending on their configuration.
In either case, the request body and parameter schemas outlined in this guide are the exact same as in the previous version of OMS, as the Unified Commerce platform supports backwards compatibility for this API. The only change to this request is the format of the base endpoints, as shown in the below table. Remember to provide the x-vol-tenant key for authentication in the headers.
V5 Production URL | https://{tenantId}-translation.mozu.com/api/v5/inventory/refresh |
V5 Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v5/inventory/refresh |
Inventory Specific Production URL | https://{tenantId}-translation.mozu.com/inv/api/v5/inventory/refresh/ |
Inventory Specific Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/inv/api/v5/inventory/refresh/ |
Supported Formats | JSON |
HTTP Method | POST |
Example
The example case will refresh an inventory with the following properties:
- Location named “Location 1”
- Item 101010 refreshed with a quantity of 101
Required Parameters
Refreshing an order requires:
Parameter | Type | Description |
locationName | string | Name of the location to refresh items at. The minimum length is 1. |
items | array | List of items to refresh. The maximum length is 1000. |
The items array is built as an object (/[object]) with the following parameters. The quantity and either partNumber, UPC, or SKU are required.
Parameter | Type | Description |
partNumber | string | The product part number. The minimum length is 1. |
upc | string | The product’s Universal Product Code. The minimum length is 1. |
sku | string | The product’s Stock Keeping Unit code. The minimum length is 1. |
binID | integer | Bin Location Identifier. The minimum value is “1”. |
quantity | integer | The quantity of the product. The minimum value is “0”. |
ltd | number | Custom field used for store prioritization. |
floor | integer | Absolute minimum quantity of this item that should be in stock at any time. |
safetyStock | integer | Quantity of this item the location wants to keep in stock to ensure stock isn’t completely depleted. |
currencyID | integer | The currency identifier for the retailPrice. |
retailPrice | number | The price of the item. |
inventoryLocatorName | string | An identifier to indicate where a particular SKU exists within a location. For example, “Aisle 5” would indicate that the bin this item belongs to is located in Aisle 5. The maximum length is 50. |
Inventory Attributes
Some configurations make use of inventory attributes, such as those that use inventory replenishment relationships. In this case, the Refresh Inventory API has been extended to take in attributes at the item level. If the attributes indicated in the request do not exist in the current inventory map for the item, then they are added. If they do exist, then they are updated.
An item can have a maximum of 63 attributes. They must be provided in an array of strings, as per the example below.
"attributes": ["TEST1", "TEST2", "TEST3", "TEST6", "TEST7"]
The Full Request
This is the entire request that will refresh an inventory (without attributes).
{ "locationName": "Location 1", "items": [ { "partNumber": "101010", "sku": "101010", "quantity": "101" }] }
The Full Response
The response will only return a jobID in the form of an integer.
{ "jobID": 01234567 }