Skip to main content
The Commission module exposes a service you can resolve from the Medusa container to read and write records directly, without going through a workflow. Use it inside custom services, subscribers, or scheduled jobs.

Generated methods

Each data model gets a standard set of auto-generated methods. For CommissionRate: The same set exists for every model in the module: CommissionRule, CommissionRateValue, and CommissionLine (e.g. createCommissionRules, listCommissionRateValues, deleteCommissionLines).

Calculation & line methods

Prefer workflows for order-line refreshes and rate deletion. refreshOrderCommissionLinesWorkflow builds the calculation context from the order and calls these methods for you; deleteCommissionRatesWorkflow validates that a rate is safe to delete first.