Skip to main content

Get Purchase Quantity

Returns how much of a token the user holds and the per-user holding cap of that token. Use it before a primary-market buy: Buy On Primary Market refuses a buy that would take the user's holding above max_allowed_quantity.

Required permission: purchase:view

Request​

GET /v2/users/{user_id}/purchases/tokens/{token_id}/quantity

Parameters​

NameTypeInDescription
user_idstringpathRequired. User ID
token_idstringpathRequired. Token ID

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>

Example​

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

Response​

{
"purchased_quantity": 25,
"max_allowed_quantity": 100
}

Response Fields​

FieldTypeDescription
purchased_quantityintegerQuantity of the token the user still holds (bought minus sold). 0 when the user holds none
max_allowed_quantityintegerThe token's per-user holding cap (metric.max_purchase_quantity). 0 means no cap

Errors​

StatusCodeDescription
40010001Token not found (domain 5). Also returned when token_id is not a valid id
40010016user_id is not a valid 24-character hex id
50010000Unexpected server-side failure

See Errors for the error format and common codes.