Skip to main content
The Commission module owns four data models, defined in packages/core/src/modules/commission/models. Every model also has created_at, updated_at, and a nullable deleted_at, which Medusa adds and the tables below leave out.

CommissionRate

The rate the marketplace takes from a sale. Table commission_rate, id prefix comrate. Relations:
  • rules: has many CommissionRule
  • values: has many CommissionRateValue

CommissionRule

Scopes a rate to one record in one dimension. Table commission_rule, id prefix comrule. Relations:
  • commission_rate: belongs to CommissionRate
The table has an index on (reference, reference_id) for non-deleted rows.

CommissionRateValue

A per-currency amount for a fixed rate. Table commission_rate_value, id prefix comval. Relations:
  • commission_rate: belongs to CommissionRate

CommissionLine

The resolved commission for one order line item or shipping method. Table commission_line, id prefix comline. The table has indexes on item_id and on shipping_method_id for non-deleted rows. A line sets one of the two anchors and leaves the other null.

Enums

CommissionRateType is exported from @mercurjs/types.