Hey everyone,
I’m making an API call to fetch order data from an e-commerce site. The response structure has two levels , where an order contains multiple order items. Here’s an example:
{
"orderId": "123456",
"customerName": "John Doe",
"orderDate": "2024-03-03T12:00:00Z",
"totalAmount": 150.75,
"orderItems": [
{
"itemId": "A1B2C3",
"productName": "T-Shirt",
"quantity": 2,
"price": 25.50
},
{
"itemId": "D4E5F6",
"productName": "Sneakers",
"quantity": 1,
"price": 80.00
},
{
"itemId": "G7H8I9",
"productName": "Baseball Cap",
"quantity": 3,
"price": 10.25
}
]
}
I need to create two types of things in Bubble:
- Order (storing orderId, customerName, totalAmount, etc.)
- Order Item (storing itemId, productName, quantity, price and Order.)
I’m struggling with how to iterate over the order items and correctly associate them with the parent order in the database.
Any advice would be greatly appreciated! Thanks in advance.