Skip to main content
The Payout module owns 4 data models: PayoutAccount, Onboarding, Payout, and PayoutReversal. They’re defined in packages/core/src/modules/payout/models, and the module service is registered as MercurModules.PAYOUT. Every model also gets Medusa’s created_at, updated_at, and deleted_at columns. The module has no provider table and no provider_id columns: a marketplace has exactly one payout provider.

PayoutAccount

A seller’s connection to the payout provider. Table payout_account, id prefix pacc. Relations:
  • onboarding: hasOne Onboarding, nullable, mapped by account
  • payouts: hasMany Payout, mapped by account
The seller is reached through the seller_payout_account link, not a column. See Links.

Onboarding

The provider’s onboarding state for one payout account. Table onboarding, id prefix onb. Relations:
  • account: belongsTo PayoutAccount, mapped by onboarding

Payout

The seller’s share of one order, sent to their payout account. Table payout, id prefix pout. Relations:
  • account: belongsTo PayoutAccount, mapped by payouts
  • reversals: hasMany PayoutReversal, mapped by payout, deleted with the payout
Indexes, all limited to rows where deleted_at IS NULL:
  • IDX_payout_account_id_created_at: on account_id, created_at
  • IDX_payout_status_created_at: on status, created_at
  • IDX_payout_order_id: unique on order_id when set

PayoutReversal

One refund’s share taken back from a payout, the way Medusa keeps a Refund under a Payment. Table payout_reversal, id prefix pourev. Relations:
  • payout: belongsTo Payout, mapped by reversals

Enums

The enums are exported from @mercurjs/types. PayoutAccountStatus: PayoutKycStatus: PayoutStatus, used by both Payout and PayoutReversal: