#Rodrigo (Tookyer)
1 messages ยท Page 1 of 1 (latest)
Stripe doesn't work with JSON. You need to send us form-encoded request bodies. This is mentioned here https://stripe.com/docs/api
understood, can you give me an example of this body sending name and email?
I know nothing about the tool you are using to make API requests, but it says "body type: JSON" in your screenshot, which won't work with Stripe.
no problem! I will try it here. I am using bubble.io api connector to do it.
Worked! Thanks ๐
@ashen elk I have re-opened this thread
Thank you Pompy!
i am trying to send the address fields but it dont work
When i send name and email, it works well, but with the address i receive the error 400
Can you show me the request body you are sending when you get that error?
Oh gotcha
Looking in to this. I forget the syntax with Postman, I think it should be the same for cURL
I think so hehe
i will use this call in bubble.io
there i am using this requisition
with the same problem, when i remove the address, it works well
i think the problem are the structure of the child field
using json, it's like:
{
{"address":
{"address.country":"BR",}
}
}
but I dont know how to translate it into a url-enconded
Yeah. I rmemver knowing how to do that at a point. Can you try address[country]? I think that is the syntax somewhere
Interesting because that worked for me in my test.
-d description="Test Customer" \
-d address[country]="US"```
hum... let check here
Oh wait that error message is different though!
It is saying it recognized the key but not the value
worked hehehe
Glad I could help!
Pompey, last question...
do you know how i set the "preferred_locales" on the requisition?
preferred_locales=pt-BR;
I tried it, but didnt worked
Can you try preferred_locales[]
It is supposed to be an array, the error is about how you are directly passing a value
Hi ๐
It looks like the array is still incorrectly formatted.
I'm not certain how to do it in Postman
But can you share the request ID so I can check what the arguments came to our API looking like?
i am using the parameters like this: address[state]=SP;
sure
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
sorry,
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
this is the correct
The problem is you are passing the parameter as an object. This is what our API got {pt-BR: "pt-BR"}
Try just preferred_locales[] in the key
You are currently using preferred_locales[pt-BR] which is why it is sent to our API as an key: value object instead of an array
Happy we could get it worked out ๐