Back to Medusa

Payment Module Events Reference

www/apps/resources/references/module_events/module_events.Payment/page.mdx

2.14.22.5 KB
Original Source

import { TypeList } from "docs-ui"

Payment Module Events Reference

This reference shows all the events emitted by the Medusa application related to the Payment Module. If you use the module outside the Medusa application, these events aren't emitted.

Summary

<Table> <Table.Header> <Table.Row> <Table.HeaderCell> Event </Table.HeaderCell> <Table.HeaderCell> Description </Table.HeaderCell> </Table.Row> </Table.Header> <Table.Body> <Table.Row> <Table.Cell> [payment.captured](#paymentcaptured) </Table.Cell> <Table.Cell> Emitted when a payment is captured. </Table.Cell> </Table.Row> <Table.Row> <Table.Cell> [payment.refunded](#paymentrefunded) </Table.Cell> <Table.Cell> Emitted when a payment is refunded. </Table.Cell> </Table.Row> </Table.Body> </Table>

<EventHeader headerLvl="2" headerProps={{ id: "paymentcaptured", children: (<>payment.captured</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="payment.captured" payload={\``ts { id, // the ID of the payment } ````} />

Emitted when a payment is captured.

Payload

ts
{
  id, // the ID of the payment
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.


<EventHeader headerLvl="2" headerProps={{ id: "paymentrefunded", children: (<>payment.refunded</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="payment.refunded" payload={\``ts { id, // the ID of the payment } ````} />

Emitted when a payment is refunded.

Payload

ts
{
  id, // the ID of the payment
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.