# Revenue Head Report

The Revenue Head Report enables you to retrieve detailed information about your revenue sources. By accessing this report through our API, you gain transparency into the various revenue streams associated with your financial activities.

To access the Revenue Head Report, make a GET request to the following endpoint:

Endpoint: GET - \{{baseUrl\}}/v1/reports/revenue

| Parameter         | Required | Type   |
| ----------------- | -------- | ------ |
| revenue\_head\_id | no       | string |
| search            | no       | string |

#### Request

Use the provided code snippet as a reference to make requests to the Revenue Head Report endpoint. Ensure that you replace "YOUR\_BEARER\_TOKEN" with the actual bearer token obtained through our authentication process.

{% tabs %}
{% tab title="JavaScript" %}
```javascript
//A code snippet of how to consume the API

var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer YOUR_BEARER_TOKEN");

var raw = "";

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://demo.backend.monicredit.com/api/v1/reports/revenue", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
{% endtab %}

{% tab title="PHP" %}
```php
//A code snippet of how to consume the API

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.backend.monicredit.com/api/v1/reports/revenue',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer YOUR_BEARER_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```
{% endtab %}

{% tab title="cURL" %}
```sh
//A code snippet of how to consume the API

curl --location '{{baseUrl}}/v1/reports/revenue' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_BEARER_TOKEN' \
--data ''
```
{% endtab %}
{% endtabs %}

Response

```json
[
    {
        "id": "REV_00000000",
        "revname": "Test Testing",
        "merchant_id": "MC00000000",
        "business_name": "Test Testing",
        "settlement_bank_id": "SBK_000000",
        "settlement_bank_name": "Autocredit Bank",
        "account_name": "Test Testing",
        "account_no": "00000000",
        "total_transaction_count": 85,
        "settlement_count": 75,
        "transfer_count": 85,
        "card_count": 0,
        "transfer_total": 425000,
        "card_total": 0,
        "collection": 425000,
        "settlement": 375000,
        "balance": 50000
    },
]
```
