Hi all — I’m trying to transform incoming order line items into structured order payloads in, and could use some help getting the data transformation right.
### Input Data
This is the data being sent into my webhook. It’s a flat array of order line items. Each has a transaction_number (which acts like an order ID), and I want to group these into orders with their respective line items.
[
{
"id": 101001,
"upc": "123456789012",
"quantity": 48,
"order_type": "R",
"item_number": 10001,
"customer_type": "L",
"customer_number": 11111,
"transaction_type": "BO",
"delivery_datetime": "2025-06-18T05:00:00Z",
"transaction_number": "TX100001",
"transaction_datetime": "2025-06-16T17:46:12Z",
"delivery_instructions": "Back entrance"
},
{
"id": 101002,
"upc": "123456789013",
"quantity": 24,
"order_type": "R",
"item_number": 10002,
"customer_type": "L",
"customer_number": 22222,
"transaction_type": "BO",
"delivery_datetime": "2025-06-18T05:00:00Z",
"transaction_number": "TX100002",
"transaction_datetime": "2025-06-16T16:24:57Z",
"delivery_instructions": "Leave at reception"
},
{
"id": 101003,
"upc": "123456789014",
"quantity": 24,
"order_type": "R",
"item_number": 10003,
"customer_type": "L",
"customer_number": 11111,
"transaction_type": "BO",
"delivery_datetime": "2025-06-18T05:00:00Z",
"transaction_number": "TX100001",
"transaction_datetime": "2025-06-16T17:46:12Z",
"delivery_instructions": "Back entrance"
}
]
Desired Final Output
For each unique transaction_number, I want to POST a single order payload that looks like this:
TX100001 (has 2 items):
{
"topic": "order_create",
"order": {
"id": null,
"transaction_number": "TX100001",
"order_type": "R",
"customer_type": "L",
"customer_name": null,
"customer_number": "11111",
"transaction_date": "2025-06-16T17:46:12Z",
"delivery_date_requested": "2025-06-18T05:00:00Z",
"delivery_instructions": "Back entrance",
"time_stamp": "2025-06-26T14:10:25.402Z",
"order_items": [
{
"order_item_id": 101001,
"quantity_requested": 48,
"product_number": "10001",
"upc": "123456789012"
},
{
"order_item_id": 101003,
"quantity_requested": 24,
"product_number": "10003",
"upc": "123456789014"
}
]
}
}
TX100002 (1 item):
{
"topic": "order_create",
"order": {
"id": null,
"transaction_number": "TX100002",
"order_type": "R",
"customer_type": "L",
"customer_name": null,
"customer_number": "22222",
"transaction_date": "2025-06-16T16:24:57Z",
"delivery_date_requested": "2025-06-18T05:00:00Z",
"delivery_instructions": "Leave at reception",
"time_stamp": "2025-06-26T14:10:25.402Z",
"order_items": [
{
"order_item_id": 101002,
"quantity_requested": 24,
"product_number": "10002",
"upc": "123456789013"
}
]
}
}
What I need help with
I’m looking for the best way to transform the grouped array into this JSON structure. I’ve already used an [Array Aggregator] module to group items by transaction_number, so I’m working with a bundle that contains the array of items for each order. I’ve also used the [Text Aggregator] to transform the field name and shape the JSON file the way I want it. The issue now is that I can’t get the array of items to list out properly. I am quite new to this world.
If you’ve tackled something like this, I’d love your insight .
Thanks in advance!