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

# Update Commission

> Set the commission rate for a specific sub-merchant.

# Update Commission

Set a per-merchant commission rate that overrides your marketplace's default rate for this sub-merchant only. This is the rate used when [Create Charge](/api-reference/payments/create-charge#how-the-split-works) resolves how much to deduct from a marketplace split.

<Note>
  Commission resolution order at charge time: **this per-merchant rate** → your portfolio's `marketplace_commission_rate` default → `0` if neither is set.
</Note>

## Path Parameters

<ParamField path="merchantId" type="integer" required>
  The sub-merchant's business ID (`merchant_id` from [List Merchants](/api-reference/marketplace/list-merchants)).
</ParamField>

## Request Body

<ParamField body="commission_rate" type="number" required>
  Decimal commission rate between `0` and `1` (e.g. `0.08` = 8%). Not a percentage — `8` is invalid, `0.08` is correct.
</ParamField>

## Response

```json theme={null}
{
  "success": true,
  "message": "Commission rate updated successfully",
  "data": {
    "commission_rate": 0.08
  }
}
```

Updates both the marketplace-merchant relationship's rate and the sub-merchant's `BusinessPortfolio.marketplace_commission_rate` — the latter is what [Create Charge](/api-reference/payments/create-charge) actually reads at split time.

## Error Codes

| Status | Error Code               | Cause                                                                                                                                                                                                                                        |
| ------ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `403`  | `AUTH_PERMISSION_DENIED` | Your business isn't set up as a marketplace operator. Run [Setup Marketplace](/api-reference/marketplace/setup) first.                                                                                                                       |
| `400`  | `VALIDATION_FAILED`      | `commission_rate` is missing, or outside the `0`–`1` range.                                                                                                                                                                                  |
| `404`  | `BUSINESS_NOT_FOUND`     | No **active** `MarketplaceMerchant` relationship exists for `merchantId` under your marketplace. Pending or suspended relationships return this same error — reactivate via [Link Merchant](/api-reference/marketplace/link-merchant) first. |
| `400`  | `INTERNAL_ERROR`         | Unexpected server error.                                                                                                                                                                                                                     |

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.khaime.com/api/v1/marketplace/merchants/892/commission \
    -H "X-API-Key: pk_sandbox_your_key" \
    -H "Content-Type: application/json" \
    -d '{"commission_rate": 0.08}'
  ```
</RequestExample>
