Inventory
Inventory allows you to track stock quantity per SKU and optionally per supply channel.
Representations
InventoryEntry
id
- String
The unique ID of the inventory entry.version
- NumbercreatedAt
- DateTimecreatedBy
- CreatedBy BETA
Present on resources created after 2019-02-01 except for events not tracked.lastModifiedAt
- DateTimelastModifiedBy
- LastModifiedBy BETA
Present on resources updated after 2019-02-01 except for events not tracked.sku
- StringsupplyChannel
- Reference to a Channel - Optional
Connection to a particular supplier.quantityOnStock
- Number
Overall amount of stock. (available + reserved)availableQuantity
- Number
Available amount of stock. (available means:quantityOnStock
- reserved quantity)restockableInDays
- Number - Optional
The time period in days, that tells how often this inventory entry is restocked. Also used to overrideReserveOnOrder
InventoryMode to allow backorders on certain line items while orders for other line items with insufficient stock are blocked.expectedDelivery
- DateTime - Optional
The date and time of the next restock.custom
- CustomFields - Optional
InventoryEntryDraft
There can only be one inventory entry for the combination of sku and supplyChannel.
sku
- String - RequiredquantityOnStock
- NumberrestockableInDays
- Number - OptionalexpectedDelivery
- DateTime - OptionalsupplyChannel
- ResourceIdentifier of a Channel - Optionalcustom
- CustomFieldsDraft - Optional
The custom fields.
Get InventoryEntry by ID
Endpoint: /{projectKey}/inventory/{id}
Method: GET
OAuth 2.0 Scopes: view_products:{projectKey}
Response Representation: InventoryEntry
Query Inventory
Endpoint: /{projectKey}/inventory
Method: GET
OAuth 2.0 Scopes: view_products:{projectKey}
Response Representation: PagedQueryResult with results
containing an array of InventoryEntry
Query Parameters:
where
- Query Predicate - Optionalsort
- Sort - Optionalexpand
- Expansion - Optionallimit
- Number - Optionaloffset
- Number - Optional
Create an InventoryEntry
Endpoint: /{projectKey}/inventory
Method: POST
OAuth 2.0 Scopes: manage_products:{projectKey}
Request Representation: InventoryEntryDraft
Response Representation: InventoryEntry
Creating an InventoryEntry produces the InventoryEntryCreatedMessage.
Update an InventoryEntry
Endpoint: /{projectKey}/inventory/{id}
Method: POST
OAuth 2.0 Scopes: manage_products:{projectKey}
Response Representation: InventoryEntry
Fields:
version
- Number - Required
The expected version of the InventoryEntry on which the changes should be applied. If the expected version does not match the actual version, a 409 Conflict will be returned.actions
- Array of UpdateAction - Required
The list of update actions to be performed on the InventoryEntry.
Update actions
Add Quantity
Increments quantityOnStock
and updates availableQuantity
according to the new quantity and amount of active reservations.
action
- String -"addQuantity"
quantity
- Number
Remove Quantity
Decrements quantityOnStock
and updates availableQuantity
according to the new quantity and amount of active reservations.
action
- String -"removeQuantity"
quantity
- Number
Change Quantity
Sets quantityOnStock
and updates availableQuantity
according to the new quantity and amount of active reservations.
action
- String -"changeQuantity"
quantity
- Number
Set RestockableInDays
action
- String -"setRestockableInDays"
restockableInDays
- Number - Optional
Set ExpectedDelivery
action
- String -"setExpectedDelivery"
expectedDelivery
- DateTime - Optional
Set SupplyChannel
action
- String -"setSupplyChannel"
supplyChannel
- ResourceIdentifier of a Channel - Optional If absent, the supply channel is removed.This action will fail if an entry with the combination of sku and supplyChannel already exists.
Set Custom Type
This action sets or removes the custom type for an existing inventory entry. If present, this action overwrites any existing custom type and fields.
action
- String -"setCustomType"
type
- ResourceIdentifier of a Type - Optional
If absent, the custom type and any existing CustomFields are removed.fields
- * - Optional
A valid JSON object, based on the FieldDefinitions of the Type. Sets the custom fields to this value.
Set CustomField
action
- String -"setCustomField"
name
- String - Requiredvalue
- Value - Optional
Ifvalue
is absent ornull
, this field will be removed if it exists. Trying to remove a field that does not exist will fail with an InvalidOperation error. Ifvalue
is provided, set thevalue
of the field defined by thename
.
Delete an InventoryEntry
Endpoint: /{projectKey}/inventory/{id}
Method: DELETE
OAuth 2.0 Scopes: manage_products:{projectKey}
Deleting an InventoryEntry produces the InventoryEntryDeletedMessage.