I am using Stripe Connect and have defined Connect Webhooks in my platform Stripe account.
In my node.js server when I receive the webhook, I call stripe.events.retrieve() with the id received in the Webhook's event_json to verify that the Webhook was indeed generated by Stripe for a legitimate event.
For some reason I am getting back
Error Type: StripeInvalidRequest. Message: No such event: evt_17ztDTFFH5u58o7XXXXXXXXX
Here is my code:
stripe.events.retrieve(
function(err, event) {
if (err) {
winston.error('Failed to retrieve Stripe Event for Webhook: ' + JSON.stringify(event_json) + '. Error Type: ' + err.type + '. Message: ' + err.message);
return null;
}
return(event);
}
);
I also tried calling stripe.events.receive with a { stripe_account: event_json.user_id } parameter after
event_json.id. In this case it looks like the stripe.events.retrieve callback never gets called.
What am I doing wrong?