How to Implement Enhanced Inventory Attributes in Your Payloads
Author:
Fluent Commerce
Changed on:
18 Sept 2024
Overview
This guide is designed to help you implement the enhanced
`attributes`
`attributes`
Key points
- Flexible Attribute Structure: The object supports any combination of key-value pairs, including complex JSON structures and arrays. This flexibility allows you to customize the data sent in your inventory payloads to meet specific business needs.
`attributes`
- Recommended Attributes: Certain key attributes, such as ,
`expectedOn`
, and`storageAreaRef`
, are automatically integrated into our platform’s workflows. These fields will be directly updated in the inventory quantity associated with the incoming record, facilitating seamless integration with existing fields.`condition`
- Custom Attribute Availability: Any custom attributes that you include in the object will be available in workflows via
`attributes`
. This enables you to incorporate custom data into rule-based processes or other logic tailored to your business requirements.`inventoryPosition.inventoryQuantity.attributes.<fieldname>`
- ISO 8601 Date Format: For any date-related attributes, it is recommended to use the ISO 8601 format (e.g., ) to ensure consistency and proper handling within the system.
`YYYY-MM-DDTHH:MM:SSZ`
- Integration with Workflows: The system is designed to handle both recommended and custom attributes, making them accessible within the workflow context. This ensures that you can leverage these attributes in custom rules and other logic, depending on the specific needs of your implementation.
- Extensibility: While the table of recommended attributes provides a useful starting point, you are encouraged to extend the object with any additional fields relevant to your business processes. The flexibility of this structure allows for robust customization.
`attributes`
Leveraging Recommended Attributes
While the
`attributes`
`expectedOn`
`storageAreaRef`
`condition`
Flexibility for Custom Attributes
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`
Recommended Attributes Table
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
|
Example payload with enhanced inventory payload via Batch API ( BPP enabled)
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
Example payload with enhanced inventory payload for direct updates via INVENTORY_UPDATE event
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