Fluent Commerce Logo
Docs

Inventory Catalogue Workflow Interface Contracts

Interface Contract

Changed on:

27 Nov 2024

Detailed Description

The below Interface Contracts document the interaction points with the Inventory Catalogue workflow. These allow you to ensure that any integration made into the workflow will enable the workflow to work correctly.

UpdateInventoryQty Event

This event is used anytime an external (anything from outside this workflow) creation of inventory quantities is triggered.

Request Payload

PropertyDescriptionTypeRequired?
itemsThe list of items whose inventory positions to be updatedListRequired
Item Definition
PropertyDescriptionTypeRequired?Notes
fulfilmentIdThe fulfilment ID against which the inventory quantities are to be created/updatedStringRequired
skuRefThe SKU reference of the inventory positionStringRequired
locationRefThe SKU reference of the inventory positionStringRequired
reservedQtyThe count of RESERVED quantitiesIntRequiredOnly required when reserve stock
correctionQtyThe count of CORRECTED quantitiesIntRequiredOnly required when confirm a fulfilment
saleQtyThe count of SALE quantitiesIntRequiredOnly required when confirm a fulfilment
cancelQtyThe count of CANCELLED quantitiesIntRequiredOnly required when cancel a fulfilment

Event Request Example

1{
2    "name": "UpdateInventoryQty",
3    "retailerId": "<retailerId>",
4    "entityRef": "<IC_ref>",
5    "entityType": "INVENTORY_CATALOGUE",
6    "entitySubtype": "<IC_type>",
7    "rootEntityType": "INVENTORY_CATALOGUE",
8    "rootEntityRef": "<IC_ref>",
9    "attributes": {
10        "items": [
11            {
12                "skuRef": "<skuRef>",
13                "locationRef": "<locationRef>",
14                "fulfilmentId": "100",
15                "quantity": 0,
16                "reserveQty": "-5",
17                "correctionQty": 0,
18                "saleQty": 0
19            }
20        ]
21    }
22}
`
`

InventoryChanged Event

This event is generated by the Inventory Batch API.WarningAny need to trigger an InventoryChanged update should only be done via the Batch API.

Request Payload

PropertyDescriptionTypeRequired?
inventoryPositionThe inventory position that has changedObjectRequired

`inventoryPosition` Definition
PropertyDescriptionTypeRequiredNotes
`ref`The inventory position referenceStringOptionalFormat: `locationRef:productRef`
`productRef`The product reference associated with the inventory positionStringRequired
`locationRef`The location reference associated with the inventory positionStringRequired
`qty`The quantity associated with the inventory positionIntegerRequired
`correctedQty`The corrected quantityIntegerOptional
`inventoryQuantity`Additional inventory quantity dataObjectOptionalContains custom quantity details and attributes

`inventoryQuantity` Definition

PropertyDescriptionTypeRequiredNotes
`qty`Quantity of the custom inventory quantityIntegerOptional
`ref`Reference for the custom inventory quantityStringOptional
`type`Type of the custom inventory quantityStringOptionalE.g., `"PURCHASE_ORDER"`
`status`Status of the custom inventory quantityStringOptionalE.g., `"ACTIVE"`
`attributes`Custom attributes for the custom inventory quantityObjectOptionalContains key-value pairs for additional data
1{
2  "name": "InventoryChanged",
3  "accountId": "<accountId>",
4  "retailerId": "<retailerId>",
5  "entityRef": "<inventoryCatalogRef>", 
6  "entityType": "INVENTORY_CATALOGUE",
7  "entitySubtype": "<inventoryCatalogType>",
8  "rootEntityType": "INVENTORY_CATALOGUE", 
9  "rootEntityRef": "<inventoryCatalogRef>", 
10  "source": "your-batch-source", // Optional
11  "attributes": {
12    "inventoryPosition": {
13      "ref": "LOC1:SKU1", // Optional, format: "locationRef:productRef"
14      "productRef": "SKU1",
15      "locationRef": "LOC1",
16      "qty": 40,
17      "correctedQty": 0, // Optional
18      "inventoryQuantity": { // Optional
19          "qty": 40, // Optional
20          "ref": "SKU1:LOC1:DEFAULT", // Optional
21          "type": "PURCHASE_ORDER", // Optional
22          "status": "ACTIVE", // Optional
23          "attributes": {
24          "expectedOn": "2024-11-30T00:00:00.00Z", // Optional
25          "storageAreaRef": "LOC1-SR2", // Optional
26          "condition": "NEW" // Optional
27        }
28      }
29    }
30  }
31}
32