Stripe SetupIntent

Hello,
I’m trying to set up an api post export to create a payment with Stripe.
https://stripe.com/docs/api/setup_intents/create
I want to be able to create a payment later and already have the client id and the payment method id (I will import them in API Export).
This corresponds to point 5 of this web page :
https://stripe.com/docs/payments/save-and-reuse#web
Here’s what I did:




I get a 400 error every time, can you enlighten me please?
Thank you and have a nice day :slight_smile:

btw the error message is :
{
“error”: {
“message”: "Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at https://support.stripe.com/.",
“type”: “invalid_request_error”
}
}

and the sent request is :
{
“auth”: {
“password”: “”,
“username”: “sk_test_******”
},
“data”: {
“amount”: “11000”,
“confirm”: “true”,
“currency”: “CAD”,
“customer”: “cus_H9RVJOw8s773Ln”,
“description”: “Prix facturr”,
“off_session”: “true”,
“payment_method”: “pm_1Gb8cWHqcmENqiSBpruKNUjD”,
“payment_method_types”: “card”
},
“headers”: {},
“method”: “POST”,
“url”: “https://api.stripe.com/v1/payment_intents
}

Ah that error is pointing out the problem then! Right now the API steps cannot send data x-www-form-urlencoded for normal requests, only request to get OAuth tokens.

There is a feature request to add this in that you can vote for here: Support for x-www-form-urlencoded headers

2 Likes