Skip to main content

Get User Group Search

Search for purchase groups associated with a specific user.

Endpoint

GET /v2/users/{user_id}/purchases/groups

Headers

HeaderValue
AuthorizationBearer {token}

Path Parameters

ParameterTypeRequiredDescription
user_idstringYesThe unique identifier of the user

Query Parameters

This endpoint is a GET: paging and filters travel in the query string, not in a JSON body. There is no request body.

Parameters

ParameterTypeRequiredDescription
pageintegerYesPage number for pagination (min: 1)
per_pageintegerYesNumber of items per page (min: 1, max: 100)
is_for_secondarybooleanNoFilter for secondary market purchases
is_for_otcbooleanNoFilter for OTC purchases
is_for_externalbooleanNoFilter for external purchases

Response

Returns a paginated list of purchase groups associated with the user.

Success Response (200 OK)

{
"data": [
{
"id": "string",
"token_id": "string",
"token_name": "string",
"token_symbol": "string",
"quantity": "number",
"purchase_price": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"total_cost": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"purchase_type": "string",
"purchase_date": "string",
"status": "string",
"transaction_hash": "string"
}
],
"total": "number",
"page": 1,
"per_page": 10
}

Example

Request

curl "\{\{baseUrl\}\}/v2/users/680c02896d91ca0145cfeb81/purchases/groups?page=1&per_page=10" \
-H "Authorization: Bearer \{\{token\}\}"

Response

{
"data": [
{
"id": "purchase_123",
"token_id": "68ae06cfcccf4e8fc19362d1",
"token_name": "Real Estate Token",
"token_symbol": "RET",
"quantity": 25,
"purchase_price": {
"amount": 10.0,
"decimal": 6,
"symbol": "USDT"
},
"total_cost": {
"amount": 250.0,
"decimal": 6,
"symbol": "USDT"
},
"purchase_type": "primary",
"purchase_date": "2024-01-15T10:30:00Z",
"status": "completed",
"transaction_hash": "0x1234567890abcdef1234567890abcdef12345678"
}
],
"total": 1,
"page": 1,
"per_page": 10
}

Error Responses

400 Bad Request

{
"error": "Invalid request parameters"
}

401 Unauthorized

{
"error": "Authentication required"
}

403 Forbidden

{
"error": "Access denied"
}

404 Not Found

{
"error": "User not found"
}

500 Internal Server Error

{
"error": "Internal server error"
}