I am using Webhooks by Zapier to make a POST request to the Stripe API to create a new checkout session. I want the checkout session to have a required checkbox on it, so I’m attempting to implement that using “custom fields,” which I include as key value pairs in the POST request, just like this:

The payload type is set to “form”.
Stripe is giving me the following error message:

I have no idea why this is happening to the “custom_fields[0][key]” field. Here’s how it looks on Stripe’s end. If anyone has any possible solutions / ideas, I would love to hear. I’ve tried sending the Payload as JSON, but it looked like Stripe didn’t receive any of that. It didn’t show the Request post body at all on the Stripe side.
Response body
{
"error": {
"message": "Invalid string: {:"\r\n"=>"client_agreement"}","param": "custom_fields[0][key]","request_log_url": "https://dashboard.stripe.com/acct_XXXXXXXXXXXXXXXX/test/workbench/logs?object=req_fljnOfYZZIOUtl","type": "invalid_request_error",
},}
Request POST body
{"cancel_url": "https://example.com/cancel",
"custom_fields": {
"0": {
"key": {
" ": "client_agreement",
},
"label": {
"custom": {
" ": "I have read and agree to the CXXXX Law Client Agreement (https://XXXXXXXXXX.com/client-agreement). I understand this is a flat legal fee earned upon receipt. ",
},
"type": {
" ": "custom",
},},
"optional": {
" ": "false",
},
"type": {
" ": "checkbox",
},},},
"line_items": {
"0": {
"price": “price_1SvkZ9EDgJ6Mypz3FIt9xd1J”,"quantity": "1",
},},
"metadata": {
"record_id": "recmzFsxpQkWQvPRQ",
},"mode": "payment","success_url": "https://example.com/success",}
This post has been edited by a moderator to remove sensitive information. Please remember that this is a public forum and avoid sharing personal or potentially sensitive details.




