Managing the token Price of a close-ended subscription

📘

Prerequisites:

To complete this use case, you will need to authenticate your request(s). You can generate your token by following these steps:

  • Make sure to leverage an exisintg account, e.g. Agent, Owner...
  • Sign into your Servicing portal to disable your 2FA.
  • Navigate to the "Getting API access" page to generate the required JWT, thanks to your credentials.
  • Add the JWT to the header of your request.

The Price is what an investor will pay for each token, to buy tokens on the primary market, i.e. directly from the issuer.

  • In Open-ended subscriptions, the Price is defined when the NAV is updated. All orders without a Price, receive a Price when the NAV is set. Updating the price of an open-ended subscription requires adjusting the NAV. For detailed guidance, please refer to this article.
  • In Close-ended subscriptions, the Price is defined in the Interval, a period of time for which a specific Price is set. Most of the time, one Interval is enough for a subscription. However, when a variation in the subscription Price is needed, it is possible to have multiple Intervals that follow each other, therefore reflecting this Price variation.

Updating the Price of a close-ended subscription can only be done via API. Here's how to proceed:

1. Getting the token_id

cURL request

curl -XGET 'https://api-testing.tokeny.com/servicing/api/tokens' \
  -H 'authorization: Bearer <jwt>'

Response

[  
    {  
        "id": "3a360372-cd32-4e64-8FG39-d323d716143O",  
        "address": "string",  
        "decimals": 0,  
        "image": "https\://…",  
        "isPaused": true,  
        "tradable": true,  
        "name": "string",  
        "symbol": "string",  
        "type": "string",  
        "protocol": "T-REX",  
        "blockchainNetwork": "string",  
        "identityRegistryStorage": "0x…",  
        "permissions": [  
            "string"  
        ],  
        "agentWallet": "0x…"  
    }  
]

This answer will list all your tokens for this account, with basic data for each of them, including the “id” field. This “id” is the {{token_id}} you will leverage in the next sections.

2. Getting the Subscription and Interval ID's

Each token, that is available on the primary market, has its own Subscription and Interval. To update the Interval Price, we will need their IDs and the Interval data. To get this information, let's call the following endpoint:

cURL request

curl -XGET 'https://api-testing.tokeny.com/servicing/api/subscriptions/tokens/:token_id' \
  -H 'authorization: Bearer <jwt>'

Response

{
    "items": [
        {
            "id": "c2b128d21-2bab-4666-ab42-65a48aabfe8c", /subscription_id
            "alias": "subscriptionName",
            "calendarId": null,
            "baseCurrency": "EUR",
            "distributor": false,
            "paymentBeforeMinting": true,
            "supportedCurrencies": [
                "USD",
                "EUR",
                "BTC",
                "ETH",
                "USDC",
                "USDT"
            ],
            "supportingDocumentsRequired": false,
            "templates": {
                "en": {
                    "payment_recap": 41212813,
                    "payment_confirmation": 41331815,
                    "transaction_cancelled_by_issuer": 56134122,
                    "transaction_cancelled_by_investor": 41310927
                },
                "sender": {
                    "address": "[email protected]",
                    "name": "xyz"
                }
            },
            "tokenId": "string",
            "createdAt": "2000-01-01T12:00:00.000Z",
            "updatedAt": "2000-01-01T12:00:00.000Z",
            "paymentInputTokenQuantity": true,
            "paymentInputAmountToPay": false,
            "paymentInputNetInvestment": true,
            "paymentMethods": {
                "USD": {
                    "type": "FIAT",
                    "strategy": {
                        "bankTransfer": {
                            "BIC": "string",
                            "RTN/ABA": "string",
                            "bankName": "string",
                            "accountOwner": "string"
                        }
                    },
                    "decimals": 2
                },
                "EUR": {
                    "type": "FIAT",
                    "strategy": {
                        "bankTransfer": {
                            "BIC": "string",
                            "IBAN": "string",
                            "bankName": "string",
                            "accountOwner": "string"
                        }
                    },
                    "decimals": 2
                },
                "BTC": {
                    "type": "Crypto",
                    "name": "",
                    "decimals": 8,
                    "strategy": {
                        "unique_pool": {
                            "reconciliate": true,
                            "scorechain_scanner": false
                        }
                    }
                },
                "ETH": {
                    "type": "Crypto",
                    "name": "ETH",
                    "decimals": 18,
                    "strategy": {
                        "unique_address_for_all_investors": {
                            "network": "SEPOLIA",
                            "reconciliate": true,
                            "paymentAddress": "string"
                        }
                    }
                },
                "USDT": {
                    "type": "Crypto",
                    "name": "USDT",
                    "decimals": 6,
                    "strategy": {
                        "unique_address_for_all_investors": {
                            "network": "amoy",
                            "reconciliate": true,
                            "tokenAddress": "string",
                            "paymentAddress": "string"
                        }
                    }
                },
                "USDC": {
                    "type": "Crypto",
                    "name": "USDC",
                    "decimals": 18,
                    "strategy": {
                        "unique_address_for_all_investors": {
                            "network": "amoy",
                            "reconciliate": true,
                            "tokenAddress": "string",
                            "paymentAddress": "string"
                        }
                    }
                }
            },
            "warningText": null,
            "infoText": null,
            "intervals": [
                {
                    "id": "ad63a5Fb28-57be-43422-8ac21-bR65929705", /interval_id
                    "alias": "intervalName",
                    "startDate": "2000-01-01T12:00:00.000Z",
                    "endDate": null,
                    "caps": {
                        "minOrder": "string",
                        "maxOrder": "string",
                        "max": "string"
                    },
                    "totalInvestedAmount": "string",
                    "tokenPrice": "string",
                    "fees": {
                        "type": "string",
                        "value": "string"
                    },
                    "subscriptionId": "c2b128d21-2bab-4666-ab42-65a48aabfe8c",
                    "type": "string",
                    "autoMinting": false,
                    "autoPriceSetAfterValuation": false
                }
            ]
        }
  
    ],
    "totalItemsFound": 1
}

As you can see in the response, the API is sending us the Subscription ID and the Interval ID.

We will also need the rest of the Interval data that we find in the "Intervals" array. Make sure to find the Interval for which you want to update the Price.

3. Updating the subscription Interval Price

To update the subscription Interval Price for the open-ended ordering process, use the following PUT endpoint. This endpoint requires all the previously obtained information, including the token_id, subscription_id, and Interval configuration data.

⚠️

Only update the "tokenPrice" field, all other fields should be sent unchanged. Be aware that changing other fields, will update your Interval configuration, implying substantial impact on your subscription.

cURL request

curl -XPUT 'https://api-testing.tokeny.com/servicing/api/subscriptions/:subscription_id/tokens/:token_id/interval/:interval_id' \
  -H 'authorization: Bearer <jwt>'
  -H 'content-type: application/json' \
  --data-binary '{
{
  "alias": "intervalName",
  "endDate": null,
  "fees": {
    "type": "FLAT",
    "value": "string"
  },
  "startDate": "2000-01-01T12:00:00.000Z",
  "tokenPrice": "string",
  "type": "CLOSE_ENDED",
  "autoMinting": false,
  "autoPriceSetAfterValuation": false
}
}'

Please keep in mind, we are dealing with type “CLOSE_ENDED”, in an open-ended scenario “null” would be expected in "tokenPrice".

Response

{
  {
    "id": "string",
    "alias": "intervalName",
    "startDate": "string",
    "endDate": null,
    "caps": {
        "minOrder": "string",
        "maxOrder": "string",
        "max": "string"
    },
    "totalInvestedAmount": "string",
    "tokenPrice": "string",
    "fees": {
        "type": "PERCENTAGE_INVESTMENT_AMOUNT",
        "value": "string"
    },
    "subscriptionId": "string",
    "type": "CLOSE_ENDED",
    "autoMinting": false,
    "autoPriceSetAfterValuation": false
	}
}