I’m trying to integrate Stripe’s Checkout Session API in my Bubble app to dynamically handle a service and multiple addon purchases. The core functionality I’m aiming for is to pass 1 service and 5 dynamically selected addons into the line_items array of the Checkout Session API call.
What I’ve Tried:
Hardcoding one line item works, but dynamic line items seem to cause the issue.
I’ve double-checked that each addon has a valid Stripe Price ID stored in my database.
The dynamic expression for the price field seems to be causing issues when more than one addon is selected.
Questions:
How should I structure the line_items array in the API call to handle multiple dynamic addons?
Is there a specific way to format dynamic data in the API Connector for Stripe that I might be missing?
Has anyone successfully passed multiple dynamic line items to Stripe’s Checkout Session API using Bubble’s API Connector? If so, how did you handle retrieving and formatting dynamic Stripe Price IDs?
Any guidance or examples would be greatly appreciated!
Make the whole line item object in api call dynamic. Then depending on the liat, use ‘’‘format as text’‘’ on list qnd build each line item dynamically. You cant find the line item object in api doc for strip.
The line item itself is an array , object have currly braket {}.
It would be like this.
“Line_item” : [
Item01: { items details and parameters},
Item02: { items details and parameters},
Item03: { items details and parameters},
]
You don’t create it with the plugin, you create it in JSON and let the plugin serialize the JSON.
For line item, you already have the json in your body that is created. What you can do is to add a parameters “line_items”
And in this parameter you will put the result of the plugin
Your line item in the plugin will be something like[Do a search for line item:formatted as text]
In the formatted as text, you will put in the first box something like
I’ve read a lot of forum posts about problems with line_items but I’m still stuck.
My initialize call is correct, I have the data displayed.
key : line_items
value : line_items[0][price]=price_1Q16iIBG8gDoGKFTHszpB2SN&line_items[0][quantity]=2&line_items[1][price]=price_1Q16ioBG8gDoGKFTt6kpNWO3&line_items[1][quantity]=10&