createInventory

post

/ccadmin/v1/inventories

Create inventory information.

Request

Supported Media Types
Query Parameters
Body ()
Inventory request object.
Root Schema : createInventory_request
Type: object
Show Source
Example:
{
    "preorderThreshold":0,
    "backorderLevel":0,
    "preorderLevel":0,
    "locationId":"loc1",
    "availabilityDate":null,
    "backorderThreshold":0,
    "id":"sku123",
    "stockThreshold":"10",
    "type":"variant",
    "stockLevel":"120"
}
Back to Top

Response

Supported Media Types

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.
Body ()
Root Schema : createInventory_response
Type: object
Show Source
Nested Schema : locationInventoryInfo
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
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
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top