Fluent Commerce Logo
Docs
Sign In

Inventory Batch Events

Essential knowledge

Author:

Fluent Commerce

Changed on:

9 Feb 2025

Overview

Inventory Batch Events offer insights into the processing status of Inventory Batches, helping to determine whether the corresponding records within a batch were successfully submitted for processing.

Key points

  • Batch
    `CREATE`
    and
    `BATCH_COMPLETE`
    events provide insights into the processing status of Inventory Batches
  • The events can be used to measure the duration of Inventory Batch processing
  • Inventory Batch Events are currently not operational for inventory batches going through batch pre-processing

For each Inventory Batch that is submitted to the platform, a

`CREATE`
event is generated, indicating that the batch has been received. When all the corresponding records in an Inventory Batch have been processed a
`BATCH_COMPLETE`
event is generated. The
`generatedOn`
values in the events can be used to calculate the inventory load duration. The root entity of these events is
`JOB`
, and can be used to query for a collection of batches and their corresponding events. If multiple inventory batches are submitted for the same job, the overall job duration can be measured by using the
`generatedOn`
times of the earliest
`CREATE`
 event and the latest
`BATCH_COMPLETE`
event.


The generated events can be retrieved via the Event API providing the Job ID and optionally the Batch ID.

Example Event API query:

`https://{{accountId}}.api.fluentretail.com/api/v4.1/event?context.rootEntityType=JOB&context.rootEntityId=1&context.rootEntityType=JOB&context.entityId=2&context.entityType=BATCH`

1
2{
3  "id": "d134a570-4157-11ea-bc71-fdd97c11135c",
4  "name": "CREATE",
5  "type": "ORCHESTRATION",
6  "accountId": "TEST",
7  "retailerId": "1",
8  "category": "ORDER WORKFLOW",
9  "context": {
10    "sourceEvents": [],
11    "entityType": "BATCH",
12    "entityId": "2",
13    "entityRef": "2",
14    "rootEntityType": "JOB",
15    "rootEntityId": "1",
16    "rootEntityRef": "1"
17  },
18  "eventStatus": "PENDING",
19  "attributes": [
20    {
21      "name": "S3_bucket",
22      "value": "rubix-batch-inventory-ap-southeast-2-multi-sandbox",
23      "type": "STRING"
24    },
25    {
26      "name": "S3_object",
27      "value": "batch/account=TEST/type=INVENTORY/year=2020/month=01/date=27/1558-1580165601465",
28      "type": "STRING"
29    }
30  ],
31  "source": "Fluent-API",
32  "generatedBy": "retrailer",
33  "generatedOn": "2020-01-27T22:53:21.607+0000"
34}

Language: json

Name: Inventory Batch `CREATE` event example

Description:

Inventory Batch `CREATE` event example

1{
2  "id": "d1b01700-4157-11ea-b9f2-5fe6d7129603",
3  "name": "BATCH_COMPLETE",
4  "type": "ORCHESTRATION_AUDIT",
5  "accountId": "TEST",
6  "retailerId": "1",
7  "category": "BATCH",
8  "context": {
9    "sourceEvents": [
10      "d134a570-4157-11ea-bc71-fdd97c11135c"
11    ],
12    "entityType": "BATCH",
13    "entityId": "2",
14    "entityRef": "2",
15    "rootEntityType": "JOB",
16    "rootEntityId": "1",
17    "rootEntityRef": "1"
18  },
19  "eventStatus": "COMPLETE",
20  "attributes": null,
21  "source": null,
22  "generatedBy": "Rubix User",
23  "generatedOn": "2020-01-27T22:53:22.347+0000"
24}

Language: json

Name: Inventory Batch `BATCH_COMPLETE` event example

Description:

Inventory Batch `BATCH_COMPLETE` event example

Fluent Commerce

Fluent Commerce