> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beem.africa/llms.txt
> Use this file to discover all available pages before exploring further.

# Check balance

> Retrieve your available Bpay credit balance.

Use `GET /v1/credit-balance` to retrieve your available Bpay balance.

**Endpoint:** `https://apitopup.beem.africa/v1/credit-balance?app_name=BPAY`

See [Check Bpay credit balance](/api-reference/payments-collection/check-bpay-credit-balance) for the interactive API reference.

***

## Request parameters

### Headers

| Header          | Required | Description                                                                                   |
| --------------- | -------- | --------------------------------------------------------------------------------------------- |
| `Authorization` | Yes      | Basic Auth or access token — see [Authentication](/guides/payments-collection/authentication) |
| `Content-Type`  | Yes      | `application/json`                                                                            |

### Query parameters

| Parameter  | Required | Description   |
| ---------- | -------- | ------------- |
| `app_name` | Yes      | Set to `BPAY` |

***

## Sample implementations

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={null}
    const axios = require("axios");
    const https = require("https");
    const btoa = require("btoa");

    const api_key = "<api_key>";
    const secret_key = "<secret_key>";
    const url = "https://apitopup.beem.africa/v1/credit-balance?app_name=BPAY";

    function checkBalance() {
      axios
        .get(url, {
          headers: {
            "Content-Type": "application/json",
            Authorization: "Basic " + btoa(api_key + ":" + secret_key),
          },
          httpsAgent: new https.Agent({ rejectUnauthorized: false }),
        })
        .then((response) => console.log(response.data))
        .catch((error) => console.error(error.response.data));
    }

    checkBalance();
    ```
  </Tab>

  <Tab title="PHP">
    ```php theme={null}
    <?php
    $api_key = '<api_key>';
    $secret_key = '<secret_key>';
    $url = 'https://apitopup.beem.africa/v1/credit-balance?app_name=BPAY';

    $ch = curl_init($url);
    curl_setopt_array($ch, [
      CURLOPT_HTTPGET => true,
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
        'Authorization: Basic ' . base64_encode("$api_key:$secret_key"),
        'Content-Type: application/json',
      ],
      CURLOPT_SSL_VERIFYHOST => 0,
      CURLOPT_SSL_VERIFYPEER => 0,
    ]);

    $response = curl_exec($ch);
    if ($response === false) {
      die(curl_error($ch));
    }
    var_dump($response);
    ?>
    ```
  </Tab>

  <Tab title="GitHub">
    [beem-pay-collect-api-sample — userAccountBalance](https://github.com/beemafrica/beem-pay-collect-api-sample/tree/master/userAccountBalance)
  </Tab>
</Tabs>

***

## Success response

**HTTP 200 OK**

```json theme={null}
{
  "data": {
    "credit_bal": "5300.0000"
  }
}
```

***

## Error responses

<Tabs>
  <Tab title="Invalid authentication">
    **HTTP 401 Unauthorized**

    ```json theme={null}
    {
      "code": 120,
      "message": "Invalid Authentication Parameters"
    }
    ```
  </Tab>

  <Tab title="Missing authorization">
    **HTTP 400 Bad Request**

    ```json theme={null}
    {
      "error": "No authorization headers"
    }
    ```
  </Tab>
</Tabs>
