Skip to main content

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​

NameTypeInDescription
user_idstringpathRequired. User ID

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>

Example​

curl --request GET \
--url '{{baseUrl}}/v2/users/680c02896d91ca0145cfeb81/purchases/count' \
--header 'Authorization: Bearer <access_token>'

Response​

{
"total": 3
}

Response Fields​

FieldTypeDescription
totalintegerNumber of wallet–token positions with a remaining quantity above zero. 0 for a user who holds nothing

Errors​

StatusCodeDescription
40010016user_id is not a valid 24-character hex id
50010000Unexpected server-side failure

See Errors for the error format and common codes.