Newer Version Available

This content describes an older version of this product. View Latest

Availability Records, Upload

Asynchronously upload inventory data to Omnichannel Inventory and check the status of upload jobs.

Available resources are:

Resource Description
/commerce/oci/availability-records/uploads POST - Upload an inventory availability data file to Omnichannel Inventory.
/commerce/oci/availability-records/uploads/uploadId GET - Retrieve the status of an inventory availability upload job.
Resource
1/commerce/oci/availability-records/uploads
Available version
51.0
HTTP methods
POST
Request parameters for POST
Parameter Name Type Description Required or Optional Available Version
fileUpload Binary JSON file containing inventory availability data. Required 51.0

To create an inventory data file, format the data as a series of JSON entries representing locations and individual inventory records.

Inventory Import Data Considerations:

  • Separate the top-level entries with line feeds, not commas. Each entry must be on a single line.
  • When the system reads a location entry, it assigns the subsequent inventory entries to that location until it reads another location entry.
  • For each location entry, specify "mode":"UPDATE".
  • Each inventory record entry requires a unique recordId. Best practice is to use a UUID. The record Id protects against importing duplicate data.
  • Each inventory record entry requires an effectiveDate.
  • Each futures entry requires a nonzero quantity and a future expectedDate.
  • The system only creates or updates entries that are included in the data. It doesn’t delete entries that aren’t included. However, if an included entry has an empty value, that value is deleted.

The file size limit is 10 MB, and it must be in NDJSON format. For larger data sets, you can use the headless Commerce API or split the data into multiple files. The headless Commerce API accepts GZIP or JSON files up to 100 MB in size.

Note

This example illustrates the data format:

For readability, this example shows the first few entries on multiple lines. In the import file, each location and inventory record entry must be on a single line.

Note

1{
2  "location":"Warehouse-A",  // location identifier
3  "mode":"UPDATE"  // must be UPDATE (other operations might be available in future releases)
4}
5{
6  "recordId":"0a87539d-f3dd-47bc-91c7-9c752e39dbe0",  // unique identifier for the inventory record
7  "onHand":10,
8  "sku":"12389156",
9  "effectiveDate":"2020-12-08T14:05:22.790896-07:00",
10  "futures":[  // list of future restocks
11    {
12    "quantity":1,
13    "expectedDate":"2021-04-18T14:05:22.781-07:00"
14    },
15    {
16    "quantity":5,
17    "expectedDate":"2021-05-18T14:05:22.781-07:00"
18    }
19  ],
20  "safetyStockCount":0
21}
22{
23  "recordId":"0a87539d-f3dd-47bc-91c7-9c752e312345",
24  "onHand":10,
25  "sku":"9485728",
26  "effectiveDate":"2020-12-08T14:05:22.790896-07:00",
27  "futures":[
28    {
29    "quantity":10,
30    "expectedDate":"2021-04-18T14:05:22.781-07:00"
31    }
32  ],
33  "safetyStockCount":0
34}
35{"location":"Warehouse-B","mode":"UPDATE"}
36{"recordId":"0a87539d-f3dd-47bc-91c7-9c75abc123de","onHand":10,"sku":"12389156","effectiveDate":"2020-12-08T14:05:22.790896-07:00","futures":[{"quantity":1,"expectedDate":"2021-04-18T14:05:22.781-07:00"}],"safetyStockCount":0}
37{"recordId":"0a87539d-f3dd-47bc-91c7-9c75abc98765","onHand":10,"sku":"93867201","effectiveDate":"2020-12-08T14:05:22.790896-07:00","futures":[{"quantity":5,"expectedDate":"2021-04-18T14:05:22.781-07:00"}],"safetyStockCount":0}
Response body for POST
OCI Upload Inventory Availability Output
Resource
1/commerce/oci/availability-records/uploads/uploadId
Available version
51.0
HTTP methods
GET
Response body for GET
OCI Upload Inventory Availability Status Output