Skip to main content
Applies partial updates to existing commission rates by ID. Triggered by POST /admin/commission-rates/:id.

Usage

import { updateCommissionRatesWorkflow } from "@mercurjs/core/workflows"

const { result } = await updateCommissionRatesWorkflow(container).run({
  input: [{ id: "comrate_123", value: 12, is_enabled: true }],
})

Input

The input is an array of commission rate updates.
id
string
required
The commission rate to update.
name
string
Display name of the rate.
code
string
Unique code of the rate.
type
string
One of fixed, percentage.
value
number
Rate value — a percentage for percentage, an amount for fixed.
currency_code
string | null
Currency of a fixed rate.
include_tax
boolean
Include tax totals in the commission base.
include_shipping
boolean
Also apply the rate to shipping methods.
is_enabled
boolean
Whether the rate is active.
is_default
boolean
Marks the rate as the platform-wide fallback.

Result

result
CommissionRateDTO[]
The updated commission rates.