# Commission & Markup

The Commission System allows API partners to apply a custom markup on deposits and earn commission from platform activity.

This feature is designed for resellers, integrators, and white-label partners.

***

### Overview

Each API key can include a configurable markup percentage.

When enabled:

* A percentage is added on top of the platform fee
* Commission is accumulated automatically
* Earnings can be withdrawn to a supported wallet

***

### How Markup Works

When a deposit is created:

1. Platform fee is applied.
2. Partner markup (if configured) is added.
3. Total collected fees are split accordingly.
4. Commission balance increases.

***

### Fee Structure Example

Example deposit response:

```json
{
  "success": true,
  "data": {
    "depositId": "dep_abc123",
    "amount": 100,
    "currency": "SOL",
    "fees": {
      "platformFeePercent": 5,
      "platformFeeUsd": 5,
      "merchantCommissionPercent": 2,
      "merchantCommissionUsd": 2,
      "totalCollected": 7
    }
  }
}
```

#### Fee Fields Explained

* platformFeePercent - Base Aurex platform fee
* platformFeeUsd - Platform fee amount
* merchantCommissionPercent - Partner markup percentage
* merchantCommissionUsd - Commission earned by partner
* totalCollected - Total fees charged to user

***

### Commission Earnings

Partners can track earnings in the dashboard.

#### Earnings Metrics

* Total Earned — Lifetime accumulated commission
* Paid Out — Amount already withdrawn
* Available — Withdrawable balance

Commission values update in real-time.

***

### Withdrawals

Commission can be withdrawn to a supported blockchain wallet.

> Important: Withdrawals are processed on-chain and may require network confirmation.

***

### Commission Lifecycle

Commission progresses through the following states:

* accrued
* available
* paid

> Note: Commission becomes available after deposit confirmation.

***

### API Key Configuration

Markup percentage is configured per API key.

Each key may have a different commission rate.

***

### Restrictions

* Commission applies only to eligible deposit transactions.
* Card fees and swap fees may not generate commission unless explicitly enabled.
* Commission rates may be limited by account tier.

***

### Error Handling

Commission-related operations return standard API errors:

```json
{
  "success": false,
  "error": "Commission withdrawal failed"
}
```
