#Hotsauce - Webhook 400s
1 messages · Page 1 of 1 (latest)
👋 I am receiving the following error:
parameter_missing - enabled_events
Missing required param: enabled_events.
{
"url": "https://catalog-lek0j0mdz-broadway-media.vercel.app/api/stripe_hooks",
"description": "",
"connect": "false",
"enumeratively_enabled_all_events_during_creation": "false",
"enabled_events": <required>
}
The webhook seems to trigger and show up the in the event log but I wanted to know if I was missing something
So you're trying to create a Webhook Endpoint via the API?
If so, you need to specify the event types you wish to listen for with that Webhook Endpoint: https://stripe.com/docs/api/webhook_endpoints/create#create_webhook_endpoint-enabled_events
I see.
Doing something like the example code here?
// Handle the event
switch (event.type) {
case 'payment_intent.succeeded':
const paymentIntent = event.data.object;
// Then define and call a method to handle the successful payment intent.
// handlePaymentIntentSucceeded(paymentIntent);
break;
case 'payment_method.attached':
const paymentMethod = event.data.object;
// Then define and call a method to handle the successful attachment of a PaymentMethod.
// handlePaymentMethodAttached(paymentMethod);
break;
// ... handle other event types
default:
console.log(Unhandled event type ${event.type});
}
That's code for handling incoming events, which is different than creating a Webhook Endpoint. At a high level what are you trying to do?
Sorry, pretty new to stripe.
I want to send Successful payments to stripe (which is already setup through Stripe Checkout) information to PipeDrive.
PipeDrive has endpoints that receive requests**
Ah, okay, so are you following a guide or instructions from PipeDrive?
I am at the beginning stages having Stripe and PipeDrive communicate. I was under the impression that I need to send order information to PipeDrive from Stripe.
Can you give me more information? Who or what gave you that impression? Why are you trying to link PipeDrive and Stripe together?
Internally, we use PipeDrive for sales related tracking. I am attempting to generate a Customer in PipeDrive when payments succeed in Stripe. I have a handful of custom fields added to the payment_intent_data's metadata object that I need to pass to PipeDrive for the customer creation.
And you want to write custom code to link the two systems together?
Exactly. I am hoping the Stripe webhook I set up can send the information over to PipeDrive.
Okay, so the high-level steps are:
- Create a Webhook Endpoint in Stripe that points to the URL where the code you're writing can be reached. You can do this in the Dashboard here: https://dashboard.stripe.com/test/webhooks
- Write code that will accept the incoming events when we send them to the URL you specified and send the relevant data to PipeDrive.
Awesome, thanks for talking me through the steps