Run the workflow
refreshOrderCommissionLinesWorkflow reads each order, resolves the matching
rate for every item and shipping method, and writes the resulting
CommissionLine records.
src/api/custom/refresh/route.ts
The workflow takes an array of
order_ids, so you can refresh many orders in
one run. This is useful for backfilling after you change your commission
configuration.Idempotency
The refresh is a delete-then-insert for each affected item and shipping method, so re-running it never duplicates lines. You can call it as often as you need without cleaning up first.When it runs automatically
You rarely need to call this by hand. Mercur runs it for you:- At checkout: as each per-seller order is created from the split cart.
- On order changes: a subscriber re-runs it when an order edit is confirmed, or a return, claim, or exchange is created.