Open Token to Secondary Market
Opens a token to the secondary market (holders listing their tokens for other investors) or closes it. The call is asynchronous: it queues an OpenToSecondaryMarket transaction (type 11) in the token's own transactions and answers with its id. is_open_to_secondary_market on the token changes only when the transaction reaches 3 (Done); poll it with Get Token Transaction By ID.
A request for the value the token already has is refused (10027), and so is a request while an earlier change of this flag is still running (10028). The flag cannot tell the two apart on its own, because it only moves once a change settles.
Required permission: token:open-secondary-market
Request
POST /v2/admin/tokens/{token_id}/open-to-secondary-market
Parameters
| Name | Type | In | Description |
|---|---|---|---|
token_id | string | path | Required. Token id. |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
is_open | boolean | No | true opens the token to the secondary market, false closes it. Omitted, it reads as false. |
Example
curl --request POST \
--url '{{baseUrl}}/v2/admin/tokens/67d8774e903bfcbe7eb5d93e/open-to-secondary-market' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{ "is_open": true }'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a12"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The OpenToSecondaryMarket transaction. Poll it with Get Token Transaction By ID. |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | The body cannot be read (for example is_open is not a boolean) |
| 400 | 10016 | token_id is not a valid id |
| 400 | 10001 | Token not found (token domain 5) |
| 403 | 10005 | The caller's node does not cover the token's node (node domain 2) |
| 409 | 10027 | is_open_to_secondary_market already holds the requested value; nothing will happen (token domain 5) |
| 409 | 10028 | A change to this flag is already in progress; wait for its transaction to settle (token domain 5) |
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.