Get User Group Search
Search for purchase groups associated with a specific user.
Endpoint
POST /v2/users/purchases/users/{user_id}/group-search
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | The unique identifier of the user |
Request Body
{
"page": 1,
"per_page": 10,
"is_for_secondary": false,
"is_for_otc": false
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | Yes | Page number for pagination |
| per_page | integer | Yes | Number of items per page |
| is_for_secondary | boolean | No | Filter for secondary market purchases |
| is_for_otc | boolean | No | Filter for OTC 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"
}
],
"pagination": {
"current_page": 1,
"per_page": 10,
"total": "number",
"total_pages": "number"
}
}
Example
Request
curl -X POST "\{\{baseUrl\}\}/v2/users/purchases/users/680c02896d91ca0145cfeb81/group-search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"page": 1,
"per_page": 10,
"is_for_secondary": false,
"is_for_otc": false
}'
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"
}
],
"pagination": {
"current_page": 1,
"per_page": 10,
"total": 1,
"total_pages": 1
}
}
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"
}