Author:
Fluent Commerce
Changed on:
12 Feb 2025
Authors:
Girish Padmanabha, Kirill Gaiduk
Changed on:
25 Mar 2026
Authors:
Girish Padmanabha, Kirill Gaiduk
Changed on:
23 Mar 2026
`attributes` object to include additional data in inventory payloads. It supports both simple key-value pairs and custom JSON structures to meet diverse business requirements - whether you’re:`attributes` 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`associationType`, `associationRef`, `parentRef`, `expectedOn`, `expiresOn`, `condition`, `storageAreaRef`, `supplier`, `manufacturer`, `manufacturerBatchNumber`, `countryOfOrigin`, and `channel`) will be directly updated in the Inventory Quantity associated with the incoming record, facilitating seamless integration with existing fields`segment1`, `segment2`, and `segment3` provide flexibility for additional flat classification data without introducing new custom attributes`attributes` object will be available in workflows via `inventoryPosition.inventoryQuantity.attributes.<fieldName>`. This enables you to incorporate custom data into rule-based processes or other logic tailored to your business requirements`UpsertInventoryQuantity` rule, meaning they can be stored and used in workflows without additional mapping logic. Using these attributes ensures that payloads remain aligned with the reference inventory data model and supports common inventory scenarios such as:`segment1``segment2``segment3`| Attribute key | Description | Example | Use case(s) | Notes |
`associationType` | Defines the type of operational or business entity linked to the Inventory Quantity | `PURCHASE_ORDER` |
|
|
`associationRef` | Identifies the specific operational or business record linked to the Inventory Quantity | `POREF1` |
| Use with `associationType` to anchor the Inventory Quantity to an external business event or document |
`parentRef` | Links the Inventory Quantity to a parent Inventory Quantity to model a hierarchy | `PRDREF1:LOCREF1:DEFAULT:ON_ORDER` |
| Useful when modeling derived inventory states such as reservations under a specific parent quantity |
`expectedOn` | Indicates when the Inventory Quantity is expected to become available | `2026-05-01T00:00:00Z` |
|
|
`expiresOn` | Indicates when the Inventory Quantity expires or becomes ineligible for allocation | `2026-12-31T23:59:59Z` |
|
|
`condition` | Describes the physical or operational condition of the inventory | `NEW` |
| Common examples include new, refurbished, and damaged |
`storageAreaRef` | Identifies the storage area where the Inventory Quantity is held within a location | `LOCREF1:SAREF1` |
| Useful for representing storage-specific inventory context inside a single location |
`supplier` | Identifies the supplier associated with the Inventory Quantity | `SUPREF1` |
| Enables supplier-level inventory segmentation and sourcing decisions across inventory pools |
`manufacturer` | Identifies the manufacturer associated with the Inventory Quantity | `MANREF1` | Manufacturer traceability across segmented inventory pools | Often used together with `manufacturerBatchNumber` |
`manufacturerBatchNumber` | Captures the manufacturer batch identifier for the Inventory Quantity | `MBN1` |
| Supports batch-level traceability and quality isolation scenarios |
`countryOfOrigin` | Identifies the country where the inventory was produced or sourced | `AU` |
| Supports compliance, regulatory, and market-eligibility sourcing scenarios |
`channel` | Identifies the sales channel associated with the Inventory Quantity | `ONLINE` | Allocate and manage stock by sales channel | Channel differentiation is primarily expressed through reservations and customer-facing availability views |
`segment1-3` | Flexible segmentation fields for additional inventory classification | `PROMO` | Additional physical or commercial segmentations | Use for flat extensions when a dedicated supported attribute does not fit the business meaning |
`attributes` object.Custom attributes are useful when the payload needs to represent:`inventoryPosition.inventoryQuantity.attributes.<fieldName>`. However, processing these attributes typically requires custom workflow logic or rules, as they are not automatically mapped by the reference `UpsertInventoryQuantity` rule.This allows you to incorporate your custom data into rule-based processes or other logic tailored to your specific business scenarios.| Prefer | Instead of |
`expiresOn` | `expiryDate` |
`supplier` | `supplierId` |
`manufacturerBatchNumber` | custom batch identifiers |
`segment1-3` | new flat custom attributes |
`associationRef`, `parentRef`, `expectedOn`, `expiresOn`, `condition,` `segment1-3`) are not evaluated as part of this comparison. If an update changes only these attributes and does not modify `qty` or `status`, the record may be treated as unchanged and filtered from processing.1POST/{{fluent.account.host}}/api/v4.1/job1{
2 "name": "Batch Inventory Job",
3 "retailerId": "1",
4 "meta": {
5 "preprocessing": "enabled"
6 }
7} 1{
2 "id": "199"
3}`id` is the unique identifier of the created job`id` to use in subsequent batch requests`id` to group related batches`meta` object allows for the inclusion of additional metadata when creating a Job. The currently supported key within `meta` is `preprocessing`, which can influence whether the Batch Preprocessing Process (BPP) is utilized based on the account's settings.The behavior of the `meta.preprocessing` key is governed by the `fc.enable.batch.preprocessing` configuration setting. Below is a table outlining the expected behavior:`fc.enable.batch.preprocessing `value | `meta.preprocessing` Value | Additional Info in Job Payload | Result |
| true | "preprocessing": "skip" | BPP should not be used | Do not use BPP |
| true | "preprocessing": "enabled" | BPP should be used | Use BPP |
| true | "meta": null or "meta": {} | BPP should be used | Use BPP |
| true | Omitted or previously created Jobs | BPP should be used | Use BPP |
| false | Any value | BPP should not be used (overridden) | Do not use BPP |
`fc.enable.batch.preprocessing` is `true`:`meta` `fc.enable.batch.preprocessing` is `false`:`meta.preprocessing` value (including `null` or omitted)`meta.preprocessing` value. If fc.enable.batch.preprocessing is set to `FALSE`, BPP will not be used regardless of the `meta.preprocessing` value.`meta.preprocessing`, only the supported values (`"skip"` or `"any value not skip"`) are used to avoid unexpected behavior.1POST/{{fluent.account.host}}/api/v4.1/job/{jobID}/batch| Field | Type | Mandatory? | Possible Values | Default Value | Description | Notes |
| action | String | ✅ | "UPSERT" | N/A | Specifies the operation on inventory entities (e.g., "UPSERT" to insert/update). | Must be a valid action type for inventory operations. |
| entityType | String | ✅ | "INVENTORY" | N/A | Defines the type of entity being processed. | Must be "INVENTORY". |
| source | String | ❌ | Any valid source identifier | "batch" | Identifies the origin of the batch data (e.g., "ERP", "POS"). | Defaults to "batch" if not provided. |
| event | String | ❌ | Any valid event name | "InventoryChanged" | Custom event name associated with the batch operation. | Defaults to "InventoryChanged" if not provided. |
| catalogueRef | String | ❌ | Any valid catalogue reference | "DEFAULT:<retailerId>" | References the catalogue associated with the inventory batch. | Influences `catalogueType` in `ref` construction. |
| conditions | Object | ❌ | Configuration object | Uses default transient settings | Configurations like transient types and statuses are used in de-duplication checks. | |
| entities | Array | ✅ | List of inventory items | N/A | List of inventory items | Follows the entities object model. Nonconforming inputs are ignored. |
| Field | Type | Mandatory? | Possible Values | Default Value | Description |
| hasRelatedInventoryQuantities | Array | ❌ | List of transient IQ types and statuses | Default transient types and statuses | Defines custom transient types and statuses for checking during de-duplication eg) `"hasRelatedInventoryQuantities": ``[`` {"type": "SALE", "status": "ACTIVE"}, ``{"type": "SALE", "status": "CREATED"}, ``{"type": "CORRECTION", "status": "ACTIVE"} ``]` |
`entities` array should follow this structure:| Field | Type | Mandatory? | Possible Values | Constraints | Description | Notes |
| locationRef | String | ✅ | Any valid location reference | N/A | The location reference used to match the inventory. | |
| skuRef | String | ✅ | Any valid SKU reference | N/A | The SKU reference of the inventory item. | |
| qty | Integer | ✅ | Any non-negative integer | N/A | The quantity to match the on-hand inventory. | |
| correctedQty | Integer | ❌ | Any non-negative integer | Defaults to 0 if not provided | The current outstanding correction quantity to be saved. | |
| type | String | ❌ | Any valid type identifier | N/A | Specifies the type of inventory operation (e.g., "LAST_ON_HAND"). | Defaults to "LAST_ON_HAND" if not provided. |
| ref | String | ❌ | Any valid reference | Must follow `<skuRef>:<locationRef>:<catalogueType>:<type>` | A reference identifier for the inventory entity. | If not provided, constructed using `skuRef`, `locationRef`, `catalogueType`, and `type`. |
| status | String | ❌ | Any valid status value | N/A | The status of the inventory entity (e.g., "ACTIVE"). | |
| retailerId | String | ✅ | Any valid retailer ID | N/A | The retailer ID for which the inventory is uploading. | |
| attributes | Object | ❌ | Any complex key-value pairs | Keys must be strings; values can be any valid JSON type | Additional attributes for flexible metadata storage. |
1{
2 "action": "UPSERT",
3 "entityType": "INVENTORY",
4 "source": "ERP",
5 "event" :"InventoryChanged",
6 "catalogueRef": "DEFAULT:1",
7 "conditions": {
8 "hasRelatedInventoryQuantities": [
9 {"type": "SALE", "status": "ACTIVE"},
10 {"type": "SALE", "status": "CREATED"},
11 {"type": "CORRECTION", "status": "ACTIVE"}
12 ]
13 },
14 "entities": [
15 {
16 "retailerId": 1,
17 "skuRef": "PRDREF1",
18 "locationRef": "LOCREF1",
19 "ref": "PRDREF1:LOCREF1:DEFAULT:LAST_ON_HAND:1",
20 "qty": 100,
21 "attributes": {
22 "countryOfOrigin": "AU",
23 "manufacturerBatchNumber": "MBN1",
24 "expiresOn": "2026-09-30T23:59:59Z"
25 }
26 },
27 {
28 "retailerId": 1,
29 "skuRef": "PRDREF1",
30 "locationRef": "LOCREF1",
31 "ref": "PRDREF1:LOCREF1:DEFAULT:LAST_ON_HAND:2",
32 "qty": 50,
33 "attributes": {
34 "countryOfOrigin": "US",
35 "manufacturerBatchNumber": "MBN2",
36 "expiresOn": "2026-12-31T23:59:59Z"
37 }
38 },
39 {
40 "retailerId": 1,
41 "skuRef": "PRDREF1",
42 "locationRef": "LOCREF1",
43 "type": "ON_ORDER",
44 "ref": "PRDREF1:LOCREF1:DEFAULT:ON_ORDER:1",
45 "qty": 300,
46 "attributes": {
47 "associationType": "PURCHASE_ORDER",
48 "associationRef": "POREF1",
49 "expectedOn": "2026-06-01T00:00:00Z"
50 }
51 },
52 {
53 "retailerId": 1,
54 "skuRef": "PRDREF1",
55 "locationRef": "LOCREF1",
56 "type": "ON_ORDER",
57 "ref": "PRDREF1:LOCREF1:DEFAULT:ON_ORDER:2",
58 "qty": 150,
59 "attributes": {
60 "parentRef": "PRDREF1:LOCREF1:DEFAULT:ON_ORDER:1",
61 "associationType": "IN_TRANSIT",
62 "associationRef": "ITREF1",
63 "expectedOn": "2026-03-01T00:00:00Z",
64 "countryOfOrigin": "US",
65 "manufacturerBatchNumber": "MBN3",
66 "expiresOn": "2027-12-31T23:59:59Z"
67 }
68 }
69 ]
70}`LAST_ON_HAND` inventory segmented by origin, batch, and expiry date`IN_TRANSIT` future inventory record linked to the purchase order through `parentRef`1{
2 "id": "331"
3}`id` is used to check the inventory batch status in subsequent calls1GET/{{fluent.account.host}}/api/v4.1/job/{jobID}1{
2 "jobId": "199",
3 "status": "OPEN",
4 "batch": [
5 {
6 "batchId": "331",
7 "status": "COMPLETE",
8 "createdOn": "2022-10-06T00:31:08.104+0000"
9 }
10 ],
11 "createdOn": "2022-10-06T00:31:08.104+0000"
12}1GET/{fluent.account.host}/api/v4.1/job/{jobID}/batch/{batchID}1{
2 "batchId": "331",
3 "entityType": "INVENTORY",
4 "status": "COMPLETE",
5 "start": 1,
6 "count": 10,
7 "total": 0,
8 "results": [],
9 "createdOn": "2022-10-06T00:36:09.344+0000"
10}