Author:
Fluent Commerce
Changed on:
23 Sept 2024
Direct Inventory Updates are one of the two reference ways to send last-on-hand inventory updates into your inventory workflows. Direct Inventory Updates are best used when you have a small volume of inventory updates (maximum of 1000 updates).
Author:
Fluent Commerce
Changed on:
23 Sept 2024
Direct Inventory Updates are one of the two reference ways to send last-on-hand inventory updates into your inventory workflows. Direct Inventory Updates are best used when you have a small volume of inventory updates (maximum of 1000 updates).
As part of the Inventory Module, we have provided a reference implementation. This includes the workflow JSON, rules, & configurations required to implement direct inventory updates.
Direct updates are designed for use when the number of Inventory updates is quite small, less than 1000. Using direct updates results in quicker processing of inventory vs. batch uploads when operating at these lower inventory volumes.
Direct updates are best used in conjunction with batch inventory updates. When a specific job has 1000 or fewer updates, direct updates should be used; if the job has more than 1000 updates, the batch should be used.
Capability | Description |
API to send the events against |
Guide | Description |
Learn how to send delta inventory updates via events | |
Learn how to use Inventory Batches and follow the suggested best practices |
Author:
Fluent Commerce
Changed on:
23 Sept 2024
For use of authentication please read: Authentication
The returned token will be used for later API calls.
To send a direct update you need to ensure your data matches the below type. This will be a JSON object with the defined fields populated.
Parameter | Description | Data Type |
ref | ref | String |
type | The inventory position type | String |
productRef | The ref of the variant product associated with the inventory position | String |
locationRef | The location ref associated with the inventory position | String |
qty | The quantity | Integer |
correctedQty | corrected quantity | Integer |
inventoryQuantity | Extra optional attributes sent as part of the payload | JSON |
1{
2 "name": "INVENTORY_UPDATE",
3 "accountId": "YOUR_ACCOUNT",
4 "retailerId": "1",
5 "entityRef": "DEFAULT:2",
6 "entityType": "INVENTORY_CATALOGUE",
7 "entitySubtype": "DEFAULT",
8 "rootEntityType": "INVENTORY_CATALOGUE",
9 "rootEntityRef": "DEFAULT:2",
10 "attributes":
11 {
12 "inventoryUpdates":
13 [
14 {
15 "ref" : "testref1",
16 "productRef": "D45",
17 "locationRef": "LOC_MEL",
18 "qty": 350,
19 "correctedQty":0,
20 "type":"DEFAULT"
21 }
22 ]
23 }
24}
Language: json
Name: Example payload
Description:
Example inventory payload with no attributes for INVENTORY_UPDATE event .
Author:
Fluent Commerce
Changed on:
18 Sept 2024
This guide is designed to help you implement the enhanced
`attributes`
`attributes`
`attributes`
`expectedOn`
`storageAreaRef`
`condition`
`attributes`
`inventoryPosition.inventoryQuantity.attributes.<fieldname>`
`YYYY-MM-DDTHH:MM:SSZ`
`attributes`
While the
`attributes`
`expectedOn`
`storageAreaRef`
`condition`
Beyond the recommended attributes, you have the flexibility to include additional fields that are specific to your business requirements. Whether you need to send simple key-value pairs, nested JSON structures, or arrays, our system will process these and make them available within the workflow via
`inventoryPosition.inventoryQuantity.attributes.<fieldname>`
The table below provides examples of the recommended attributes along with their descriptions, usage, and examples. However, you are not limited to these fields—you can extend the
`attributes`
Attribute Description | Recommended Attribute Key Name | Example | Notes |
Specific storage locations in a warehouse. |
| "LOC1-SR-1" | Available in the workflow via
|
Date when new stock is expected. |
| "2024-10-31T00:00:00.00Z" | Available in the workflow via
|
Information on the manufacturing country. |
| "France" | Available in the workflow via
Alternate field name for this madeIn |
Details like production date and location. |
| { "batchNumber": "BATCH001", "productionDate": "2024-01-15T00:00:00.00Z" } | Available in the workflow via
|
Indicates the last date a product is safe to use. |
| "2025-12-31T23:59:59.00Z" | Available in the workflow via
|
Unique identifier for each supplier. |
| "SUP12345" | Available in the workflow via
|
Details on how inventory is quantified. Use Case: Ensure consistency in inventory counting, aid in order fulfillment, and simplify stocktaking processes. |
| "PCS" | Available in the workflow via
|
Unique identifier for high-value items. |
| "SN123456789" | Available in the workflow via
|
Links inventory to specific purchase orders. |
| "PO987654321" | Available in the workflow via
|
Source of inventory transfer. |
| "STORE01" | Available in the workflow via
|
Purpose of the inventory. |
| "For Sale" | Available in the workflow via
|
Indicates the condition of the inventory item. |
| "NEW" | Available in the workflow via
|
1{
2 "action": "UPSERT",
3 "entityType": "INVENTORY",
4 "source": "SAP_ERP",
5 "event" :"InventoryChanged",
6 "entities": [
7 {
8 "locationRef": "LOC_MEL",
9 "skuRef": "D45",
10 "qty": 350,
11 "correctedQty": 0,
12 "retailerId": 2,
13 "attributes": {
14 "expectedOn": "2024-10-31T00:00:00.00Z", // ISO 8601 format
15 "storageAreaRef": "LOC_MELB_RET2-SR1",
16 "condition": "NEW",
17 "countryOfOrigin": "China",
18 "expiryDate": "2025-12-31T23:59:59.00Z", // ISO 8601 format
19 "supplierId": "SUP12345",
20 "unitOfMeasurement": "PCS",
21 "serialNumber": "SN123456789",
22 "purchaseOrderNumber": "PO987654321",
23 "transferFrom": "STORE01",
24 "inventoryPurpose": "For Sale",
25 "manufacturingBatchInfo": {
26 "batchNumber": "BATCH001",
27 "productionDate": "2024-01-15T00:00:00.00Z" // ISO 8601 format
28 }
29 }
30
31 }
32
33 ]
34}
Language: json
Name: Example payload with enhanced inventory payload via Batch API
Description:
Example payload with enhanced inventory payload via Batch API
1
2{
3 "name": "INVENTORY_UPDATE",
4 "accountId": "YOUR_ACCOUNT",
5 "retailerId": "1",
6 "entityRef": "DEFAULT:2",
7 "entityType": "INVENTORY_CATALOGUE",
8 "entitySubtype": "DEFAULT",
9 "rootEntityType": "INVENTORY_CATALOGUE",
10 "rootEntityRef": "DEFAULT:2",
11 "attributes":
12 {
13 "inventoryUpdates":
14 [
15 {
16 "ref" : "testref1",
17 "productRef": "D45",
18 "locationRef": "LOC_MEL",
19 "qty": 350,
20 "correctedQty":0,
21 "type":"DEFAULT" ,
22 "inventoryQuantity": {
23 "attributes": {
24 "expectedOn": "2024-10-31T00:00:00.00Z", // ISO 8601 format
25 "storageAreaRef": "LOC_MELB_RET2-SR1",
26 "condition": "NEW",
27 "countryOfOrigin": "China",
28 "expiryDate": "2025-12-31T23:59:59.00Z", // ISO 8601 format
29 "supplierId": "SUP12345",
30 "unitOfMeasurement": "PCS",
31 "serialNumber": "SN123456789",
32 "purchaseOrderNumber": "PO987654321",
33 "transferFrom": "STORE01",
34 "inventoryPurpose": "For Sale",
35 "manufacturingBatchInfo": {
36 "batchNumber": "BATCH001",
37 "productionDate": "2024-01-15T00:00:00.00Z" // ISO 8601 format
38 }
39 }
40 }
41 ]
42 }
43}
Language: json
Name: Example payload with enhanced payload for direct updates via INVENTORY_UPDATE event
Description:
Example payload with enhanced payload for direct updates via INVENTORY_UPDATE event
Author:
Fluent Commerce
Changed on:
23 Sept 2024
This document provides guidelines for handling message size limitations when sending inventory updates via the
`INVENTORY_UPDATE`
When sending inventory updates through the
`INVENTORY_UPDATE`
The number of inventory updates that can fit into a single message depends on the size of each update, which varies based on the number and size of the attributes. A typical inventory update, similar to the following sample payload, is approximately 1.2 KB.
Sample Payload Structure:
1{
2 "name": "INVENTORY_UPDATE",
3 "accountId": "YOUR_ACCOUNT",
4 "retailerId": "1",
5 "entityRef": "DEFAULT:2",
6 "entityType": "INVENTORY_CATALOGUE",
7 "entitySubtype": "DEFAULT",
8 "rootEntityType": "INVENTORY_CATALOGUE",
9 "rootEntityRef": "DEFAULT:2",
10 "attributes": {
11 "inventoryUpdates": [
12 {
13 "ref": "testref1",
14 "productRef": "D45",
15 "locationRef": "LOC_MEL",
16 "qty": 350,
17 "correctedQty": 0,
18 "type": "DEFAULT",
19 "inventoryQuantity": {
20 "attributes": {
21 "expectedOn": "2024-10-31T00:00:00.00Z",
22 "storageAreaRef": "LOC_MELB_RET2-SR1",
23 "condition": "NEW",
24 "countryOfOrigin": "China",
25 "expiryDate": "2025-12-31T23:59:59.00Z",
26 "supplierId": "SUP12345",
27 "unitOfMeasurement": "PCS",
28 "serialNumber": "SN123456789",
29 "purchaseOrderNumber": "PO987654321",
30 "transferFrom": "STORE01",
31 "inventoryPurpose": "For Sale",
32 "manufacturingBatchInfo": {
33 "batchNumber": "BATCH001",
34 "productionDate": "2024-01-15T00:00:00.00Z"
35 }
36 }
37 }
38 }
39 ]
40 }
41}
42
Language: json
Name: Sample INVENTORY_UPATE payload
Description:
[Warning: empty required content area]`
`
A typical inventory update like the example above is 1.2 KB. This estimate is based on average-sized strings for fields like
`refs`
`dates`
`IDs`
Given the 200KB size limit, approximately 160-170 inventory updates can be included in a single message, depending on attribute sizes. This estimate includes a small buffer for variability in attribute size.
Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.