> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Commission Rate

> Create a commission rate.

Creates a commission rate, optionally with scoping rules and per-currency values.

## Body parameters

**name** `string` *required*

The rate's display name.

**code** `string` *required*

Unique code identifying the rate.

**type** `string` *required*

The rate type: `fixed` or `percentage`.

**value** `number` *required*

The commission value, a percentage or a fixed amount.

**currency\_code** `string`

Currency of a fixed rate's value.

**include\_tax** `boolean`

Whether commission is calculated on tax-inclusive amounts.

**include\_shipping** `boolean`

Whether shipping is included in the commission base.

**is\_enabled** `boolean`

Whether the rate is active.

**is\_default** `boolean`

Whether this is the marketplace default rate.

**rules** `object[]`

Rules scoping which sellers or products the rate applies to.

**properties**

**reference** `string` *required*

The rule target type: `product`, `product_type`, `product_collection`, `product_category`, or `seller`.

**reference\_id** `string` *required*

ID of the referenced entity.

**values** `object[]`

Per-currency fixed amounts.

**properties**

**currency\_code** `string` *required*

The value's currency code.

**amount** `number` *required*

The fixed commission amount for that currency.

## Response

**commission\_rate** `object`

**properties**

**id** `string`

The commission rate's ID.

**name** `string`

The rate's display name.

**code** `string`

The rate's unique code.

**type** `string`

The rate type: `fixed` or `percentage`.

**value** `number`

The commission value.

**is\_enabled** `boolean`

Whether the rate is active.

**is\_default** `boolean`

Whether this is the marketplace default rate.

**rules** `object[]`

Rules scoping the rate.

**values** `object[]`

Per-currency fixed amounts.

```bash cURL theme={null}
curl -X POST 'http://localhost:9000/admin/commission-rates' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Electronics", "code": "electronics", "type": "percentage", "value": 12, "rules": [{"reference": "product_category", "reference_id": "pcat_01HXYZ"}]}'
```

```ts JS Client theme={null}
const { commission_rate } = await client.admin.commissionRates.mutate({
  name: "Electronics",
  code: "electronics",
  type: "percentage",
  value: 12,
  rules: [{ reference: "product_category", reference_id: "pcat_01HXYZ" }],
})
```

```json 201 theme={null}
{
  "commission_rate": {
    "id": "comrate_01HXYZ8Q2M4N6P8R0T2V4W6X8Y",
    "name": "Electronics",
    "code": "electronics",
    "type": "percentage",
    "value": 12,
    "currency_code": null,
    "include_tax": false,
    "include_shipping": false,
    "is_enabled": true,
    "is_default": false,
    "rules": [
      {
        "id": "comrule_01HXYZ9A1B2C3D4E5F6G7H8J9K",
        "reference": "product_category",
        "reference_id": "pcat_01HXYZ"
      }
    ],
    "values": []
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.