API Data not showing - API Woocommerce + Booking

Hello everybody!

I’m having trouble accessing some data from my API call.

I’m connecting Bubble with my wordpress site + woocommerce + booking plugin.

I want to access some data that are inside the following structure:

Purchase order > List of reserved products (“line_itens”) > Details of this reservation (“meta_data”)

A sample of the call:

{
    	"order_id": 20160,
    	"status": "processing",
    	"date_created": "2022-09-04T15:33:02",
    	"total": "312.00",
    	"payment_method": "credit-card",
    	"line_items": [{
    		"id": 2813,
    		"name": "Scuba Diving - Island Cedro",
    		"product_id": 11111,
    		"quantity": 1,
    		"subtotal": "312.00",
    		"total": "312.00",
    		"meta_data": [{
    				"id": 63349,
    				"key": "Number of persons",
    				"value": "4",
    				"display_key": "Número de pessoas",
    				"display_value": "4"
    			},
    			{
    				"id": 63350,
    				"key": "ph_bookings_participant_booking_data",
    				"value": [{
    					"participant_label": "Mergulhador",
    					"participant_count": "4"
    				}],
    				"display_key": "ph_bookings_participant_booking_data",
    				"display_value": [{
    					"participant_label": "Mergulhador",
    					"participant_count": "4"
    				}]
    			},
    			{
    				"id": 63351,
    				"key": "From",
    				"value": [
    					"2022-09-08 14:00"
    				],
    				"display_key": "From",
    				"display_value": [
    					"2022-09-08 14:00"
    				]
    			},
    			{
    				"id": 63352,
    				"key": "Reservado de",
    				"value": "08/09/2022 14:00",
    				"display_key": "Reservado de",
    				"display_value": "08/09/2022 14:00"
    			},
    			{
    				"id": 63353,
    				"key": "To",
    				"value": [
    					"2022-09-08 14:00"
    				],
    				"display_key": "To",
    				"display_value": [
    					"2022-09-08 14:00"
    				]
    			},
    			{
    				"id": 63354,
    				"key": "Reservado para",
    				"value": "08/09/2022 16:00",
    				"display_key": "Reservado para",
    				"display_value": "08/09/2022 16:00"
    			},
    			{
    				"id": 63355,
    				"key": "Cost",
    				"value": "1040",
    				"display_key": "Cost",
    				"display_value": "1040"
    			},
    			{
    				"id": 63356,
    				"key": "person_as_booking",
    				"value": [
    					"yes"
    				],
    				"display_key": "person_as_booking",
    				"display_value": [
    					"yes"
    				]
    			},
    			{
    				"id": 63362,
    				"key": "booking_status",
    				"value": [
    					"paid"
    				],
    				"display_key": "booking_status",
    				"display_value": [
    					"paid"
    				]
    			},
    			{
    				"id": 63363,
    				"key": "Status da reserva",
    				"value": "Pago",
    				"display_key": "Status da reserva",
    				"display_value": "Pago"
    			},
    			{
    				"id": 63364,
    				"key": "_is_ph_deposits",
    				"value": "yes",
    				"display_key": "_is_ph_deposits",
    				"display_value": "sim"
    			},
    			{
    				"id": 63365,
    				"key": "_ph_deposits_full_amount",
    				"value": "1040",
    				"display_key": "Total Payable",
    				"display_value": "1040"
    			},
    			{
    				"id": 63366,
    				"key": "_ph_deposits_full_amount_ex_tax",
    				"value": "1040",
    				"display_key": "Total Payable (excluding tax)",
    				"display_value": "1040"
    			},
    			{
    				"id": 63367,
    				"key": "_ph_deposit_deposits_amount_ex_tax",
    				"value": "312",
    				"display_key": "Deposit (excluding tax)",
    				"display_value": "312"
    			},
    			{
    				"id": 63368,
    				"key": "_ph_deposit_remaining_amount_ex_tax",
    				"value": "728",
    				"display_key": "Future Payments (excluding tax)",
    				"display_value": "728"
    			},
    			{
    				"id": 63369,
    				"key": "_ph_deposits_payment_plan",
    				"value": "0",
    				"display_key": "_ph_deposits_payment_plan",
    				"display_value": "0"
    			}
    		],
    		"price": 312,
    		"parent_name": null
    	}],
    	"tax_lines": [],
    	"shipping_lines": [],
    	"fee_lines": [],
    	"coupon_lines": []
    }

The most important data are all under the field names “value” and “display_value”

But I don’t know why I was able to recover some of your data and some of it didn’t

For exemple:
The data from the “Keys”: “To”, “From”, “person_as_booking” and “booking_status” I was able to access your “values”

But everything else the “value” result came “Empty”

Backed Repeating Group setup:

Sample of front end result:

Any idea why is this happening and how could I solve it?

Thank you in advance

When I click to see the raw data:

I Can see the values and results there, but not when I try to retrieve them on the frontend

What I found stange is the 17 after the metadata.
Can you share a full results of the detected DATA in API Connector
and the full json payload in raw?

Hello @Jici ! Thank you for your time.

Follow a print screen:
Tell me if that’s what you asked for

All already tried to set the fields Value and Display value detected by Bubble in all the available ways.
Leaving it blank, displaying both as list, displaying one as list and another blank, ignoring the chield filds, etc…

Can you share your setting for Repeating group itself? (maybe you will need to update it after the reinitialize API call)

Repeating Group - Calling the meta_data where the value and display_value fields are:

Here I’m just calling each value (note that the “VALUE” here isn’t treated as a list, but it could if I set it as a list in the Bubble call):

As I set the Display_value as a list, the setup here is different (LABEL and COUNT):

If you look now, it’s no more 17 but 18…
There’s a problem. Is it a bug? Maybe.
I suggest first to create a fresh new call (don’t duplicate it).
Retry with the new call. you shouldn’t have to modify anything in the payload type except date and image probably.

If this doesn’t work, create a support ticket. I don’t see any issue in the payload that may explain that. (but would be easier to have it so I can use some other debug tool).

1 Like

Thanks @Jici.

It might be a problem with the source of the API too.

I’ll keep investigating. Thank you again for your time

1 Like