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. Tablepayout_account, id prefix pacc.
Relations:
onboarding:hasOneOnboarding, nullable, mapped byaccountpayouts:hasManyPayout, mapped byaccount
seller_payout_account link, not a column. See Links.
Onboarding
The provider’s onboarding state for one payout account. Tableonboarding, id prefix onb.
Relations:
account:belongsToPayoutAccount, mapped byonboarding
Payout
The seller’s share of one order, sent to their payout account. Tablepayout, id prefix pout.
Relations:
account:belongsToPayoutAccount, mapped bypayoutsreversals:hasManyPayoutReversal, mapped bypayout, deleted with the payout
deleted_at IS NULL:
IDX_payout_account_id_created_at: onaccount_id,created_atIDX_payout_status_created_at: onstatus,created_atIDX_payout_order_id: unique onorder_idwhen set
PayoutReversal
One refund’s share taken back from a payout, the way Medusa keeps aRefund under a Payment. Table payout_reversal, id prefix pourev.
Relations:
payout:belongsToPayout, mapped byreversals
Enums
The enums are exported from@mercurjs/types.
PayoutAccountStatus:
PayoutKycStatus:
PayoutStatus, used by both Payout and PayoutReversal: