Allocating tokens to whitelisted investors

If you have whitelisted investors and want to allocate them some tokens, simply call the next endpoint. The number of token allocated is the one given in the uploading of the holders list.

This endpoint can only be called when the T-REX is successfully deployed and the whitelisting is complete.

Authentication

The first step to use the T-REX Factory is to authenticate thanks to the account that has been assigned to you by your account manager. If you don't have any account, please contact your account manager or [email protected].

To authenticate, use the following cURL snippet. Don't forget to replace with your own credentials.

curl -XPOST 'https://servicing-api-staging.tokeny.com/api/auth/signin' \
  -H 'Content-Type: application/json'
  --data '{"email":"[email protected]","password":"My-p@$$w0rd"}'

Allocate tokens

Call the following endpoint to allocate the tokens to the holders whitelisted

cURL

curl -XPOST 'https://trex-factory-api-staging.tokeny.com/api/tokens/<token_id>/holders/mint' \
  -X 'POST' \
  -H 'content-length: 0' \
  -H 'authorization: Bearer <jwt>' \
  -H 'content-type: application/json' \
  -H 'accept: */*' \
  --compressed

Parameters

  • token_id: The identifier of the token
  • jwt: The authorization token from the authentication endpoint

Response

  • 202 if everything went well

Troubleshooting

The format of the error is the following:

{
   "code":"E_UNAUTHORIZED"
   "message":"Authentication is wrong"
}
  • 401 with code:
    • E_UNAUTHORIZED: Authentication is wrong or has expired. Please login again and open a ticket on the support website if the problem persists.
  • 403 with code:
    • E_POSITION_REPORT_NOT_FOUND: The holders list has not been imported. Please refer to this page to fix it.
    • E_UNAUTHORIZED: The token has not been fully configured yet. Please refer to this page to fix it.
    • E_HOLDER_NOT_WHITELISTED: The whitelisting process is not yet finished, some holders are still pending whitelisting. Please refer to this page to get the whitelisting status of your T-REX.
    • E_IDENTITIES_NOT_DEPLOYED: The whitelisting process is not yet finished, some holders are still pending the deployment of their ONCHAINID. Please refer to this page to get the whitelisting status of your T-REX.
    • E_TOKEN_IS_NOT_DEPLOYED: The token is not yet deployed. Please refer to this page to get the whitelisting status of your T-REX or to to this page to configure and trigger the deployment of your T-REX.
  • 404 with code:
    • E_TOKEN_NOT_FOUND: The token can't be found. Please check the token_id parameter in the URL.
  • 500 with code:
    • E_INTERNAL_ERROR: An internal server error happened. Please retrieve the correlation_id from the response header and open a ticket on the support website.