createInventory
post
/ccadmin/v1/inventories
Create inventory information.
Request
Supported Media Types
- application/json
Query Parameters
-
showTranslations(optional): string
show translations, boolean true or false; default false
Inventory request object.
Root Schema : createInventory_request
Type:
Show Source
object
-
availabilityDate(optional):
string
Availability date. Date format is an ISO standard such as yyyy-MM-dd.
-
backorderLevel(optional):
integer
Backorder level of the variant.
-
backorderThreshold(optional):
integer
Backorder threshold of the variant.
-
id:
string
ID of the inventory record.
-
locationId(optional):
string
ID of the location for which the inventory information is being created.
-
preorderLevel(optional):
integer
Preorder level of the variant.
-
preorderThreshold(optional):
integer
Preorder threshold of the variant.
-
stockLevel(optional):
string
Stock level of the variant.
-
stockThreshold(optional):
string
Stock threshold of the variant.
-
type(optional):
string
Inventory type, either variant or product, defaults to variant
Example:
{
"preorderThreshold":0,
"backorderLevel":0,
"preorderLevel":0,
"locationId":"loc1",
"availabilityDate":null,
"backorderThreshold":0,
"id":"sku123",
"stockThreshold":"10",
"type":"variant",
"stockLevel":"120"
}
Response
Supported Media Types
- application/json
200 Response
When locationId is not passed in the request body, a flat response will be returned with inventory properties appearing at the top of the response object.
When locationId is passed in the request body, the response will change to include a 'locationInventoryInfo' JSON object that contains location specific inventory information.
Root Schema : createInventory_response
Type:
Show Source
object
-
availabilityDate(optional):
string
Availability date of variant. Date format is an ISO standard such as yyyy-MM-dd.
-
availabilityStatus(optional):
integer
Availability status/ available count of the variant.
-
availabilityStatusMsg(optional):
string
Availability status message of the variant.
-
availableToPromise(optional):
string
Available to promise.
-
backorderLevel(optional):
integer
Backorder level of the variant.
-
backorderThreshold(optional):
integer
Backorder threshold of the variant.
-
displayName(optional):
string
Display name of the variant.
-
inventoryId(optional):
string
Inventory id of the variant.
-
locationId(optional):
string
Location id.
-
locationInventoryInfo(optional):
array locationInventoryInfo
-
preorderLevel(optional):
integer
Preorder level of the variant.
-
preorderThreshold(optional):
integer
Preorder threshold of the variant.
-
skuId(optional):
string
SKU id of the variant.
-
skuNumber(optional):
string
SKU number of the variant.
-
stockLevel(optional):
integer
Stock level of the variant.
-
stockThreshold(optional):
integer
Stock threshold of the variant.
Nested Schema : items
Type:
Show Source
object
-
availabilityDate(optional):
string
Availability date of variant. Date format is an ISO standard such as yyyy-MM-dd.
-
availabilityStatus(optional):
integer
Availability status/ available count of the variant.
-
availabilityStatusMsg(optional):
string
Availability status message of the variant.
-
availableToPromise(optional):
string
Available to promise.
-
backorderLevel(optional):
integer
Backorder level of the variant.
-
backorderThreshold(optional):
integer
Backorder threshold of the variant.
-
displayName(optional):
string
Display name of the variant.
-
inventoryId(optional):
string
Inventory id of the variant.
-
locationId(optional):
string
Location id.
-
preorderLevel(optional):
integer
Preorder level of the variant.
-
preorderThreshold(optional):
integer
Preorder threshold of the variant.
-
skuNumber(optional):
string
SKU number of the variant.
-
stockLevel(optional):
integer
Stock level of the variant.
-
stockThreshold(optional):
integer
Stock threshold of the variant.
Example Response (application/json)
{
"skuNumber":null,
"displayName":null,
"links":[
{
"rel":"self",
"href":"http://www.example.com/inventories/ccadminui/v1/inventories"
}
],
"locationInventoryInfo":[
{
"preorderThreshold":0,
"backorderLevel":0,
"displayName":null,
"availabilityDate":null,
"availabilityStatusMsg":"inStock",
"stockThreshold":10,
"stockLevel":120,
"availableToPromise":null,
"skuNumber":null,
"preorderLevel":0,
"locationId":"loc1",
"translations":null,
"inventoryId":null,
"backorderThreshold":0,
"availabilityStatus":1000
}
],
"skuId":"sku123"
}
Example Response (description)
Example response when locationId is passed in request.
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
Error Code / Description
------------------ ------------------
25120 / Internal inventory error
25121 / Missing sku id
25122 / Invalid properties map
25123 / Invalid property value
25126 / Inventory record not found
25127 / Location is invalid
25134 / Inventory operation not supported for type
25135 / Invalid type
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code