getWebhookActionAndData - Payment Module Reference

This documentation provides a reference to the getWebhookActionAndData method. This belongs to the Payment Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

This method retrieves webhook event data with the associated payment provider.

Learn more about handling webhook events in this guide

Example#

In the following example, req is an instance of MedusaRequest:

Code
1const dataAndAction = await paymentModuleService.getWebhookActionAndData({2  provider: "stripe",3  payload: {4    data: req.body,5    rawData: req.rawBody,6    headers: req.headers,7  },8})

Parameters#

The webhook event's details.

Returns#

PromisePromise<WebhookActionResult>
Resolves when the webhook event is handled successfully.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break