Get Holding Count
Returns how many token positions the user currently holds: the number of the user's wallet–token balances with a remaining quantity above zero. A token held in two wallets counts twice; a token the user bought and sold in full does not count. Despite the path, this is not the number of purchases; count those with the total of List User Purchases.
Required permission: purchase:view
Request
GET /v2/users/{user_id}/purchases/count
Parameters
| Name | Type | In | Description |
|---|---|---|---|
user_id | string | path | Required. User ID |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request GET \
--url '{{baseUrl}}/v2/users/680c02896d91ca0145cfeb81/purchases/count' \
--header 'Authorization: Bearer <access_token>'
Response
{
"total": 3
}
Response Fields
| Field | Type | Description |
|---|---|---|
total | integer | Number of wallet–token positions with a remaining quantity above zero. 0 for a user who holds nothing |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10016 | user_id is not a valid 24-character hex id |
| 500 | 10000 | Unexpected server-side failure |
See Errors for the error format and common codes.