đź’¸Balance API

The Balance API enables you to programmatically retrieve and monitor the wallet balance of your Malum account. Whether you're developing a financial dashboard, automating transactions, or just keeping

Endpoint

POST https://malum.co/api/v3/account/balance

Headers

To authenticate your request, use the following header structure:

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:

{
    "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:

{
    "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

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

Example Success Response

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

Example Error Response

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

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.

Last updated