# Get All Wallets

{% 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");

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

fetch("https://demo.backend.monicredit.com/api/v1/banking/wallet", 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/banking/wallet',
  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 eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2RlbW8ubW9uaWNyZWRpdC5jb20vYXBpL3YxL2NvcmUvYXV0aC9sb2dpbiIsImlhdCI6MTY2ODk2NzQ0MywiZXhwIjoxNjY4OTcxMDQzLCJuYmYiOjE2Njg5Njc0NDMsImp0aSI6ImF0UE9GVHE4cU4yN2lBWlciLCJzdWIiOiJVU0FETUlOIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.shrbQUV29vXRF30qMeBN3zxlc5JXd03QyMeD6ekzudU'
  ),
));

$response = curl_exec($curl);

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

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

#### Headers

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

{% tabs %}
{% tab title="200: OK List All Wallets" %}
<pre class="language-json"><code class="lang-json">{
<strong>    "success": true,
</strong>    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "W00000",
                "name": "Test",
                "description": "Testing",
                "wallet_type": "personal",
                "status": "pending",
                "created_at": "2022-03-07T17:54:28.000000Z",
                "updated_at": "2022-03-07T17:54:28.000000Z"
            }
        ],
        "first_page_url": "http://monicredit2.test/api/v1/wallet?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "http://monicredit2.test/api/v1/wallet?page=1",
        "links": [
            {
                "url": null,
                "label": "&#x26;laquo; Previous",
                "active": false
            },
            {
                "url": "http://monicredit2.test/api/v1/wallet?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &#x26;raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "http://monicredit2.test/api/v1/wallet",
        "per_page": 20,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
```
}
</code></pre>
{% endtab %}

{% tab title="200: OK List All Personal Wallets" %}
```json
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "W0000",
                "name": "Test",
                "description": "Testing",
                "wallet_type": "personal",
                "status": "pending",
                "created_at": "2022-03-07T17:54:28.000000Z",
                "updated_at": "2022-03-07T17:54:28.000000Z",
                "personals": [
                    {
                        "id": "US0000",
                        "first_name": "Test",
                        "last_name": "Test",
                        "email": "test@gsss.ff",
                        "pivot": {
                            "wallet_id": "W0000",
                            "user_id": "US00000"
                        }
                    }
                ]
            }
        ],
        "first_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "http://monicredit2.test/api/v1/wallet/personals",
        "per_page": 20,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
}
```
{% endtab %}

{% tab title="200: OK List Merchant Wallets" %}
```json
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "W00000",
                "name": "Test",
                "description": "Testing",
                "wallet_type": "personal",
                "status": "pending",
                "created_at": "2022-03-07T17:54:28.000000Z",
                "updated_at": "2022-03-07T17:54:28.000000Z",
                "personals": [
                    {
                        "id": "US00000",
                        "first_name": "Test",
                        "last_name": "Test",
                        "email": "test@gsss.ff",
                        "pivot": {
                            "wallet_id": "W0000",
                            "user_id": "US0000"
                        }
                    }
                ]
            }
        ],
        "first_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "http://monicredit2.test/api/v1/wallet/personals",
        "per_page": 20,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
}
```
{% endtab %}

{% tab title="200: OK List Customer Wallets" %}
```json
{
    "success": true,
    "data": {
        "current_page": 1,
        "data": [
            {
                "id": "W0000",
                "name": "Test",
                "description": "Testing",
                "wallet_type": "personal",
                "status": "pending",
                "created_at": "2022-03-07T17:54:28.000000Z",
                "updated_at": "2022-03-07T17:54:28.000000Z",
                "personals": [
                    {
                        "id": "US00000",
                        "first_name": "Test",
                        "last_name": "Test",
                        "email": "test@gsss.ff",
                        "pivot": {
                            "wallet_id": "W00000",
                            "user_id": "US00000"
                        }
                    }
                ]
            }
        ],
        "first_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "from": 1,
        "last_page": 1,
        "last_page_url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://monicredit2.test/api/v1/wallet/personals?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": null,
        "path": "http://monicredit2.test/api/v1/wallet/personals",
        "per_page": 20,
        "prev_page_url": null,
        "to": 1,
        "total": 1
    }
}
```
{% endtab %}
{% endtabs %}
