> For the complete documentation index, see [llms.txt](https://docs.payengine.co/payengine-api-v2.5/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payengine.co/payengine-api-v2.5/metrics/merchant-metrics.md).

# Merchant Metrics

## Retrieve fees or pending payout for a particular merchant given its ID

<mark style="color:blue;">`GET`</mark> `https://<Platform-host>/api/merchant/:id/metrics/:metricType`

Request

#### Path Parameters

| Name                                         | Type   | Description                                            |
| -------------------------------------------- | ------ | ------------------------------------------------------ |
| id<mark style="color:red;">\*</mark>         | string | Merchant ID                                            |
| metricType<mark style="color:red;">\*</mark> | string | <p>Type of metrics<br>1. fees<br>2. pending-payout</p> |

#### Query Parameters

| Name       | Type | Description                                                                                                                                                                                                                    |
| ---------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| from\_date | date | When retrieving the fees metric type, by default, the fees will be calculated from the date when the merchant is activated. If the fees needs to be retrieved from a specific date, then provide the date in mm-dd-yyyy format |
| to\_date   | date | When retrieving the fees metric type, by default, the fees will be calculated till the current date. If the fees needs to be retrieved till a specific date, then provide the date in mm-dd-yyyy format                        |

{% tabs %}
{% tab title="200 " %}
{% tabs %}
{% tab title="Field Definitions" %}

<table><thead><tr><th width="194">Field Name</th><th width="120">Type</th><th width="215">Description</th><th>Required?</th></tr></thead><tbody><tr><td>data.total_fees</td><td>string</td><td>Fees for the merchant from the date specified in from_date. If from_date is not specified, then it will be fees from the date of merchant activation</td><td>Required</td></tr><tr><td>data.pending_payout</td><td>string</td><td>Merchant ID</td><td>Required</td></tr></tbody></table>
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
{% code overflow="wrap" lineNumbers="true" %}

```shell
curl --location --request GET '<API_HOST>/api/merchant/d6399869-747c-4537-9c04-f81ce2a6c5eb/metrics/pending-payout?from_date=01-01-2024' \
--header 'Authorization: Basic <API_KEY>'
```

{% endcode %}
{% endtab %}

{% tab title="Sample Response - Fees" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "data": {
        "total_fees": "290239.13"
    }
}
</code></pre>

{% endtab %}

{% tab title="Sample Response - Pending Payout" %}

<pre><code><strong>{
</strong>    "data": {
        "pending_payout_amount": "909.12"
    }
}
</code></pre>

{% endtab %}
{% endtabs %}
