createCommissionRatesWorkflow that creates one or more
CommissionRate records. Run it from any place that has access to the Medusa
container.
Run the workflow
src/api/custom/route.ts
The workflow takes an array of rates and returns the created records. When
you omit
code, the module generates a unique one from name.Create a fixed, per-currency rate
For a flat fee, useCommissionRateType.FIXED and pass per-currency values.
The scalar value is the fallback when no currency matches.
Scope the rate
A rate created without rules is a catch-all. To scope it to part of the catalog, attach rules withbatchCommissionRulesWorkflow.