Stripe API URL with parent / child parameters

Hi,

I’m trying to create a new payment link in Stripe using the API connector. However, I have to add child parameters to the URL but I can’t figure out how to implement it.

The example I’m working with:
I want to make a POST to https://api.stripe.com/v1/payment_links

According to the documentation of Stripe I need to add the line_items.price and line_items.quanitty as parameters to the URL. How can I add child parameters? I have tried about every combination of brackets, dots, etc but cannot get it working.

Thank you for your time!
~ A

It would be more like this:
https://api.stripe.com/v1/payment_links?price=[price]&quantity=[quantity]

I do not think you include the line_items and also you need to have an equal sign (=)

Hi William,

First of all, thanks for your reply. Unfortunately your solution does not work. When I try that I get the following API response.

Screenshot 2022-09-09 at 09.34.04

When I try my original solution (so anything with line_items in it), the Stripe API provides a response like below in which it suggests to use the line_items parameter. Perhaps you have any other ideas?

Screenshot 2022-09-09 at 09.34.46

Thanks again!
~ A

Hey @worktravels.com

So there’s a few ways to set up your API calls. I add my parameters to the body vs. the URL. It’s just a bit cleaner IMO.

Here’s a snapshot of the parameters (body) for an API call to the ‘Create Checkout Session’ endpoint. I know it’s a different endpoint, but the formatting is the same for the child parameters.

One other thing to note. Make sure you check the Queryst. box for each parameter or it won’t work.


Josh @ Support Dept
Helping no-code founders get unstuck fast :rocket:save hours, & ship faster with an expert :man_technologist: on-demand

I post daily about no-code and Bubble on Twitter Follow Support Dept on Twitter

1 Like

Yes, horrible isn’t it!

What you will probably need to do is put those parameters into the body and make sure they are formatted correctly … but the catch (if my old man foggy brain is correct) is you need to say it is JSON but don’t format it as JSON.

Give me a little bit to dig out something … I haven’t touched Bubble for a month :desert_island:

1 Like

Should have read this. I ALWAYS forget to tick this when doing a POST.

This too.

1 Like

My number one error when configuring Stripe API calls :man_facepalming: it gets me every time!


Josh @ Support Dept
Helping no-code founders get unstuck fast :rocket:save hours, & ship faster with an expert :man_technologist: on-demand

I post daily about no-code and Bubble on Twitter Follow Support Dept on Twitter

The level of swearing is off the chart.

“Can’t find parameter PRICE” …
“IT IS LITERALLY THERE CALLED PRICE”

1 Like

Thankfully the Stripe API can’t hear all the choice things said about it / it doesn’t have feelings (that we know of :joy:)


Josh @ Support Dept
Helping no-code founders get unstuck fast :rocket:save hours, & ship faster with an expert :man_technologist: on-demand

I post daily about no-code and Bubble on Twitter Follow Support Dept on Twitter

I wish I understood this area better.

Stripe wants to you have content-type as url-form-encoded.

But then you need to have JSON in the dropdown for the parameters not form :man_shrugging:

1 Like

I think the saving grace is that they are consistent, at least in my experience.

I wish I could say that about several other API providers. I’ve worked with some that make it up as they go along which is most likely due to a bunch of different people working on different parts but too scared to talk to each other. Here’s looking at you ActiveCampaign


Josh @ Support Dept
Helping no-code founders get unstuck fast :rocket:save hours, & ship faster with an expert :man_technologist: on-demand

I post daily about no-code and Bubble on Twitter Follow Support Dept on Twitter

1 Like

As above.

lineitems is an array. Assuming you only have one line item (otherwise you won’t be able to do it in the URL parameters if you have x line items) then you need to specify which lineitem in the array you are referring to.

Hence the lineitems[0]currency - which points at the first (and only) line item.

1 Like

This solution works. Thanks for thinking along everyone!

1 Like