# Account Balance

## Request <a href="#account-balance-request" id="account-balance-request"></a>

<mark style="color:green;">`POST`</mark> <https://connect.lhv.com/account-balance>

Account Balance provides actual and free balance information for any existing currencies on Customer account. It can be requested for one Customer Account at a time. Balances are provided real-time on the moment of generating the response. With optional Prtry parameter now also Payment limits info can be requested - both total and free limits for Daily and Monthly periods.

{% hint style="info" %}
Both Account Statement and Account Balance request share the same ISO 20022 Account Report Request camt.060.001.03 XML format.

Depending on the service different values in the Request can be used to get data for different periods or details. Some of these affect only Statements or Balances responses.
{% endhint %}

{% file src="<https://2266620947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHGywduAxJuxV3reZhASh%2Fuploads%2FparhGrthPjrEkJVUUvZC%2Fcamt.060.001.03.xsd?alt=media&token=948dea76-3fcb-475c-bbbb-d134f7f92beb>" %}
camt.060.001.03 XSD schema
{% endfile %}

#### **Headers**

<table><thead><tr><th width="297">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/xml</code></td></tr><tr><td>Client-Code</td><td><code>customer value</code></td></tr><tr><td>Client-Country</td><td><code>customer value</code></td></tr></tbody></table>

### **Body**

XML structure description:

**Message root**

| INDEX   | MESSAGE ELEMENT | XML TAG        |
| ------- | --------------- | -------------- |
| \[1..1] | MessageRoot     | \<AcctRptgReq> |

**Group header and Reporting Request**

<table data-full-width="true"><thead><tr><th width="99">MULT.</th><th width="262">MESSAGE ELEMENT</th><th width="182">XML TAG</th><th>DESCRIPTION</th><th data-hidden>INDEX</th></tr></thead><tbody><tr><td>[1..1]</td><td>+GroupHeader</td><td>&#x3C;GrpHdr></td><td></td><td>1.0</td></tr><tr><td>[1..1]</td><td>++MessageIdentification</td><td>&#x3C;MsgId></td><td>Unique message identifier generated by requesting party.</td><td>1.1</td></tr><tr><td>[1..1]</td><td>++CreationDateTime</td><td>&#x3C;CreDtTm></td><td></td><td>1.2</td></tr><tr><td>[1..1]</td><td>+ReportingRequest</td><td>&#x3C;RptgReq></td><td></td><td>2.0</td></tr><tr><td>[0..1]</td><td>++Identification</td><td>&#x3C;Id></td><td></td><td>2.1</td></tr><tr><td>[1..1]</td><td>++RequestedMessageNameIdentification</td><td>&#x3C;ReqdMsgNmId></td><td><p>Supported values:</p><ul><li><p>'camt.053.001.02' – Used for account statement requests</p><ul><li>Endpoint: POST /account-statement</li></ul></li><li><p>'camt.052.001.06' – Used for account balance requests</p><ul><li>Endpoint: POST /account-balance</li></ul></li></ul></td><td>2.2</td></tr><tr><td>[0..1]</td><td>++Account</td><td>&#x3C;Acct></td><td></td><td>2.3</td></tr><tr><td>[1..1]</td><td>+++Identification</td><td>&#x3C;Id></td><td></td><td>2.3</td></tr><tr><td>[1..1]</td><td>++++IBAN</td><td>&#x3C;IBAN></td><td><ul><li>IBAN of the account to which the report request applies.</li><li><p>When using VIBAN or Indirect Scheme Participant account services, the master account IBAN must be provided. </p><ul><li>VIBANs or Indirect Scheme Participant accounts are displayed only in the account statement report and are not accepted in the request.</li></ul></li></ul></td><td>2.3</td></tr><tr><td>[1..1]</td><td>++AccountOwner</td><td>&#x3C;AcctOwnr></td><td></td><td>2.4</td></tr><tr><td>[1..1]</td><td>+++Party</td><td>&#x3C;Pty></td><td>Values are ignored.</td><td>2.4</td></tr><tr><td>[0..1]</td><td>++ReportingPeriod</td><td>&#x3C;RptgPrd></td><td></td><td>2.8</td></tr><tr><td>[1..1]</td><td>+++FromToDate</td><td>&#x3C;FrToDt></td><td>Date filters apply only to statement requests; balance requests always return real-time data.</td><td>2.9</td></tr><tr><td>[1..1]</td><td>++++FromDate</td><td>&#x3C;FrDt></td><td><ul><li><p>Statement request:</p><ul><li>Account statement FromDate in ISO 8601 date format (YYYY-MM-DD). </li><li>Must not be later than ToDate. </li><li>Used together with ToDate to define the requested reporting period.</li></ul></li><li><p>Balance request:</p><ul><li>Value is ignored. Balance responses always return real-time balances, independent of the provided date.</li></ul></li></ul></td><td>2.9</td></tr><tr><td>[1..1]</td><td>++++ToDate</td><td>&#x3C;ToDt></td><td><ul><li><p>Statement request:</p><ul><li>Account statement ToDate in ISO 8601 date format (YYYY-MM-DD). </li><li>Must not be earlier than FromDate. </li><li>If a future date is provided, the system uses the current day as the effective end date.</li></ul></li><li><p>Balance request:</p><ul><li>Value is ignored. Balance responses always return real-time balances, independent of the provided date.</li></ul></li></ul></td><td>2.9</td></tr><tr><td>[1..1]</td><td>+++FromToTime</td><td>&#x3C;FrToTm></td><td><p>Time filters apply only to statement requests; balance requests always return real-time data.</p><p></p><ul><li>Values are ignored if Requested Balance Type (ReqdBalTp) block is not added or if ReqdBalTp.CdOrPrtry.Cd.Prtry = 'DATE'. </li><li>Values are used when ReqdBalTp.CdOrPrtry.Cd.Prtry = 'DATETIME'</li></ul></td><td>2.10</td></tr><tr><td>[1..1]</td><td>+++FromTime</td><td>&#x3C;FrTm></td><td><ul><li><p>Statement request:</p><ul><li>Account statement FromTime in ISO 8601 time format with UTC offset (e.g. 11:00:00+02:00). </li><li>Inclusive. </li><li>Used together with ToTime when the reporting period type is set to 'DATETIME'.</li></ul></li><li><p>Balance request:</p><ul><li>Value is ignored. Balance responses always return real-time balances, independent of the provided time range.</li></ul></li></ul></td><td>2.10</td></tr><tr><td>[1..1]</td><td>+++ToTime</td><td>&#x3C;ToTm></td><td><ul><li><p>Statement request:</p><ul><li>Account statement ToTime in ISO 8601 time format with UTC offset (e.g. 11:00:00+02:00). </li><li>Exclusive. </li><li>Used together with FromTime when the reporting period type is set to 'DATETIME'.</li></ul></li><li><p>Balance request:</p><ul><li>Value is ignored. Balance responses always return real-time balances, independent of the provided time range.</li></ul></li></ul></td><td>2.10</td></tr><tr><td>[1..1]</td><td>+++Type</td><td>&#x3C;Tp></td><td>‘ALLL’</td><td>2.13</td></tr><tr><td>[0..1]</td><td>++Requested Balance Type</td><td>&#x3C;ReqdBalTp></td><td>Provides details on the requested balance reporting.</td><td>2.14</td></tr><tr><td>[1..1]</td><td>+++Code or Proprietary</td><td>&#x3C;CdOrPrtry></td><td></td><td>2.14</td></tr><tr><td>[1..1]</td><td>++++Code</td><td>&#x3C;Cd></td><td>Not used</td><td>2.14</td></tr><tr><td>[1..1]</td><td>++++Proprietary</td><td>&#x3C;Prtry></td><td><ul><li><p>Statement request:</p><ul><li>'DATE' – Statement is generated based on FromDate and ToDate only. FromTime and ToTime are ignored.</li><li>'DATETIME' – Statement is generated using FromDate / ToDate together with FromTime and ToTime.</li></ul></li><li><p>Balance request:</p><ul><li>PAYMENT_LIMITS – Balance response additionally includes payment limits information.</li></ul></li></ul></td><td>2.14</td></tr></tbody></table>

#### Samples

{% tabs %}
{% tab title="Balances only" %}
Account balance request example (without limits):

{% code fullWidth="true" %}

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.060.001.03">
    <AcctRptgReq>
        <GrpHdr>
            <MsgId>MSGIDLHVTEST02</MsgId>
            <CreDtTm>2026-02-10T08:03:00.331+01:00</CreDtTm>
        </GrpHdr>
        <RptgReq>
            <ReqdMsgNmId>camt.052.001.06</ReqdMsgNmId>
            <Acct>
                <Id>
                    <IBAN>GB20LHVB04031512345679</IBAN>
                </Id>
            </Acct>
            <AcctOwnr>
                <Pty/>
            </AcctOwnr>
        </RptgReq>
    </AcctRptgReq>
</Document>
```

{% endcode %}
{% endtab %}

{% tab title="Balances with limits" %}
Account balance request example (with payment limits):

{% code fullWidth="true" %}

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.060.001.03">
    <AcctRptgReq>
        <GrpHdr>
            <MsgId>MSGIDLHVTEST02</MsgId>
            <CreDtTm>2026-02-10T08:03:00.331+01:00</CreDtTm>
        </GrpHdr>
        <RptgReq>
            <ReqdMsgNmId>camt.052.001.06</ReqdMsgNmId>
            <Acct>
                <Id>
                    <IBAN>GB20LHVB04031512345679</IBAN>
                </Id>
            </Acct>
            <AcctOwnr>
                <Pty/>
            </AcctOwnr>
            <ReqdBalTp>
                <CdOrPrtry>
                    <Prtry>PAYMENT_LIMITS</Prtry>
                </CdOrPrtry>
            </ReqdBalTp>
        </RptgReq>
    </AcctRptgReq>
</Document>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### **Response**

**Headers**

<table><thead><tr><th width="312">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/xml</code></td></tr><tr><td>X-Bank-Code</td><td><code>LHVUK, LHVEE</code></td></tr></tbody></table>

#### Body

{% tabs %}
{% tab title="202" %}
{% hint style="success" %}
Request accepted - no content
{% endhint %}
{% endtab %}

{% tab title="403" %}
{% hint style="danger" %}
Error code and description
{% endhint %}

<pre><code>&#x3C;Errors>
<strong>    &#x3C;Error>
</strong>        &#x3C;ErrorCode>FORBIDDEN&#x3C;/ErrorCode>
        &#x3C;Description>User doesn't exist&#x3C;/Description>
    &#x3C;/Error>
&#x3C;/Errors>
</code></pre>

{% endtab %}
{% endtabs %}

## Response Message <a href="#account-balance-response" id="account-balance-response"></a>

Response message is created and can be requests by the Messages services - [messages](https://docs.lhv.com/home/connect/services/messages "mention")

{% hint style="info" %}
Response message format is ISO standard camt.052.001.06

HTTP Header Message-Response-Type: ACCOUNT\_BALANCE
{% endhint %}

{% file src="<https://2266620947-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHGywduAxJuxV3reZhASh%2Fuploads%2FTZ7LymUatrE1J0AWA8zE%2Fcamt.052.001.06.xsd?alt=media&token=6477e9f0-2361-4763-b6d9-1f1b7bf46201>" %}
camt.052.001.06.xsd schema
{% endfile %}

### Body

**Message root**

| INDEX   | MESSAGE ELEMENT | XML TAG             |
| ------- | --------------- | ------------------- |
| \[1..1] | MessageRoot     | \<BkToCstmrAcctRpt> |

**Group header**

<table data-full-width="true"><thead><tr><th width="124">MULT.</th><th width="239">MESSAGE ELEMENT</th><th width="152">XML TAG</th><th>DESCRIPTION</th><th data-hidden>INDEX</th></tr></thead><tbody><tr><td>[1..1]</td><td>+GroupHeader</td><td>&#x3C;GrpHdr></td><td></td><td>1.0</td></tr><tr><td>[1..1]</td><td>++MessageIdentification</td><td>&#x3C;MsgId></td><td>Unique message identifier generated by LHV.</td><td>1.1</td></tr><tr><td>[1..1]</td><td>++CreationDateTime</td><td>&#x3C;CreDtTm></td><td>Date and time when the account statement message is created at LHV.</td><td>1.2</td></tr><tr><td>[0..1]</td><td>++MessageRecipient</td><td>&#x3C;MsgRcpt></td><td>Not used.</td><td>1.3</td></tr><tr><td>[0..1]</td><td>++MessagePagination</td><td>&#x3C;MsgPgntn></td><td>Not used.</td><td>1.4</td></tr></tbody></table>

**Report**

<table data-full-width="true"><thead><tr><th width="128.5">MULT.</th><th width="230">MESSAGE ELEMENT</th><th width="167">XML TAG</th><th>DESCRIPTION</th><th data-hidden>INDEX</th></tr></thead><tbody><tr><td>[1..n]</td><td>+Report</td><td>&#x3C;Rpt></td><td>Report block is generated per every account and currency.</td><td>2.0</td></tr><tr><td>[1..1]</td><td>++Identification</td><td>&#x3C;Id></td><td>Unique identification generated by LHV.</td><td>2.1</td></tr><tr><td>[1..1]</td><td>++CreationDateTime</td><td>&#x3C;CreDtTm></td><td>Creation date and time.</td><td>2.4</td></tr><tr><td>[0..1]</td><td>++FromToDate</td><td>&#x3C;FrToDt></td><td>Period for what this report is generated.</td><td>2.5</td></tr><tr><td>[1..1]</td><td>+++FromDateTime</td><td>&#x3C;FrDtTm></td><td>From date and time in camt.060.001.02 request.</td><td>2.5</td></tr><tr><td>[1..1]</td><td>+++ToDateTime</td><td>&#x3C;ToDtTm></td><td>To date and time in camt.060.001.02 request.</td><td>2.5</td></tr><tr><td>[1..1]</td><td>++Account</td><td>&#x3C;Acct></td><td></td><td>2.10</td></tr><tr><td>[1..1]</td><td>+++Identification</td><td>&#x3C;Id></td><td></td><td>2.10</td></tr><tr><td>[1..1]</td><td>++++IBAN</td><td>&#x3C;IBAN></td><td>Account number for what this report is generated.</td><td>2.10</td></tr><tr><td>[0..1]</td><td>+++Currency</td><td>&#x3C;Ccy></td><td>Currency of this report block.</td><td>2.10</td></tr><tr><td>[0..n]</td><td>++Balance</td><td>&#x3C;Bal></td><td>Report has two balances: current booked balance and current available balance.</td><td>2.23</td></tr><tr><td>[1..1]</td><td>+++Type</td><td>&#x3C;Tp></td><td></td><td>2.24</td></tr><tr><td>[1..1]</td><td>++++CodeOrProprietary</td><td>&#x3C;CdOrPrtry></td><td></td><td>2.25</td></tr><tr><td>[0..1]</td><td>+++++Code</td><td>&#x3C;Cd></td><td>ITAV for current available balance;<br>ITBD for interim booked balance.</td><td>2.26</td></tr><tr><td>[0..1]</td><td>+++++Proprietary</td><td>&#x3C;Prtry></td><td>PAYMENT_LIMIT_MONTHLY_TOTAL - total Monthly limit;<br>PAYMENT_LIMIT_MONTHLY_FREE free Monthly limit.<br>PAYMENT_LIMIT_DAILY_TOTAL - total Daily limit;<br>PAYMENT_LIMIT_DAILY_FREE free Daily limit.</td><td>2.26</td></tr><tr><td>[1..1]</td><td>+++Amount</td><td>&#x3C;Amt></td><td>Balance amount.</td><td>2.34</td></tr><tr><td>[1..1]</td><td>+++CreditDebitIndicator</td><td>&#x3C;CdtDbtInd></td><td>See the codes in <a href="https://partners.lhv.ee/en/connect/#code-set-credit-and-debit-code">Code Set: Credit and Debit Code</a>.</td><td>2.35</td></tr><tr><td>[1..1]</td><td>+++Date</td><td>&#x3C;Dt></td><td></td><td>2.36</td></tr><tr><td>[1..1]</td><td>++++Date</td><td>&#x3C;Dt></td><td>Date of the balance.</td><td>2.36</td></tr><tr><td>[0..n]</td><td>++Entry</td><td>&#x3C;Ntry></td><td>Entry data is not returned.</td><td>2.76</td></tr></tbody></table>

#### Samples

{% tabs %}
{% tab title="Balances data" %}
Sample has balances in EUR and GBP. Payment limits are in EUR.

```xml
<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:camt.052.001.06" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:camt.052.001.06 camt.052.001.06.xsd">
  <BkToCstmrAcctRpt>
    <GrpHdr>
      <MsgId>e6bddc758ae4449d9f0f147708eb8e25</MsgId>
      <CreDtTm>2022-05-02T16:02:17.543126</CreDtTm>
    </GrpHdr>
	<Rpt>
      <Id>e6bddc758ae4449d9f0f147708eb8e25EUR</Id>
      <CreDtTm>2022-05-02T16:02:17.543126</CreDtTm>
      <FrToDt>
        <FrDtTm>2022-05-02T16:02:17.543126</FrDtTm>
        <ToDtTm>2022-05-02T16:02:17.543126</ToDtTm>
      </FrToDt>
      <Acct>
        <Id>
          <IBAN>GB20LHVB04031512345679</IBAN>
        </Id>
        <Ccy>EUR</Ccy>
      </Acct>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Cd>ITBD</Cd>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">110003428.63</Amt>
        <CdtDbtInd>CRDT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Cd>ITAV</Cd>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">109998795.38</Amt>
        <CdtDbtInd>CRDT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Prtry>PAYMENT_LIMIT_MONTHLY_TOTAL</Prtry>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">100000.00</Amt>
        <CdtDbtInd>DBIT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Prtry>PAYMENT_LIMIT_MONTHLY_FREE</Prtry>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">99995.00</Amt>
        <CdtDbtInd>DBIT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Prtry>PAYMENT_LIMIT_DAILY_TOTAL</Prtry>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">10000.00</Amt>
        <CdtDbtInd>DBIT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Prtry>PAYMENT_LIMIT_DAILY_FREE</Prtry>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="EUR">9995.00</Amt>
        <CdtDbtInd>DBIT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
    </Rpt>
	<Rpt>
      <Id>e6bddc758ae4449d9f0f147708eb8e25GBP</Id>
      <CreDtTm>2022-05-02T16:02:17.543126</CreDtTm>
      <FrToDt>
        <FrDtTm>2022-05-02T16:02:17.543126</FrDtTm>
        <ToDtTm>2022-05-02T16:02:17.543126</ToDtTm>
      </FrToDt>
      <Acct>
        <Id>
          <IBAN>GB20LHVB04031512345679</IBAN>
        </Id>
        <Ccy>GBP</Ccy>
      </Acct>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Cd>ITBD</Cd>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="GBP">110000037.12</Amt>
        <CdtDbtInd>CRDT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
      <Bal>
        <Tp>
          <CdOrPrtry>
            <Cd>ITAV</Cd>
          </CdOrPrtry>
        </Tp>
        <Amt Ccy="GBP">110000037.12</Amt>
        <CdtDbtInd>CRDT</CdtDbtInd>
        <Dt>
          <Dt>2022-05-02</Dt>
        </Dt>
      </Bal>
    </Rpt>
  </BkToCstmrAcctRpt>
</Document>
```

{% endtab %}
{% endtabs %}

**Error codes**

Service specific errors

<table><thead><tr><th width="361">ERROR CODE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td>errStatement_NoAccess</td><td>No access to the account.</td></tr></tbody></table>
