---
updatedAt: 2026-11-12T11:24:12.000Z
agentTools:
  projectIndex: https://docs.decentro.tech/llms.txt
---

# Get Balance

This API lets the platform fetch the current balance of a virtual account.

# Overview

This API lets the platform fetch the current balance of a virtual account created on Decentro's stack.

# Flow

Below is the flow for using this API.

* The platform creates a virtual account using the [Create a Virtual Account v3](https://docs.decentro.tech/reference/payments_api-virtualaccounts3-create-va) API.
* The payer transfers funds to the virtual account from their bank account.
* The platform gets a [Account Balance Callback/Webhook](https://docs.decentro.tech/reference/payments_api-collectionsv3-balancecallback) from Decentro
* The platform can also fetch the balance of a virtual account using this API

### Managing family of virtual accounts

Clients can easily manage fetching balance of their virtual accounts by selecting from either a single virtual account, a family of virtual accounts, or all virtual accounts associated with a consumer.

To effectively identify the relevant virtual accounts, clients can use one of the following identifiers::

| Identifier               | Results                                                                                                                                                  |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| account\_number          | The API will respond with the balance of the specific virtual\_account\_number in question.                                                              |
| custom\_va\_number       | The API will respond with the cumulative balance of all virtual account numbers across various banks linked to the specified custom VA number.           |
| customer\_va\_identifier | The API will respond with the cumulative balance of all virtual account numbers across different banks associated with the given customer VA identifier. |
| consumer\_urn            | The API will respond with the cumulative balance of all virtual accounts across banks created for the consumer.                                          |

### API Endpoints

Below are the API endpoints to be used by the platform basis the environments.

| Environment       | Endpoint                                               |
| :---------------- | :----------------------------------------------------- |
| Staging / Sandbox | <https://staging.api.decentro.tech/v3/banking/balance> |
| Production        | <https://api.decentro.tech/v3/banking/balance>         |

# Response keys

Below is the response keys

| Response key                              | Description                                                                                                                                                                                                           |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| error\_account\_disabled                  | Your account has been disabled. Please reach out to support                                                                                                                                                           |
| error\_malformed\_request                 | Malformed request detected.                                                                                                                                                                                           |
| error\_empty\_request                     | Request body is empty. Kindly check the payload and retry.                                                                                                                                                            |
| error\_invalid\_method                    | The method is not allowed for the requested URL.                                                                                                                                                                      |
| error\_unsanitized\_values                | Unsanitized values detected for key(s): \<KEY NAME(s)>. Kindly sanitize the corresponding values by removing unicode, non-ascii, and special characters such as . @ # $ % ^ & \* ! ; : ' " \~ \` ? = + ) ( and retry. |
| error\_invalid\_client\_id                | Authentication failed. Please use a valid Client ID.                                                                                                                                                                  |
| error\_empty\_client\_id                  | Client ID cannot be empty. Hint: client\_id (string)                                                                                                                                                                  |
| error\_invalid\_format\_client\_id        | Client ID is not of type string. Hint: client\_id (string)                                                                                                                                                            |
| error\_invalid\_client\_secret            | Authentication failed. Please use a valid Client Secret.                                                                                                                                                              |
| error\_empty\_client\_secret              | Client Secret cannot be empty. Hint: client\_secret (string)                                                                                                                                                          |
| error\_invalid\_format\_client\_secret    | Client Secret is not of type string. Hint: client\_secret (string)                                                                                                                                                    |
| error\_invalid\_bearer\_token             | Authentication failed. Please use a valid bearer token.                                                                                                                                                               |
| error\_empty\_bearer\_token               | Bearer Token cannot be empty. Hint: bearer\_token (string)                                                                                                                                                            |
| error\_invalid\_format\_bearer\_token     | Bearer Token is not of type string. Hint: bearer\_token (string)                                                                                                                                                      |
| error\_invalid\_consumer\_urn             | Consumer URN passed is not valid.                                                                                                                                                                                     |
| error\_empty\_consumer\_urn               | Consumer URN cannot be empty. Hint: consumer\_urn (string)                                                                                                                                                            |
| error\_invalid\_format\_consumer\_urn     | Consumer URN is not of type string. Hint: consumer\_urn (string)                                                                                                                                                      |
| error\_format\_account\_number            | Account Number is not of type string. Hint: account\_number (string)                                                                                                                                                  |
| error\_length\_account\_number            | account\_number length must be between \[minimum] and \[maximum] characters.                                                                                                                                          |
| error\_format\_fetch\_compliance\_balance | Fetch Compliance Balance is not of type boolean. Hint: fetch\_compliance\_balance (boolean, true or false)                                                                                                            |
| error\_empty\_consumer\_urn               | fetch\_compliance\_balance is required if consumer\_urn is provided.                                                                                                                                                  |
| error\_missing\_provider\_code            | provider\_code is required if the account is a Virtual Account (VA).                                                                                                                                                  |
| error\_invalid\_format\_provider\_code    | Provider Code is not of type string. Hint: provider\_code (string)                                                                                                                                                    |
| error\_length\_provider\_code             | provider\_code length must be 4 characters.                                                                                                                                                                           |
| error\_format\_fetch\_child\_balance      | Fetch Child Balance is not of type boolean. Hint: fetch\_child\_balance  (boolean, true or false)                                                                                                                     |
| error\_empty\_consumer\_urn               | fetch\_child\_balance is required if consumer\_urn is provided.                                                                                                                                                       |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "decfin-staging",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://staging.api.decentro.tech"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/v3/banking/balance": {
      "get": {
        "summary": "Get Balance",
        "description": "This API lets the platform fetch the current balance of a virtual account.",
        "operationId": "payments_api-virtualaccounts3-balance",
        "parameters": [
          {
            "name": "client_id",
            "in": "header",
            "description": "Decentro assigned client_id during onboarding.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "merchant_prod"
            }
          },
          {
            "name": "consumer_urn",
            "in": "query",
            "description": "A unique identifier assigned to client's by Decentro during On boarding.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_number",
            "in": "query",
            "description": "The virtual account number for which the balance needs to be fetched.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_secret",
            "in": "header",
            "description": "Decentro assigned client_secret during onboarding.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "merchant_secret"
            }
          },
          {
            "name": "custom_va_number",
            "in": "query",
            "description": "The suffix part of the VA that uniquely identifies each VA. It can be from 6 -10 digit. Eg: va_suffix will be 000001 for virtual account number 46525000001",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_va_identifier",
            "in": "query",
            "description": "Unique customer identifier that is mapped against the virtual account.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fetch_child_balance",
            "in": "query",
            "description": "Pass this flag as true/false depending on whether you want to fetch the balance of a child consumer.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "provider_code",
            "in": "query",
            "description": "Provider code of the bank with which account is created. For example, provider_code: YESB",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fetch_compliance_balance",
            "in": "query",
            "description": "Pass the flag as true/false depending on whether you want to fetch the compliance balance of the consumer",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success: Virtual account balance": {
                    "value": "{\n    \"decentro_txn_id\": \"A49B664CC3F44CB2A1A0A6FC513BFAC1\",\n    \"api_status\": \"SUCCESS\",\n    \"message\": \"Successfully fetched the balance.\",\n    \"data\": {\n        \"account_balance\": {\n            \"account_number\": \"4625250067981922\",\n            \"account_type\": \"VIRTUAL\",\n            \"current_balance\": 0.0,\n            \"minimum_balance\": 0.0\n        }\n    }\n}"
                  },
                  "Success: consumer URN balance (cumulative)": {
                    "value": "{\n    \"decentro_txn_id\": \"D1B356E8E8F04C3C8309DF35FA09CB98\",\n    \"api_status\": \"SUCCESS\",\n    \"message\": \"Successfully fetched the balance.\",\n    \"data\": {\n        \"consumer_cumulative_balance\": 179.5981\n    }\n}"
                  },
                  "Success: customer VA identifier balance (cumulative)": {
                    "value": "{\n    \"decentro_txn_id\": \"2C8B0407002248D38A995B19E9367668\",\n    \"api_status\": \"SUCCESS\",\n    \"message\": \"Successfully fetched the balance.\",\n    \"data\": {\n        \"customer_va_identifier_cumulative_balance\": 0.0\n    }\n}"
                  },
                  "Failure: No virtual account found": {
                    "value": "{\n    \"decentro_txn_id\": \"35D0A0C8822A47E1AA93AF3D69C71171\",\n    \"api_status\": \"FAILURE\",\n    \"message\": \"No account found for the given `account_number`. Kindly try again with the correct value.\",\n    \"response_key\": \"error_account_number_not_found\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success: Virtual account balance",
                      "type": "object",
                      "properties": {
                        "decentro_txn_id": {
                          "type": "string",
                          "example": "A49B664CC3F44CB2A1A0A6FC513BFAC1"
                        },
                        "api_status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "message": {
                          "type": "string",
                          "example": "Successfully fetched the balance."
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "account_balance": {
                              "type": "object",
                              "properties": {
                                "account_number": {
                                  "type": "string",
                                  "example": "4625250067981922"
                                },
                                "account_type": {
                                  "type": "string",
                                  "example": "VIRTUAL"
                                },
                                "current_balance": {
                                  "type": "integer",
                                  "example": 0,
                                  "default": 0
                                },
                                "minimum_balance": {
                                  "type": "integer",
                                  "example": 0,
                                  "default": 0
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Success: consumer URN balance (cumulative)",
                      "type": "object",
                      "properties": {
                        "decentro_txn_id": {
                          "type": "string",
                          "example": "D1B356E8E8F04C3C8309DF35FA09CB98"
                        },
                        "api_status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "message": {
                          "type": "string",
                          "example": "Successfully fetched the balance."
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "consumer_cumulative_balance": {
                              "type": "number",
                              "example": 179.5981,
                              "default": 0
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Success: customer VA identifier balance (cumulative)",
                      "type": "object",
                      "properties": {
                        "decentro_txn_id": {
                          "type": "string",
                          "example": "2C8B0407002248D38A995B19E9367668"
                        },
                        "api_status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "message": {
                          "type": "string",
                          "example": "Successfully fetched the balance."
                        },
                        "data": {
                          "type": "object",
                          "properties": {
                            "customer_va_identifier_cumulative_balance": {
                              "type": "integer",
                              "example": 0,
                              "default": 0
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Failure: No virtual account found",
                      "type": "object",
                      "properties": {
                        "decentro_txn_id": {
                          "type": "string",
                          "example": "35D0A0C8822A47E1AA93AF3D69C71171"
                        },
                        "api_status": {
                          "type": "string",
                          "example": "FAILURE"
                        },
                        "message": {
                          "type": "string",
                          "example": "No account found for the given `account_number`. Kindly try again with the correct value."
                        },
                        "response_key": {
                          "type": "string",
                          "example": "error_account_number_not_found"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {},
              "examples": {
                "Success: Balance fetched": {
                  "value": {
                    "reference_id": "0000-0000-0002",
                    "account_number": "462525xxxxxxxxx1"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```