# GET AGENT BALANCE

GET https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance

Retrieves the TRON network wallet address assigned to a specific customer.

**Method:** `GET`  
**URL:** `{{ENDPOINT}}/{{AGENT_ID}}/customers/0809991234/address/tron`

### Parameters

| Variable / Segment | Description |
|---|---|
| `{{ENDPOINT}}` | Base URL of the API server |
| `{{AGENT_ID}}` | Unique identifier of the agent managing the customer |
| `0809991234` | The customer's phone number or unique identifier |
| `tron` | Specifies the blockchain network (TRON) for the wallet address |

### Authentication
Requires an API key passed via the `x-api-key` request header using the `{{API_KEY}}` environment variable.

### Notes
- Returns the TRON blockchain deposit address associated with the given customer.
- Replace `0809991234` with the actual customer identifier when using this request.
- This address is typically used for receiving crypto deposits on the TRON network.

Reference: https://docs.gwapialoha.co/web-api/get-agent-balance

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /[AGENT_ID]/balance:
    get:
      operationId: get-agent-balance
      summary: GET AGENT BALANCE
      description: >-
        Retrieves the TRON network wallet address assigned to a specific
        customer.


        **Method:** `GET`  

        **URL:** `{{ENDPOINT}}/{{AGENT_ID}}/customers/0809991234/address/tron`


        ### Parameters


        | Variable / Segment | Description |

        |---|---|

        | `{{ENDPOINT}}` | Base URL of the API server |

        | `{{AGENT_ID}}` | Unique identifier of the agent managing the customer
        |

        | `0809991234` | The customer's phone number or unique identifier |

        | `tron` | Specifies the blockchain network (TRON) for the wallet
        address |


        ### Authentication

        Requires an API key passed via the `x-api-key` request header using the
        `{{API_KEY}}` environment variable.


        ### Notes

        - Returns the TRON blockchain deposit address associated with the given
        customer.

        - Replace `0809991234` with the actual customer identifier when using
        this request.

        - This address is typically used for receiving crypto deposits on the
        TRON network.
      tags:
        - ''
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GET AGENT BALANCE_Response_200'
servers:
  - url: https://api.gwapialoha.co/api/agents
components:
  schemas:
    GET AGENT BALANCE_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: GET AGENT BALANCE_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

```

## SDK Code Examples

```python
import requests

url = "https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go
package main

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

func main() {

	url := "https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance")

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gwapialoha.co/api/agents/[AGENT_ID]/balance")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```