Rent Token
Distributes one period of the token's rental income to its holders. Only holders with at least metric.min_tokens_required_for_rental_income tokens are paid. The token's rental terms must be set (see Update Token Metric); read Get Rental Summary first to see what the distribution will pay.
The call is asynchronous: it queues a TokenRent transaction (type 3) and answers with its id. Poll Get Token Transaction By ID. The distribution shows up in Get Token Deposits as pending (status: 1) once the contract call is submitted, then settled (status: 0) when it confirms or canceled (status: 2) when it fails. The per-holder payouts are recorded at settlement and listed in Get Token Rents.
Required permission: token:payment-rent
Request
POST /v2/admin/tokens/{token_id}/rent
Parameters
| Name | Type | In | Description |
|---|---|---|---|
token_id | string | path | Required. Token id. |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request POST \
--url '{{baseUrl}}/v2/admin/tokens/67d8774e903bfcbe7eb5d93e/rent' \
--header 'Authorization: Bearer <access_token>'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a12"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The TokenRent transaction. Poll it with Get Token Transaction By ID. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10016 | token_id is not a valid id |
| 400 | 10001 | Token not found (token domain 5) |
| 400 | 10023 | The token has no rental income configured (token domain 5) |
| 403 | 10005 | The caller's node does not cover the token's node (node domain 2) |
A failure after acceptance ends the transaction in status 4 (Error) with the reason in its error field. See Errors for the error format and common codes.