Search Rent Tokens
Search for rent tokens associated with a specific user and token.
Endpoint
POST /v2/users/rents/users/{user_id}/tokens/{token_id}/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 |
| token_id | string | Yes | The unique identifier of the token |
Request Body
{
"page": 1,
"per_page": 10
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | Yes | Page number for pagination |
| per_page | integer | Yes | Number of items per page |
Response
Returns a paginated list of rent tokens associated with the user and token.
Success Response (200 OK)
{
"data": [
{
"id": "string",
"user_id": "string",
"token_id": "string",
"deposit_id": "string",
"external_id": "number",
"price": "number",
"contract_created_at": "string",
"created_at": "string",
"updated_at": "string"
}
],
"total": "number",
"page": "number",
"per_page": "number"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier of the rent record |
| user_id | string | Unique identifier of the user |
| token_id | string | Unique identifier of the token |
| deposit_id | string | Unique identifier of the deposit |
| external_id | number | External identifier |
| price | number | Price of the rent (null if not set) |
| contract_created_at | string | Timestamp when contract was created (null if not created) |
| created_at | string | Timestamp when the record was created |
| updated_at | string | Timestamp when the record was last updated |
Example
Request
curl -X POST "{{baseUrl}}/v2/users/rents/users/680c02896d91ca0145cfeb81/tokens/68ae06cfcccf4e8fc19362d1/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"page": 1,
"per_page": 10
}'
Response
{
"data": [
{
"id": "68d6e57c61d63aa6705baacb",
"user_id": "680c02896d91ca0145cfeb81",
"token_id": "68ae06cfcccf4e8fc19362d1",
"deposit_id": "67c918d789486081f8ca5dac",
"external_id": 0,
"price": null,
"contract_created_at": null,
"created_at": "2025-04-21T18:11:23.596Z",
"updated_at": "2025-04-21T18:11:23.596Z"
}
],
"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 or token not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}