> For the complete documentation index, see [llms.txt](https://docs.tylt.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tylt.money/tylt-embedded-wallet-service/wallet-management-apis/get-holdings.md).

# Get Holdings

Retrieves the end user’s wallet holdings across supported assets.

### Endpoint

```http
GET /whitelabel/wallet/getHoldings
```

### Request Headers

```http
x-tlp-apikey: <api-key>
x-tlp-signature: <hmac-signature>
```

### Query Parameters

Provide at least one of the following user identifiers: `endUserEmail`, `endUserId`, or `externalUserId`.

| Field            | Type   |    Required | Description                         |
| ---------------- | ------ | ----------: | ----------------------------------- |
| `endUserEmail`   | String | Conditional | End user’s registered email address |
| `endUserId`      | Number | Conditional | Tylt end-user ID                    |
| `externalUserId` | String | Conditional | Merchant’s own user identifier      |

At least one identifier is required.

```http
GET /whitelabel/wallet/getHoldings?externalUserId=user-10021
```

The signed query object is:

```json
{
  "endUserId": 20001, // Optional: Provide one user identifier only
  "endUserEmail": "joe@example.com", // Optional: Alternative to endUserId and externalUserId
  "externalUserId": "user-10021", // Optional: Alternative to endUserId and endUserEmail
}
```

Additional filters may be supported by the underlying wallet controller.

### Code Snippet

{% tabs %}
{% tab title="JavaScript (Axios)" %}

```javascript
import crypto from 'crypto';
import axios from 'axios';

const apiKey = 'your-api-key';
const apiSecret = 'your-api-secret';

const queryParams = {
  endUserId: 20001, // Optional: Provide one user identifier only
  endUserEmail: "joe@example.com", // Optional: Alternative to endUserId and externalUserId
  externalUserId: "user-10021", // Optional: Alternative to endUserId and endUserEmail
};

const rawPayload = JSON.stringify(queryParams);
const signature = crypto.createHmac('sha256', apiSecret).update(rawPayload).digest('hex');

const headers = {
    'x-tlp-apikey': apiKey,
    'x-tlp-signature': signature
};

const queryString = new URLSearchParams(queryParams).toString();
axios.get(`https://api.tylt.money/whitelabel/wallet/getHoldings?${queryString}`, { headers })
    .then(response => console.log(response.data))
    .catch(error => console.error('Error:', error.response ? error.response.data : error.message));
```

{% endtab %}
{% endtabs %}

### Example Response

```json
{
  "msg": "",
  "data": [
    {
      "currencyId": 2805,
      "currencySymbol": "USDT",
      "balance": "5.500000000000000000000000000000",
      "currencyImg": "https://assets.tylt.money/holdings-icons/USDT.png"
    },
    {
      "currencyId": 2803,
      "currencySymbol": "USDC",
      "balance": "0.000000000000000000000000000000",
      "currencyImg": "https://assets.tylt.money/holdings-icons/USDC.png"
    }
  ]
}
```

The exact balance fields depend on the deployed wallet controller.

Possible values may include:

| Field            | Description                        |
| ---------------- | ---------------------------------- |
| `currencyId`     | Token Id                           |
| `currencySymbol` | Currency symbol                    |
| `balance`        | Available balance of that currency |
| `currencyImg`    | Image asset of that currency       |

### Use Cases

Use this endpoint to:

* Display the user’s wallet portfolio
* Show multiple asset balances
* Build a wallet dashboard
* Determine which assets the user currently holds

***
