> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.sqril.io/llms.txt.
> For full documentation content, see https://docs.sqril.io/llms-full.txt.

# Get Account Balances

GET https://stg-api.sqril.io/getAccountBalances

Returns the account's latest balance for all supported currencies (USD and any configured supported_currencies e.g. VND, PHP).

**Authentication:**
- **REQUIRED**: Provide client_id and client_secret via Basic Auth. The exchange_app_id is derived from authenticated credentials.

**Response (200 OK):**
- `balances`: Object keyed by currency code. Each value has `available`, `locked`, `total`, and `currency` (e.g. USD, VND, PHP).

Reference: https://docs.sqril.io/sqril-saa-s-api/transaction-management/get-account-balances

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /getAccountBalances:
    get:
      operationId: get-account-balances
      summary: Get Account Balances
      description: >-
        Returns the account's latest balance for all supported currencies (USD
        and any configured supported_currencies e.g. VND, PHP).


        **Authentication:**

        - **REQUIRED**: Provide client_id and client_secret via Basic Auth. The
        exchange_app_id is derived from authenticated credentials.


        **Response (200 OK):**

        - `balances`: Object keyed by currency code. Each value has `available`,
        `locked`, `total`, and `currency` (e.g. USD, VND, PHP).
      tags:
        - subpackage_transactionManagement
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Transaction Management_Get Account
                  Balances_Response_200
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetGetaccountbalancesRequestUnauthorizedError
servers:
  - url: https://stg-api.sqril.io
components:
  schemas:
    GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesUsd:
      type: object
      properties:
        available:
          type: integer
        locked:
          type: integer
        total:
          type: integer
        currency:
          type: string
      required:
        - available
        - locked
        - total
        - currency
      title: GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesUsd
    GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesVnd:
      type: object
      properties:
        available:
          type: integer
        locked:
          type: integer
        total:
          type: integer
        currency:
          type: string
      required:
        - available
        - locked
        - total
        - currency
      title: GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesVnd
    GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesPhp:
      type: object
      properties:
        available:
          type: integer
        locked:
          type: integer
        total:
          type: integer
        currency:
          type: string
      required:
        - available
        - locked
        - total
        - currency
      title: GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesPhp
    GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalances:
      type: object
      properties:
        USD:
          $ref: >-
            #/components/schemas/GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesUsd
        VND:
          $ref: >-
            #/components/schemas/GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesVnd
        PHP:
          $ref: >-
            #/components/schemas/GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalancesPhp
      required:
        - USD
        - VND
        - PHP
      title: GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalances
    Transaction Management_Get Account Balances_Response_200:
      type: object
      properties:
        balances:
          $ref: >-
            #/components/schemas/GetAccountBalancesGetResponsesContentApplicationJsonSchemaBalances
      required:
        - balances
      title: Transaction Management_Get Account Balances_Response_200
    GetGetaccountbalancesRequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: GetGetaccountbalancesRequestUnauthorizedError

```

## SDK Code Examples

```python Transaction Management_Get Account Balances_example
import requests

url = "https://stg-api.sqril.io/getAccountBalances"

response = requests.get(url)

print(response.json())
```

```javascript Transaction Management_Get Account Balances_example
const url = 'https://stg-api.sqril.io/getAccountBalances';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Transaction Management_Get Account Balances_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://stg-api.sqril.io/getAccountBalances"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Transaction Management_Get Account Balances_example
require 'uri'
require 'net/http'

url = URI("https://stg-api.sqril.io/getAccountBalances")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Transaction Management_Get Account Balances_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://stg-api.sqril.io/getAccountBalances")
  .asString();
```

```php Transaction Management_Get Account Balances_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://stg-api.sqril.io/getAccountBalances');

echo $response->getBody();
```

```csharp Transaction Management_Get Account Balances_example
using RestSharp;

var client = new RestClient("https://stg-api.sqril.io/getAccountBalances");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Transaction Management_Get Account Balances_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://stg-api.sqril.io/getAccountBalances")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```