Reputation: 7181
I have been using the Stripe API and it's been calling my Webhook successfully for about a year.
But yesterday an issue occured for the first time. The webhook did not manage to succesfully complete its intended operation, but returned a 200 status code anyway, so Stripe didn't retry.
I have now fixed the error on the Webhook, but can't figure out how to make Stripe repeat the webhook call for this particular event. I can retrieve the event, but there's no button to resend. How to?
Upvotes: 25
Views: 19430
Reputation: 1877
Same problem here.
I tried to resend a "live" event to a "live" webhook but through my local machine using:
stripe events resend evt_************************ --webhook-endpoint=we_************************ --live
it didn't work:
{
"error": {
"message": "The provided key 'rk_live_*********************************************************************************************Aba153' does not have the required permissions for this endpoint on account 'acct_***************'. Please use a different key to perform this action.",
"type": "invalid_request_error"
}
}
even after using
stripe login --api-key=sk_live_**************************Aba153
Until i used the --api-key option:
stripe events resend evt_************************ --webhook-endpoint=we_************************ --live --api-key=sk_live_************************
Upvotes: 4
Reputation: 3080
It is possible to manually resend webhook events.
In the Stripe Dashboard, select Developers > Webhooks
, then find the webhook your working with and press the little "resend" icon.
Note that for events which succeeded, you can still resend them by clicking the ellipsis and then "Resend" (this is a newer feature).
Upvotes: 17
Reputation: 1662
Stripe cli allows this stripe events resend IDOFTHEEVENT --live --webhook-endpoint=IDOFTHEWEBHOOK
(replace IDOFTHEEVENT by the id of the event, and IDOFTHEWEBHOOK by the id of the webhook which you can find in the URL when you are on a webhook's page).
Otherwise you can copy/paste the event sent to the webhook and sent it to your endpoint with a tool such as postman.
Upvotes: 36
Reputation: 2898
Since a 200 was returned, retrieving the event is going to be your best bet. Manual retries aren't currently possible (per https://stripe.com/docs/webhooks#responding-to-a-webhook):
In live mode, we will attempt to deliver your webhooks for up to three days with an exponential back off. In test mode, we retry three times over a few hours. Webhooks cannot be manually retried after this time, though you can query for the event to reconcile your data with any missed events.
When viewing information about a specific event through the Dashboard, you can check how many times we've attempted to send an event to an endpoint by clicking on that endpoint URL in the Webhook details section. This will show you the latest response we received from your endpoint, along with a list of all attempted webhooks and the respective HTTP status codes we received.
Upvotes: 6