Skip to main content

Links between Payout Module and Other Modules

This document showcases the module links defined between the Payout Module and other Commerce Modules.

Summary

The Payout Module has the following links to other modules:
First Data ModelSecond Data ModelTypeDescription
OrderPayoutStored - one-to-manyAssociates an order with its payout transfers to sellers
SellerPayoutAccountStored - one-to-oneAssociates a seller with their payout account

Order Module

Mercur defines a link between the Order Module’s Order data model and the Payout Module’s Payout data model. This allows tracking which payouts were created for a specific order.

Retrieve with Query

To retrieve the payouts of an order with Query, pass payout.* in fields:
  • query.graph
  • useQueryGraphStep
const { data: orders } = await query.graph({
  entity: "order",
  fields: [
    "*",
    "payout.*",
  ],
})

// orders[0].payout
To manage the payouts of an order, use Link:

Seller Module

Mercur defines a link between the Seller Module’s Seller data model and the Payout Module’s PayoutAccount data model. This allows each seller to have a payout account for receiving payments from the marketplace.

Retrieve with Query

To retrieve the payout account of a seller with Query, pass payout_account.* in fields:
  • query.graph
  • useQueryGraphStep
const { data: sellers } = await query.graph({
  entity: "seller",
  fields: [
    "*",
    "payout_account.*",
  ],
})

// sellers[0].payout_account
To manage the payout account of a seller, use Link: