This topic was automatically generated from Slack. You can find the original thread here.
Hello, any chance Pipedream proxy has an issue with non-JSON payloads? Proxied Airtable requests work all good for me and they are JSON based but with Stripe I keep hitting 400. It requires application/x-www-form-urlencoded
.
code:
const pdResponse = await pd.makeProxyRequest(
{
searchParams: { external_user_id: externalUserId, account_id: accountId },
},
{
url: STRIPE_WEBHOOK_ENDPOINT,
options: {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: params.toString(),
},
},
);
data:
{
searchParams: {
external_user_id: 'c6a0c******-******',
account_id: 'apn_*****'
}
} {
url: 'https://api.stripe.com/v1/webhook_endpoints',
options: {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: 'url=https%3A%2F%2Fsupabase-pipedream.netlify.app%2Fstripe-invoice-updated&description=Stripe+webhook+for+invoice+sync+activation&enabled_events%5B%5D=invoice.created&enabled_events%5B%5D=invoice.updated&enabled_events%5B%5D=invoice.payment_failed'
}
}
response is
HTTP error! status: 400, body: {"error":"bad request: check parameters"}
Which is vague and I suspect Stripe couldn’t figure out the body as a whole, but I’m not sure, maybe Stripe would respond vaguely even in case of a minor mistake.