# Check Balance

`GET /api/balance`

Retrieve the current account balance for the authenticated user. This endpoint returns the available balance that can be used for broadcasts and surveys.

## Request Example

```bash
curl -X GET https://api.awajdigital.com/api/balance \
  -H "Authorization: Bearer your_api_token_here" \
  -H "Accept: application/json"
```

```javascript
// Browser JavaScript (Fetch API)
const response = await fetch('https://api.awajdigital.com/api/balance', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer your_api_token_here',
    'Accept': 'application/json'
  }
});

const data = await response.json();
console.log(data);
```

```javascript
// Node.js with axios
const axios = require('axios');

async function getBalance() {
  try {
    const response = await axios.get('https://api.awajdigital.com/api/balance', {
      headers: {
        'Authorization': 'Bearer your_api_token_here',
        'Accept': 'application/json'
      }
    });

    console.log(response.data);
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

getBalance();
```

```python
# Python with requests
import requests

def get_balance():
    url = 'https://api.awajdigital.com/api/balance'
    headers = {
        'Authorization': 'Bearer your_api_token_here',
        'Accept': 'application/json'
    }

    try:
        response = requests.get(url, headers=headers)
        print(response.json())
    except requests.exceptions.RequestException as e:
        print(f'Error: {e}')

get_balance()
```

```php
<?php
// PHP with cURL
$url = 'https://api.awajdigital.com/api/balance';
$token = 'your_api_token_here';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $token,
    'Accept: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);
?>
```

## Success Response Example

```json
{
  "success": true,
  "balance": 1250.75
}
```

:::note[Balance]
The balance is returned as a number representing the amount in your account currency (BDT). Use this endpoint to check your balance before creating broadcasts or surveys.
:::