I’m having trouble returning data from an API call on the backend in Bubble. My API lists subscription charges and returns a JSON with several nested objects, including an array called split
. When I make this call on the client side, all data returns correctly. However, when I run this call on the backend and pass the response to the client, some fields come through as blank — specifically, the objects within split
.
I noticed that if I remove the []
brackets from the split
array in the JSON, the data appears on the backend, but this changes the JSON structure, which is not what I want. My goal is to keep the split
array and all nested objects within a single backend response, so the client receives everything properly formatted.
Here is an example of the full JSON that the API returns:
{
"object": "list",
"hasMore": false,
"totalCount": 1,
"limit": 50,
"offset": 0,
"data": [
{
"object": "payment",
"id": "pay_yisjdasio12012",
"dateCreated": "2024-10-23",
"customer": "cus_000005320924",
"subscription": "sub_bdqyg71gs718",
"value": 12.6,
"netValue": 11.74,
"description": "Plano Top",
"billingType": "CREDIT_CARD",
"creditCard": {
"creditCardNumber": "0280",
"creditCardBrand": "MASTERCARD"
},
"status": "REFUNDED",
"dueDate": "2024-10-23",
"invoiceUrl": "https:/url.com",
"split": [
{
"id": "523422b-9328e-4938f-80c7-cbfas872dac",
"walletId": "dc408b19-f36c-4619-ae58-8hjyg27d",
"fixedValue": 1.99,
"percentualValue": 5,
"totalValue": 2.57,
"status": "CANCELLED"
}
],
"refunds": [
{
"dateCreated": "2024-10-30 17:07:56",
"status": "DONE",
"value": 12.6
}
]
}
]
}
I’d like to keep this full JSON structure so that split and refunds (and any other nested objects) are displayed correctly on the client side when the call is made through the backend. Has anyone experienced a similar thing? Is there a way to force Bubble to keep nested objects intact on the backend?
Thanks for any help!