Set inventories
POST
/merchants/{merchantCode}/inventories
const url = 'https://catalog.shopgate.io/v1/merchants/example/inventories';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"inventories":[{"productCode":"someCode","locationCode":"DERetail1","inventoryTreatmentSetting":{"code":"its1"},"sku":"54nf444","onHand":4,"safetyStock":1,"bin":"1203","binLocation":"1203-4","status":"active","externalUpdateDate":"2018-12-15T00:00:23.114Z"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://catalog.shopgate.io/v1/merchants/example/inventories \ --header 'Content-Type: application/json' \ --data '{ "inventories": [ { "productCode": "someCode", "locationCode": "DERetail1", "inventoryTreatmentSetting": { "code": "its1" }, "sku": "54nf444", "onHand": 4, "safetyStock": 1, "bin": "1203", "binLocation": "1203-4", "status": "active", "externalUpdateDate": "2018-12-15T00:00:23.114Z" } ] }'Set inventory for multiple products
Note: The location has to be set up first.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”merchantCode
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
inventories
required
Array<object>
object
productCode
required
Human readable code of the entity
string
Example
someCodelocationCode
required
string
Example
DERetail1inventoryTreatmentSetting
object
code
required
string | null
Example
its1sku
required
Stock keeping unit
null | string
Example
54nf444onHand
null | number
Example
4safetyStock
null | number
Example
1bin
Bin. (Location in warehouse)
null | string
Example
1203binLocation
Bin location.
null | string
Example
1203-4status
string
Example
activeexternalUpdateDate
null | string format: date-time
Example
2018-12-15T00:00:23.114ZResponses
Section titled “Responses”Successfully set
Media typeapplication/json
object
errors
required
Array<object>
object
code
number
entity
string
entityId
string | object
entityIndex
integer
reason
string
catalogCode
string
subentityPath
Array<string | number>
validationErrors
Array<object>
object
code
Machine readable error code
string
message
Human readable error code
string
description
string
path
Array<string>
Example
{ "errors": [ { "code": 400, "entity": "planet", "entityId": "pluto", "entityIndex": 1, "reason": "Planet pluto was not found (did you mean dwarf planet pluto?)", "subentityPath": [ "categories", 0 ], "validationErrors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } ]}Validation error
Media typeapplication/json
object
statusCode
number
message
string
code
string
additionalInfo
object
validationErrors
Array<object>
object
code
number
reason
string
entity
string
entityId
string
subentityPath
Array<string | number>
error
object
paramName
The parameter-field, that failed to validate, like “userId”
string
paramValue
The value, that was sent, like “xxx”
null | string | number | array | object
code
Machine readable error code
string
message
required
Human readable error code
string
results
object
errors
Array<object>
object
code
Machine readable error code
string
message
Human readable error code
string
description
string
path
Array<string>
warnings
array
Example
{ "error": { "code": "SCHEMA_VALIDATION_FAILED", "results": { "errors": [ { "code": "MAX_LENGTH", "message": "Name too long", "description": "Property Name is too long", "path": [ "name" ] } ] } }}Merchant, location or product not found
Media typeapplication/json
object
statusCode
number
code
required
string
message
required
string
Example
{ "code": "NotFound", "message": "Merchant not found"}
