Hi everyone,
I’m struggling with nested arrays coming from a webhook and I’m pretty sure I’m overcomplicating it.
Context
I receive a JSON payload via a Custom Webhook It contains:
-
data.request.request_variants[]– the variants (labels are identical across all suppliers) -
data.suppliers[]– an array of suppliers -
Each supplier has
offer.variants[] -
Each variant has a
prices[]array withct_per_kwh(price as string) – or an empty array if no price was submitted.
I want to calculate, per variant label, the sorted list of prices across all suppliers (lowest to highest), treating missing prices as 999.
Later I just need the 5 lowest prices per variant, but the core issue is getting a clean, sorted array per variant at all.
Sample payload
This is what I’m sending to my Make webhook for testing:
curl -X POST "https://hook.example.com/test-webhook" \
-H "Content-Type: application/json" \
-d '[
{
"event_group": "tender",
"event_id": "request_awarded",
"data": {
"request": {
"request_id": "REQ123ABC",
"request_url": "https://app.example.com/customer/requests/REQ123ABC",
"energy_type": "gas",
"energy_type_label": "Gas",
"energy_total": 70000,
"pocs_count": 2,
"flexibility_up": 15,
"flexibility_down": -15,
"fixed_price": true,
"spot_market": true,
"spot_market_share": [0],
"tranche_model": false,
"tranche_count": null,
"provision": "0.5",
"delivery_period": {
"start": "01.01.2026",
"end": "31.12.2026"
},
"date_of_award": "10.11.2025",
"start_of_award_period": "12:00",
"end_of_award_period": "14:00",
"request_variants": [
{
"status": "rejected",
"name": null,
"additional_year": false,
"eco_energy": false,
"label": "Gas (Fossil)",
"separate_pricing": false
},
{
"status": "rejected",
"name": null,
"additional_year": false,
"eco_energy": true,
"label": "Biomethane",
"separate_pricing": false
},
{
"status": "rejected",
"name": null,
"additional_year": true,
"eco_energy": false,
"label": "Gas (Fossil) + Extra year",
"separate_pricing": false
},
{
"status": "rejected",
"name": null,
"additional_year": true,
"eco_energy": true,
"label": "Biomethane + Extra year",
"separate_pricing": false
}
]
},
"user": {
"user_id": 31,
"company_id": 14,
"salutation": "Mr",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"created_at": "06.10.2025",
"role": "customer"
},
"customer": {
"company_id": 14,
"company_name": "Customer Test Ltd",
"contact_persons": [
{
"user_id": 31,
"salutation": "Mr",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role": "Editor"
},
{
"user_id": 31,
"salutation": "Mr",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role": "Signer 1"
}
]
},
"suppliers": [
{
"supplier_id": 11,
"company_name": "Supplier A Ltd",
"contact_persons": [
{
"user_id": 23,
"salutation": "Mr",
"first_name": "Alan",
"last_name": "Smith",
"email": "alan.smith@supplier-a.example.com",
"role": "Editor"
}
],
"offer": {
"variants": [
{
"label": "Gas (Fossil)",
"status": "rejected",
"prices": []
},
{
"label": "Biomethane",
"status": "rejected",
"prices": []
},
{
"label": "Gas (Fossil) + Extra year",
"status": "rejected",
"prices": []
},
{
"label": "Biomethane + Extra year",
"status": "rejected",
"prices": []
}
]
},
"status": "loser"
},
{
"supplier_id": 5,
"company_name": "Supplier B AG",
"contact_persons": [
{
"user_id": 8,
"salutation": "Ms",
"first_name": "Emma",
"last_name": "Brown",
"email": "emma.brown@supplier-b.example.com",
"role": "Editor"
}
],
"offer": {
"variants": [
{
"label": "Gas (Fossil)",
"status": "selected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "6",
"meter_type": null
}
]
},
{
"label": "Biomethane",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "6",
"meter_type": null
}
]
},
{
"label": "Gas (Fossil) + Extra year",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "5.4",
"meter_type": null
}
]
},
{
"label": "Biomethane + Extra year",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "5.5",
"meter_type": null
}
]
}
]
},
"status": "winner"
},
{
"supplier_id": 3,
"company_name": "Supplier C GmbH",
"contact_persons": [
{
"user_id": 7,
"salutation": "Mr",
"first_name": "Chris",
"last_name": "Miller",
"email": "chris.miller@supplier-c.example.com",
"role": "Editor"
}
],
"offer": {
"variants": [
{
"label": "Gas (Fossil)",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "25",
"meter_type": null
}
]
},
{
"label": "Biomethane",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "28",
"meter_type": null
}
]
},
{
"label": "Gas (Fossil) + Extra year",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "26",
"meter_type": null
}
]
},
{
"label": "Biomethane + Extra year",
"status": "rejected",
"prices": [
{
"type": "EnergyPrice",
"baseline": null,
"ct_per_kwh": "27",
"meter_type": null
}
]
}
]
},
"status": "loser"
}
],
"transaction_timestamp": "2025-11-10 12:07:32"
}
}
]'
My goal is something like this:
[
{
"label": "Gas (Fossil)",
"prices": [6, 25, 999] // sorted, 999 = missing
},
{
"label": "Biomethane",
"prices": [6, 28, 999]
},
{
"label": "Gas (Fossil) + Extra year",
"prices": [5.4, 26, 999]
},
{
"label": "Biomethane + Extra year",
"prices": [5.5, 27, 999]
}
]
Any ideas?
Thanks
Max




