Hi Ankur1, did you manage to create a session with a dynamic amount of line_items ? Can you share the syntax of your solution, please?
Thanks for your reply !
In the meantime, I baked myself a solution for that same problem that only relies on Bubble’s expressions, not other plugin or javascript required.
Here’s how:
My case here concerns the line items object on Stripe Checkout Sessions but it’s exactly the same process for other list of objects that must be passed as url-encoded.
in the API Connector, I use JSON Dynamic Value to set the query string entirely that I can then modify in the workflow interface.
In the workflow I use a list that contains Basket Items (with Product, Price, Quantity) and format it as text as shown below to create the query string.
I hope this approach can be useful to some of you guys.
Happy Bubbling
A little tricky but I was able to build on @axel.duheme to get the final solution. If you need to get the line item # to fill out the [] I had to do a search for the order items that were created and then count all of the ones which had a smaller created date then the item -1 to get the 0,1,2,3,4 for the [].
You can see an example here
I also attached the order item filtering here
Not sure if this is the best way but it worked for me!
Also, if anyone needs. Here is the text that goes into the <line_items>
line_items[][price_data][currency]=USD&line_items[][quantity]=1&line_items[][price_data][unit_amount]=100&line_items[][price_data][tax_behavior]=exclusive&line_items[][price_data][product_data][name]=Test
But how do I initialize first in the api connector? I am having the same issue with Mindbody api