# Balance

Balance is like your wallet since it will tell you how much money is available to you on Xendit. You can retrieve it to see the current balance on your Xendit cash account. Your balance is debited on any money out transaction, e.g. when performing disbursements or Xendit fees are charged. Your balance is credited when money comes into your account, e.g. invoices are paid or you deposit funds.

<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/xendit/balance?name=ft-4&connection_name=xendit-sanbox-1/`

#### Query Parameters

| Name                                               | Type   | Description     |
| -------------------------------------------------- | ------ | --------------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4            |
| connection\_name<mark style="color:red;">\*</mark> | String | xendit-sanbox-1 |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | U2Fsd...    |

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

```javascript
{
    "balance": 1236570235
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/xendit/balance?name=ft-4&connection_name=xendit-sanbox-1' \
--header 'x-api-key: U2Fsd...'
```

{% endtab %}

{% tab title="NodeJS - Axios" %}

```javascript
var axios = require('axios');
va
var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/xendit/balance?name=ft-4&connection_name=xendit-sanbox-1',
  headers: { 
    'x-api-key': 'U2FsdGVkX1++ZZ4P1XMNg5SK1wAlLl+43SGcdaHpyt+f0fBNSVUHaKvtsRWP4Eu75QTIU5i2oAaBORnsQrRGYQ=='
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="Untitled" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/xendit/balance?name=ft-4&connection_name=xendit-sanbox-1',
  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(
    'x-api-key: U2Fsd...'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}
{% endtabs %}
