Events that trigger a recompute
Theorder-commission-refresh-handler subscriber, in packages/core/src/subscribers/order-edit-confirmed.ts, runs refreshOrderCommissionLinesWorkflow for the order on each of these events.
The subscriber reads
order_id and falls back to id. It does nothing when the payload has neither. The events come from Medusa as OrderEditWorkflowEvents.CONFIRMED, OrderWorkflowEvents.RETURN_RECEIVED, OrderWorkflowEvents.CLAIM_CREATED, and OrderWorkflowEvents.EXCHANGE_CREATED.
Checkout doesn’t go through an event. completeCartWithSplitOrdersWorkflow runs the refresh as a nested step for every seller order it creates.
Run your own logic after a recompute
Subscribe to the same order events to run your own logic when an order’s commission may change.src/subscribers/commission-audit.ts
commissionLinesUpserted hook of refreshOrderCommissionLinesWorkflow, which runs after they’re written. See Refresh order commission lines.
Like every
MedusaService module, the Commission service also emits Medusa’s internal data-mutation events when records are created, updated, or deleted. Mercur doesn’t subscribe to them, and this reference doesn’t treat them as a stable contract.