> For the complete documentation index, see [llms.txt](https://docs.malum.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.malum.co/account-api/balance-api.md).

# 💸Balance API

#### Endpoint

**POST**\
`https://malum.co/api/v3/account/balance`

#### Headers

To authenticate your request, use the following header structure:

```css
MALUM: {Business ID}:{Secret Key}
```

* **Business ID**: Your Malum account’s unique identifier.
* **Secret Key**: Your API secret key for secure access.

#### Response Format

**Success Response**

When the request is successful, the API will return the following JSON structure:

```json
{
    "status": "success",
    "message": "Balance retrieved.",
    "data": {
        "balance": "10,000.00",
        "pending": "0.00",
        "currency": "USD"
    },
    "timestamp": 1728676259
}
```

* **status**: Message indicating the successful retrieval of the balance.
* **message**: HTTP status code (200 indicates success).
* **data**:
  * **balance**: The available balance in your account.
  * **pending**: Amount pending from any incomplete transactions.
  * **currency**: The currency of the account balance (e.g., USD).
* **timestamp**: Unix timestamp of when the balance was retrieved.

**Error Response**

If the request fails (e.g., invalid API key), the API will return an error in the following format:

```json
{
    "status": "failed",
    "error": "Invalid API Key.",
    "timestamp": 1728676669
}
```

* **status**: Error status message indicating failure.
* **error**: A descriptive error message explaining the issue.
* **timestamp**: Unix timestamp when the error occurred.

#### Example Request

```bash
curl --location --request POST 'https://malum.co/api/v3/account/balance' \
--header 'MALUM: BusinessID:SecretKey'
```

#### Example Success Response

```json
{
    "status": "Balance retrieved.",
    "message": 200,
    "data": {
        "balance": "10,000.00",
        "pending": "0.00",
        "currency": "USD"
    },
    "timestamp": 1728676259
}
```

#### Example Error Response

<pre class="language-json"><code class="lang-json">{
<strong>    "status": "failed",
</strong>    "error": "Invalid API Key.",
    "timestamp": 1728676669
}
</code></pre>

#### Notes

* Ensure that your **Business ID** and **Secret Key** are correct and up-to-date.
* API responses are in JSON format and include a Unix timestamp for logging purposes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.malum.co/account-api/balance-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
