POST
/
api-inventory
/
inventory
/
bulk-insert
curl --request POST \
  --url https://prod01-apigw.{customer_name}.fabric.zone/api-inventory/inventory/bulk-insert \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '[
  {
    "sku": "1597422",
    "itemId": 1597422,
    "totalQuantity": 25,
    "reservedQuantity": 0,
    "locationId": 175,
    "type": "Stock",
    "channelId": 12,
    "transitRef": "wo-2002",
    "transitOrderDate": "2019-12-14",
    "transitStockDate": "2019-12-14"
  }
]'
{
  "messages": [
    "Import Inventory job started: Mon Nov 02 2020 22:26:10 GMT+0000 (Coordinated Universal Time)"
  ],
  "keyId": "api-1604355970096",
  "type": "api",
  "status": "FINISHED",
  "totalItems": 1,
  "totalItemsUploaded": 1,
  "totalRows": 2,
  "totalRowsErrors": 2,
  "__v": 0,
  "_id": "5fee9d59f2f08a1b3cbdea08",
  "createdAt": "2020-12-31T02:09:53.914Z",
  "updatedAt": "2020-12-31T02:09:53.914Z"
}

Headers

x-site-context
string
required

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

x-api-key
string
Example:

"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"

Body

application/json · object[]
sku
string
required
Minimum length: 1
Example:

"1597422"

totalQuantity
number
required
Required range: x >= 0
Example:

25

reservedQuantity
number
required
Required range: x >= 0
Example:

0

locationId
number
required
Required range: x >= 0
Example:

175

type
enum<string>
required
Available options:
Stock,
Transit
Example:

"Stock"

itemId
number
Required range: x >= 1
Example:

1597422

channelId
enum<number>
Available options:
12,
13
Example:

12

transitRef
string
Example:

"wo-2002"

transitOrderDate
string
Example:

"2019-12-14"

transitStockDate
string
Example:

"2019-12-14"

Response

200
application/json
Inventory bulk insert
messages
string[]
keyId
string
Example:

"api-1604355970096"

type
string
Example:

"api"

status
string
Example:

"FINISHED"

totalItems
integer
Example:

1

totalItemsUploaded
integer
Example:

1

totalRows
integer
Example:

2

totalRowsErrors
integer
Example:

2

__v
number
Example:

0

_id
string
Example:

"5fee9d59f2f08a1b3cbdea08"

createdAt
string
Example:

"2020-12-31T02:09:53.914Z"

updatedAt
string
Example:

"2020-12-31T02:09:53.914Z"