Cant get the API call to accept a list of arrays

im trying to make a stripe configuration for the customer portal throw an API and the call is initialized with a single array in the list of price ids.. but as soon as i try to set a list of entry i get the error "code": "resource_missing",

i dont know what im doing wrong here.. can anyone help?

Do you have link to api doc? Seem you are sending the list as parameters, so pretty sure it’s not set correctly. Also, can you share API connector settings?

hi @Jici

link is here: Create a portal configuration | Stripe API Reference

The issue with your settings is this is not dynamic.
Instead of using the params. you could use the json body (or set it to raw body) and set the content-type header to application/x-www-form-urlencoded.
I prefer to use a plugin to convert a JSON to url params (JSON Serialize to URL query Plugin | Bubble … created by me for a case like stripe). It’s easier to manage in JSON. But this can be done without too.

Take time to search forum about Stripe array. There’s already a lot of solutions.

The main issue with a lot of solutions is the incremental array numbering that cannot be done easily with Bubble. The plugin take care of that.

1 Like

hi again @Jici

i am already using the content-type header application/x-www-form-urlencoded

and the one you are refering to here: How do I include an array in a querystring in the API connector? (Stripe API) - #4 by roman.leeb is also already how im doing it by using the array features[subscription_update][products][0][prices][] for first product and features[subscription_update][products][1][prices][] for second product, as the doc tells me to do.. so my issue is that for each of these products there is 2 price id’s montly and yearly.. and they are both stored in the bubble DB as an attribute under an optionset for each plan

first line is as you see here for the product called “TaskForce Basis”

and when formatting this as a text i try to make it as a list item there contains each price id:


and then trying to do the same for the product called “TaskForce Pro”

The format as text you are using doesn’t look correct but it’S hard to know without the output result. What I suggest you to try, is to send to a service like requestbin or beeceptor and inspect your request. This will be easier to debug and find where it fail

hmm..


in beeceptor i get this error :thinking: what does that mean?

did you keep the beeceptor page open and ready to receive? What did you set in API connector for the url?

it was some settings in the beeceptor i had to run off..

{
  "features[subscription_update][enabled]": "true",
  "features[subscription_update][default_allowed_updates][]": "price",
  "features[subscription_update][products][0][prices][]": "\"price_1RG3T5Gdaeoq0vQ582UFY6we\", \"price_1RG3U6Gdaeoq0vQ5UsbsYJiS\"",
  "features[payment_method_update][enabled]": "true",
  "features[subscription_update][products][1][prices][]": "\"price_1RG3h2Gdaeoq0vQ5MpeVL8Z1\", \"price_1RG3hwGdaeoq0vQ5Eql7dO96\", ",
  "features[subscription_update][products][1][product]": "prod_S77QzAh85ecb8q",
  "features[subscription_update][products][0][product]": "prod_S77PSwEMjYUJ6Q"
}

this is the response im getting with this call in beeceptor

I think your issue is the prices that contain more than 1 and are “espaced” with
Pretty sure that each prices should have is own parameters features[subscription_update][products][0][prices][]

as far as i can see in the doc each product id should have its own parameter
so it will be:
features[subscription_update][products][0][product]
features[subscription_update][products][1][product]

and then each price id belonging to that product should be listed in each of these parameters like this:

features[subscription_update][products][0][prices][]: "price_1RG3T5Gdaeoq0vQ582UFY6we", "price_1RG3U6Gdaeoq0vQ5UsbsYJiS"

and

features[subscription_update][products][1][prices][]": "price_1RG3h2Gdaeoq0vQ5MpeVL8Z1", "price_1RG3hwGdaeoq0vQ5Eql7dO96"


that is what i understand by this in the docs

An array of string in stripe should be like I said.
Each item in the “prices” array, it’s own features[subscription_update][products][0][prices][]=
What is different, is that you don’t need to increment the prices [] because it’s not an object.
Hardcode it directly in API connector (o postman) and test it if you think it should work with a CSV in prices. If not, test it like I’ve suggested.

{
  "features[subscription_update][enabled]": "true",
  "features[subscription_update][default_allowed_updates][]": "price",
  "features[payment_method_update][enabled]": "true",
  "features[subscription_update][products][0][prices]": "price_1RG3U6Gdaeoq0vQ5UsbsYJiS",
  "features[subscription_update][products][1][prices]": "price_1RG3hwGdaeoq0vQ5Eql7dO96",
  "features[subscription_update][products][1][product]": "prod_S77QzAh85ecb8q",
  "features[subscription_update][products][0][product]": "prod_S77PSwEMjYUJ6Q"
}

so im now trying to make a parameter for each price line but the result is still only comming back with one price ID

I don’t see the whole payload so I don’t know what is the issue.

Hey @christian_bargmann try returning the entire JSON with the workflow step. It will be easier to debug and see what works/doesn’t.

Basically there should just be 1 Key Value Pair and play with the JSON.

im not sure what jason you mean?

I just tested it and it worked:

Try sending everything in Body type: Raw (application/x-www-form-urlencoded):

features[subscription_update][enabled]=true&features[subscription_update][default_allowed_updates][]=price&features[payment_method_update][enabled]=true&features[subscription_update][products][0][prices][0]=_*_price_0_*_&features[subscription_update][products][0][product]=_*_product_0_*_&features[subscription_update][products][1][prices][0]=_*_price_1_*_&features[subscription_update][products][1][product]=_*_product_1_*_

If you need more than one price for the same product, just add prices][1], prices][2], etc.
You can also omit product and only send prices (Stripe will infer the product from the price ID).

Double‑check you’re not mixing test IDs with live keys (and vice‑versa).

1 Like

The issue with your settings (but this depend of the case) is that you are stuck with a specific length for array. It’s not dynamic. But it could work if you always have the same number of items in array.

1 Like

hmm..
im not sure i understand what you guys mean..

i asked stripes AI and they say the JSON should look like this

and now im trying to make the parameters with a JSON file instead of form data there now look like this:

but i get the error of missing a parameter “feature”

i dont get when you say its not dynamic is i show you here in this post it is dynamic data there comes in;