Skip to main content

Create Token

Creates a token under a node and starts its tokenization on a setup. The call is asynchronous: it stores the token in status 1 (Draft), queues a CreateTokenization transaction (type 1) and answers 201 with both ids. Poll Get Token Transaction By ID with the returned transaction_id: when it reaches 3 (Done) the token is in status 4 (NotListed) with its contract set; when it reaches 4 (Error) the token is in status 3 (Error) and can be retried with Retokenize Token.

The setup decides where the token lives and who signs: a setup is the node's deployment on one wallet and one network, so there is no wallet_id field. The setup must belong to the token's account node (the node's ancestor directly below the platform root, or the node itself when it sits there), its contracts must all be deployed, and network_id must be the setup's network. A token cannot be created on the platform root itself.

Required permission: token:create

Request​

POST /v2/admin/tokens

The body is multipart/form-data when you upload images or documents, or application/json without files. The fields are the same in both.

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. multipart/form-data or application/json

Body​

FieldTypeRequiredDescription
node_idstringYesNode the token is created under (24-character hex id). The caller's node must cover it.
setup_idstringYesSetup to tokenize on. It must belong to the node's account node and have all its contracts deployed. Its wallet signs the tokenization and every later on-chain action of the token.
network_idstringYesNetwork the token runs on. Must be the setup's network.
category_idstringYesCategory the token is filed under. The category's tokenization rules are applied (see Errors).
namestringYesDisplay name.
descriptionstringYesDescription.
token_namestringYesOn-chain token name.
token_symbolstringYesOn-chain token symbol.
currency_token_idstringYesCurrency token the value is expressed in. Its contract must already be deployed.
total_valuestringYesValue of the whole asset, a decimal string greater than zero with no more decimals than the currency token has.
salable_percentagestringYesShare of the asset offered for sale, greater than "0" and at most "100", one decimal at most.
max_supplyintegerYesTotal number of tokens. The token price is total_value × salable_percentage / max_supply.
imagesfileNoMultipart only. Up to 10 images, PNG, JPEG or GIF, each under 2 MB. The first one becomes the default image.
documentsfileNoMultipart only. Up to 10 PDF documents, each under 2 MB. Documents are stored privately and read back through short-lived signed links.
oracle_idstringNoPrice oracle to attach. Used only together with oracle_code.
oracle_codestringNoOne of the oracle's integration codes.

Amounts and percentages follow Amounts and Percentages. Send repeated images / documents parts for several files.

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/tokens' \
--header 'Authorization: Bearer <access_token>' \
--form node_id=67d6c447f47ff3adafda700d \
--form setup_id=6a837bb62998e4fbfed7f52a \
--form network_id=6740e0a20000000000000103 \
--form category_id=667e9251ca818a2138ed4915 \
--form 'name=TKN Token Name' \
--form 'description=Token Description' \
--form token_name=tkn \
--form token_symbol=TKN \
--form currency_token_id=68fe8c129367fd414b227c7a \
--form total_value=12000 \
--form salable_percentage=80 \
--form max_supply=1000 \
--form images=@/path/to/image.png \
--form documents=@/path/to/prospectus.pdf \
--form oracle_id=677ed6e3cc111aea14a3dfc3 \
--form oracle_code=IOG

Without files, the same request as JSON:

curl --request POST \
--url '{{baseUrl}}/v2/admin/tokens' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"node_id": "67d6c447f47ff3adafda700d",
"setup_id": "6a837bb62998e4fbfed7f52a",
"network_id": "6740e0a20000000000000103",
"category_id": "667e9251ca818a2138ed4915",
"name": "TKN Token Name",
"description": "Token Description",
"token_name": "tkn",
"token_symbol": "TKN",
"currency_token_id": "68fe8c129367fd414b227c7a",
"total_value": "12000",
"salable_percentage": "80",
"max_supply": 1000
}'

Response​

201 Created

{
"token_id": "67d8774e903bfcbe7eb5d93e",
"transaction_id": "67d8774f903bfcbe7eb5d941"
}

Response Fields​

FieldTypeDescription
token_idstringId of the new token (status 1, Draft).
transaction_idstringThe CreateTokenization transaction. Poll it with Get Token Transaction By ID.

Errors​

StatusCodeDescription
40010015Validation failed — see details. Also returned when total_value or salable_percentage is zero or malformed, the setup does not exist, belongs to another account node or is on another network than network_id, oracle_code is not one of the oracle's codes, an upload is 2 MB or larger, or the multipart body cannot be read
40010016An id in the body is not a valid id
40010001Node not found (node domain 2)
40310005The caller's node does not cover node_id (node domain 2)
40010007The node has no account node, as for the platform root (node domain 2)
40010011The setup's contracts are not all deployed (node domain 2)
40410001Currency token not found (currency token domain 15)
40010004The currency token's contract is not deployed yet (currency token domain 15)
40010015The category requires salable_percentage to be 100 (token domain 5)
40010016The category requires max_supply to match total_value (token domain 5)
40010001Oracle not found (oracle domain 5, message oracle not found)
40010040An uploaded file's type is not allowed (images: PNG, JPEG, GIF; documents: PDF)

See Errors for the error format and common codes.