---
title: Get account balance
slug: payment/get-account-balance
createdAt: 2025-08-28T09:40:10.470Z
---

:::ApiMethodV2
```json
{
  "name": "/consents/{consentId}/balance",
  "method": "GET",
  "url": "https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/balance",
  "description": "Get the account balance shared via Optimized Journey.",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "196PG1jemj9ffZ8wwrMO1",
        "language": "curl",
        "code": "curl --location --globoff 'https://api-sandbox.klavi.ai/payment/customer/v1/smart/consents/{consentId}/balance' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'",
        "customLabel": ""
      },
      {
        "id": "LlQwi1jEinMRc-lfMtSMb",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': 'https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}/cancel',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   },\n   body: JSON.stringify({\n      \"cancelledBy\": \"string\",\n      \"identifierType\": \"string\"\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "BXdhG7ako9u3KMgtYDl0G",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"cancelledBy\": \"string\",\n   \"identifierType\": \"string\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}/cancel\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "Cx7fgPGvnPtVVjgfH8fCU",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}/cancel\"\n\npayload = json.dumps({\n   \"cancelledBy\": \"string\",\n   \"identifierType\": \"string\"\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "DsdP23y7PPHpbbZCEWxin",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-sandbox.klavi.ai/payment/customer/v1/automatic/consents/{consentId}/payments/{paymentId}/cancel\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"cancelledBy\": \"string\",\n   \"identifierType\": \"string\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "196PG1jemj9ffZ8wwrMO1"
  },
  "results": {
    "languages": [
      {
        "id": "wNZKLfoz8XmKI83gRqNA6",
        "language": "204",
        "code": "",
        "customLabel": ""
      },
      {
        "id": "FlFqlXz0sh-3X3FIw8Xt_",
        "language": "200",
        "code": "{\n    \"availableAmount\": {\n        \"amount\": \"1000.0400\",\n        \"currency\": \"BRL\"\n    },\n    \"updateDateTime\": \"2021-05-21T08:30:00Z\",\n    \"syncDateTime\": \"2021-05-21T08:30:00Z\"\n}"
      }
    ],
    "selectedLanguageId": "FlFqlXz0sh-3X3FIw8Xt_"
  },
  "request": {
    "pathParameters": [
      {
        "name": "consentId",
        "kind": "required",
        "type": "string",
        "description": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id",
        "": "pattern: ^urn:[a-zA-Z0-9][a-zA-Z0-9\\-]{0,31}:[a-zA-Z0-9()+,\\-.:=@;$_!*'%\\/?#]+$\nmaxLength: 256\nConsent Id"
      }
    ],
    "queryParameters": [],
    "headerParameters": [
      {
        "name": "Authorization",
        "kind": "required",
        "type": "string",
        "description": "JWT bearer token",
        "": "JWT bearer token"
      }
    ],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Path Parameter",
    "value": "pathParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "availableAmount",
      "kind": "optional",
      "type": "object",
      "description": "The available amount of the account balance",
      "children": [
        {
          "name": "amount",
          "kind": "optional",
          "type": "string",
          "description": "Pattern: ^-? \\d{1,15}\\.\\d{2.4}$\nMaxLength: 21\nMinLength: 4\nExample: 1000.0400"
        },
        {
          "name": "currency",
          "kind": "optional",
          "type": "string",
          "description": "maxLength: 3\npattern: ^([A-Z]{3})$\nexample: BRL\nNational currency code according to ISO-4217, i.e., 'BRL'. All reported monetary values are represented with the current currency of Brazil"
        }
      ]
    },
    {
      "name": "updateDateTime",
      "kind": "optional",
      "type": "string",
      "description": "example: 2021-05-21T08:30:00Z\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])T(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)Z$\nmaxLength: 20\nInstitution's account balance update time.",
      "children": []
    },
    {
      "name": "syncDateTime",
      "kind": "optional",
      "type": "string",
      "description": "example: 2021-05-21T08:30:00Z\npattern: ^(\\d{4})-(1[0-2]|0?[1-9])-(3[01]|[12][0-9]|0?[1-9])T(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)Z$\nmaxLength: 20\nThe time when we sync the account balance from the institution.",
      "children": []
    }
  ],
  "autoGeneratedAnchorSlug": "consentsconsentidbalance",
  "legacyHash": "TDO-Uuyt5l3kv7SWfCY5K"
}
```
:::





