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 - Number
  • createdAt - DateTime
  • lastModifiedAt - DateTime
  • sku - String
  • supplyChannel - Reference to a Channel - Optional
    Optional connection to 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.
  • 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 - Required
  • quantityOnStock - Number
  • restockableInDays - Number - Optional
  • expectedDelivery - DateTime - Optional
  • supplyChannel - Reference to a Channel - Optional
  • custom - CustomFieldsDraft - Optional
    The custom fields.

Get InventoryEntry by ID

Endpoint: /{projectKey}/inventory/{id}
Method: GET
OAuth2 Scopes: view_products:{projectKey}
Response Representation: InventoryEntry

Query Inventory

Endpoint: /{projectKey}/inventory
Method: GET
OAuth2 Scopes: view_products:{projectKey}
Response Representation: PagedQueryResult with the results array of InventoryEntry
Query Parameters:

Create an InventoryEntry

Endpoint: /{projectKey}/inventory
Method: POST
OAuth2 Scopes: manage_products:{projectKey}
Request Representation: InventoryEntryDraft
Response Representation: InventoryEntry

Update an InventoryEntry

Endpoint: /{projectKey}/inventory/{id}
Method: POST
OAuth2 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 - Reference - Optional A reference to an existing channel.

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.

This action overwrites any existing custom type and fields.

Set CustomField

Delete an InventoryEntry

Endpoint: /{projectKey}/inventory/{id}
Method: DELETE
OAuth2 Scopes: manage_products:{projectKey}

Deleting an InventoryEntry produces the InventoryEntryDeleted message.