Handle the issuer details

Create the information related to the issuer of your project

Your Project needs to be linked to an Issuer. In this category, you will be able to specify the information of the issuer.

Authentication

cURL request

To be able to perform actions on our API, you need to be authenticated. To do this, use the following endpoint.

curl -XPOST 'https://primary-market-api-develop.tokeny.com/auth/local' \
--header 'Content-Type: application/json' \
--data-raw '{
    "identifier":"[email protected]",
    "password": "my-password"
}'

Sample response

{
    "jwt": "<jwt>",
    "user": {
        "id": 1,
        "username": "Username",
        "email": "[email protected]",
        "provider": "local",
        "confirmed": true,
        "blocked": false,
        "role": {
            "id": 34,
            "name": "Projects creators",
            "description": "Authors of projects, authenticated with the permission to manage projects, categories, issuers and disclaimers.",
            "type": "projects_manager"
        },
        "created_at": "2021-03-17T16:14:14.286Z",
        "updated_at": "2021-03-17T16:16:00.097Z"
    }
}

jwt is the jwt token that you will need to perform the next operations

Troubleshooting

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": [
        {
            "messages": [
                {
                    "id": "Auth.form.error.invalid",
                    "message": "Identifier or password invalid."
                }
            ]
        }
    ],
    "data": [
        {
            "messages": [
                {
                    "id": "Auth.form.error.invalid",
                    "message": "Identifier or password invalid."
                }
            ]
        }
    ]
}

The status code can be either:

  • 400: one of the specified credential is wrong, please check them again. In case you lost your password, please contact [email protected]
  • 401: you are not allowed to connect to the API. If you think it is a mistake, please contact your administrator or [email protected]

Retrieve the existing issuers

cURL

If issuers were previously created in our system, you can retrieve them easily with the following request.

curl -XGET 'https://primary-market-api-develop.tokeny.com/issuers' \
--header 'Authorization: Bearer <jwt>'

jwt is the authentication token you received on the Authentication step.

Sample response

TODO

Troubleshooting

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "Forbidden"
}

statusCode can be:

  • 401: your authentication token is invalid or has expired. Please go back to the Authentication step and retry
  • 403: you are not authorized to access this resource. If you think this is an error, contact your administrator or [email protected]

Create a new issuer

cURL

If no existing issuers match your needs, you can create a new one using the following request.

curl -XPOST 'https://primary-market-api-develop.tokeny.com/issuers' \
--header 'Authorization: Bearer <jwt>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "<issuer_name>",
  "address": "<issuer_address>",
  "country_of_residence": "<issuer_residence>",
  "country_of_incorporation": "<issuer_incorporation>",
  "registration_number": "<registration_number>",
  "onchainid": "<issuer_onchainid>"
}'

jwt is the authorization token retrieved from the Authenticate step.
issuer_name: the name you want to give to your issuer. Should be the commercial name of the company.
issuer_address: the address of the HQ of the issuer.
issuer_residence: the country of the HQ of the issuer.
issuer_incorporation: the country of incorporation of the issuer.
registration_number: the registration number of the issuer.
issuer_onchainid: the ONCHAINID of the issuer.

Sample response

{
    "id": 1,
    "published_at": "2021-03-18T09:37:59.624Z",
    "created_at": "2021-03-18T09:37:59.632Z",
    "updated_at": "2021-03-18T09:37:59.632Z",
    "name": "The company",
    "address": "1 main street",
    "country_of_residence": "Luxembourg",
    "country_of_incorporation": "Luxembourg",
    "registration_number": "1234567890",
    "onchainid": "0xDbF8cb0D8b1164661f1e02D63c03A47705E0F4d5"
}

Troubleshooting

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "ValidationError",
    "data": {
        "errors": {
            "name": [
                "name must be defined."
            ]
        }
    }
}

statusCode can be:

  • 400: you forgot to specify a mandatory field or the field doesn't match the validation rules
  • 401: your authentication token is invalid. Go back to the Authentication step and retry.
  • 403: you are not allowed to create categories. If you think this is an error, contact your administrator or [email protected]

Update an issuer

cURL

If you need to change any data from the issuer, use the following request.

curl -XPOST 'https://primary-market-api-develop.tokeny.com/issuers/<issuer_id>' \
--header 'Authorization: Bearer <jwt>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "<issuer_name>",
  "address": "<issuer_address>",
  "country_of_residence": "<issuer_residence>",
  "country_of_incorporation": "<issuer_incorporation>",
  "registration_number": "<registration_number>",
  "onchainid": "<issuer_onchainid>"
}'

jwt is the authorization token retrieved from the Authenticate step.
issuer_id: the identifier of the issuer, retrieved from "Retrieve the existing issuer" or "Create a new issuer".
issuer_name: the name you want to give to your issuer. Should be the commercial name of the company.
issuer_address: the address of the HQ of the issuer.
issuer_residence: the country of the HQ of the issuer.
issuer_incorporation: the country of incorporation of the issuer.
registration_number: the registration number of the issuer.
issuer_onchainid: the ONCHAINID of the issuer.

Sample response

{
    "id": 1,
    "published_at": "2021-03-18T09:37:59.624Z",
    "created_at": "2021-03-18T09:37:59.632Z",
    "updated_at": "2021-03-18T09:48:17.914Z",
    "name": "The new name of 'The company'",
    "address": "1 main street",
    "country_of_residence": "Luxembourg",
    "country_of_incorporation": "Luxembourg",
    "registration_number": "1234567890",
    "onchainid": "0xDbF8cb0D8b1164661f1e02D63c03A47705E0F4d5"
}

Troubleshooting

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "Forbidden"
}

statusCode can be:

  • 400: you forgot to specify a mandatory field or the field doesn't match the validation rules
  • 401: your authentication token is invalid. Go back to the Authentication step and retry.
  • 403: you are not allowed to create categories. If you think this is an error, contact your administrator or [email protected]

Whatโ€™s Next

Once the issuer is set up, you can go on and set up your disclaimers, or directly create your project.