> For the complete documentation index, see [llms.txt](https://monicredit.gitbook.io/mc-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monicredit.gitbook.io/mc-api/beneficiary/search-beneficiary.md).

# Search Beneficiary

{% 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 eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2RlbW8ubW9uaWNyZWRpdC5jb20vYXBpL3YxL2NvcmUvYXV0aC9sb2dpbiIsImlhdCI6MTY2ODk2NzQ0MywiZXhwIjoxNjY4OTcxMDQzLCJuYmYiOjE2Njg5Njc0NDMsImp0aSI6ImF0UE9GVHE4cU4yN2lBWlciLCJzdWIiOiJVU0FETUlOIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.shrbQUV29vXRF30qMeBN3zxlc5JXd03QyMeD6ekzudU");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "search": "MT00000000",
  "bank_id": 1,
  "page": 1
});

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

fetch("https://demo.backend.monicredit.com/api/v1/banking/beneficiary/", 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 => 'http://demo.monicredit2.test//banking/beneficiary/',
  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_POSTFIELDS =>'{
    "search" : "MT6266ba2876db0",
    "bank_id" : 1,
    "page" : 1
}',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2RlbW8ubW9uaWNyZWRpdC5jb20vYXBpL3YxL2NvcmUvYXV0aC9sb2dpbiIsImlhdCI6MTY2ODk2NzQ0MywiZXhwIjoxNjY4OTcxMDQzLCJuYmYiOjE2Njg5Njc0NDMsImp0aSI6ImF0UE9GVHE4cU4yN2lBWlciLCJzdWIiOiJVU0FETUlOIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.shrbQUV29vXRF30qMeBN3zxlc5JXd03QyMeD6ekzudU',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}
{% endtabs %}

<mark style="color:blue;">`GET`</mark> `{{BaseURL}}/banking/beneficiary/`

#### Headers

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| Authorization<mark style="color:red;">\*</mark> | String | {{bearer\_token}} |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| search   | String | MC0000      |
| bank\_id | String | 0           |
| page     | String | 1           |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "status": true,
    "message": "",
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "B00000000",
                "bank_id": 1,
                "merchant_id": "MC0000000",
                "account_name": "Test",
                "account_number": "000000",
                "bank": {
                    "id": 1,
                    "name": "UBA"
                }
            }
        ],
        "first_page_url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=1",
        "from": 1,
        "last_page": 2,
        "last_page_url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=2",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=2",
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": "http://demo.monicredit2.test/api/v1/banking/beneficiary?page=2",
        "path": "http://demo.monicredit2.test/api/v1/banking/beneficiary",
        "per_page": 1,
        "prev_page_url": null,
        "to": 1,
        "total": 2
    }
}
```

{% endtab %}
{% endtabs %}
