#Venkat - SF REST API
1 messages · Page 1 of 1 (latest)
Hi Snufkin
Salesforce is a very specific and unique software environment. Can you describe what you are trying to do?
Im not using any connector here
From my code, im trying a POST request
to create a checkout session
as Stripe allows only form encoded strings in the body of the POST request. I want to see how the bosy looks like. I tried multiple ways, but couldnt crack it
Okay so you need to set the Content Type header to be form encoded. Take a look here:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST
&line_items=%5B%7B%22quantity%22%3A1%2C%22price%22%3A%22price_1LGlchBNjIZtrZZbtVeTg9OE%22%7D%5D&mode=subscription&success_url=https%3A%2F%2Fluxurylifestyleaustralia--uat.sandbox.my.site.com%2Fshop%2Fs%2Fpaymentsuccessful%3Fparams%3DxfIumslNJNmBW7%2BiPIBGZwx0gWNXA8VKyh%2F3G0R3LzGi%2BDpvNN94WHdGVycBi0FdmZnZhX5M%2BLmmQA1%2By%2Bz2cB4NxzyAs01qXuMxAKJ4nRHn1wi2sIy6fH1a4frERE6HeNDsH8mlZ%2F%2BseSzlJNLA%2BA%3D%3D&cancel_url=https%3A%2F%2Fluxurylifestyleaustralia--uat.sandbox.my.site.com%2Fshop%2Fs%2Fpaymentcancelled%3Fparams%3D2LzqAeHVzaUapumnpqLhpNJJCltx4QzsSJXq0Jpjd2n6Qys%2BWGoUmqqmvpVz8n3vSck4vPYR3HIs8wgCayu%2BTzZsYd7yXNkVaT6GP2VCOgXN24zsM7GTHmmKah3NkO5nnE716yYyWPD9
T8kyolcySw%3D%3D&
This is what I set in the content body
That looks like query parameters in the URL.
responseBody {
"error": {
"message": "Invalid array",
"param": "line_items",
"type": "invalid_request_error"
}
}
to create customer, my Resit call is working with the below body
name=TestUser&email=con@testmail.com&description=TestDescription
Hmmm...okay so what are you using to make these POST requests?
Also, can you share with me the request IDs for both a successful and unsuccessful request?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request