You can also create a Charge via the API for your subscription, where you can pass additional metadata for individual subscriptions using additionalJSON.
When creating a Subscription Pay Link via API the following request body is require
{
"template": "SUBSCRIPTION",
"name": "Your paylink name here",
"price": "1000000", /* price is int64 represented by the base units of each currency, e.g. "price": "1000000" = 1 USDC */
"pricingCurrency": "6340313846e4f91b8abc519b", /* currency ID to price it in - can be a fiat currency */
"features": {
"isSubscription": true
},
"recipients": [
{
"walletId": "YOUR_WALLET_ID",
"currencyId": "6340313846e4f91b8abc519b"
}
],
"subscriptionDetails": {
"renewalReminders": 3, /* number of daily renewal reminders before subscription cancellation */
"gracePeriod": 2, /* grace period (in days) after subscription expiry */
"annualDiscountBps": 0, /* discount in basis points if the subscription is annual */
"interval": "MONTH" /* set the subscription interval: MONTH or YEAR */
}
}
- Configure multiple recipients and currencies if needed. The recipient currency can differ from the pricing currency. You can retrieve the
currencyId
from this endpoint, and see here for how to retrieve yourwalletId
.- For instance, you could price the link in EUR (e.g., €5) while accepting USDC or USDT as recipient currencies.
Example Query
curl --location 'https://api.hel.io/v1/paylink/create/api-key?apiKey=YOUR_PUBLIC_API_KEY>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_API_KEY' \
--data '{
"template": "SUBSCRIPTION",
"name": "Your paylink name here",
"price": "1000000",
"pricingCurrency": "6340313846e4f91b8abc519b",
"features": {
"isSubscription": true
},
"recipients": [
{
"walletId": "YOUR_WALLET_ID",
"currencyId": "6340313846e4f91b8abc519b"
}
],
"subscriptionDetails": {
"renewalReminders": 3,
"gracePeriod": 2,
"annualDiscountBps": 0,
"interval": "MONTH"
}
}'
From the following example replace: YOUR_PUBLIC_API_KEY, YOUR_SECRET_API_KEY, YOUR_WALLET_ID (and the pricing/recipient currency IDs) with the values you collected in the previous step.
Example Response Body
{
"id": "67aca16c445e22c559fc347d",
"platform": "HELIO",
"template": "OTHER",
"disabled": false,
"inactive": false,
"notifySenderByEmail": false,
"notifyReceiverByEmail": false,
"addDiscordRole": false,
"helioPlayProperties": null,
"features": {
"canChangeQuantity": false,
"canChangePrice": false,
"requireQuantityLimits": false,
"requireCountry": false,
"requireEmail": true,
"requireDeliveryAddress": false,
"requireDiscordUsername": false,
"requireDiscordLogin": false,
"requireFullName": false,
"requirePhoneNumber": false,
"requireTwitterUsername": false,
"requireTelegramUsername": false,
"requireProductDetails": false,
"requireMaxTransactions": false,
"requireNftGate": false,
"requireDiscordAuth": false,
"requireAccessCode": false,
"requireXFollow": false,
"requireRaffle": false,
"splitRevenue": false,
"splitEqually": false,
"canSwapTokens": false,
"isHelioPlay": false,
"isTransparentWallet": false,
"nftDropEnabled": false,
"showDiscountCode": false,
"isEscrowed": false,
"requireAllowlist": false,
"requireTradingViewUsername": false,
"allowAffiliate": false,
"requireAirdrop": false,
"isEventEnabled": false,
"enableCountdown": false,
"requireCaptchaValidation": false,
"shouldRedirectOnSuccess": false,
"customThemeEnabled": false,
"isSubscription": true
},
"name": "Your paylink name here",
"discordAuthDetails": [],
"dynamic": false,
"affiliateDetails": null,
"price": "1000000",
"normalizedPrice": "1000000",
"subscriptionDetails": {
"renewalReminders": 3,
"gracePeriod": 2,
"annualDiscountBps": 0,
"interval": "MONTH"
},
"content": {},
"creator": {
"id": "667c1f9352919e407156128a",
"userType": "MERCHANT",
"email": "[email protected]",
"name": "",
"isDisabled": false,
"kycVerified": false,
"platformDetails": {
"platform": "HELIO"
}
},
"company": {
"id": "667c1f9352919e407156128c",
"name": "Helio",
"email": "[email protected]",
"websiteUrl": "",
"discordUsername": "",
"address": "",
"phoneNumber": "",
"escrowFunds": false,
"tradingViewDetails": "66ab698681063452ebd41ba0",
"twitterConfirmed": false,
"kycVerified": false,
"kybVerified": false
},
"currency": {
"id": "6340313846e4f91b8abc519b",
"name": "USD Coin",
"decimals": 6,
"order": 1,
"mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"coinMarketCapId": 3408,
"symbol": "USDC",
"symbolPrefix": "$",
"type": "DIGITAL",
"iconUrl": "USDC.svg",
"features": [
"PAYMENT_PRICING",
"PAYMENT_RECIPIENT",
"SWAP"
],
"blockchain": {
"id": "6340313846e4f91b8abc515c",
"name": "SOL",
"symbol": "SOL",
"engine": {
"id": "63b6b1200cfb4b3f6131f2b4",
"type": "SOL"
}
}
},
"wallet": {
"id": "667c1f9352919e4071561294",
"name": "",
"publicKey": "7YancRyNQyp9s6G7YNwx9H93UqswoKWqF9GuNJPufyvW",
"btcProperties": null
},
"recipients": [
{
"currency": {
"id": "6340313846e4f91b8abc519b",
"name": "USD Coin",
"decimals": 6,
"order": 1,
"mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"coinMarketCapId": 3408,
"symbol": "USDC",
"symbolPrefix": "$",
"type": "DIGITAL",
"iconUrl": "USDC.svg",
"features": [
"PAYMENT_PRICING",
"PAYMENT_RECIPIENT",
"SWAP"
],
"blockchain": {
"id": "6340313846e4f91b8abc515c",
"name": "SOL",
"symbol": "SOL",
"engine": {
"id": "63b6b1200cfb4b3f6131f2b4",
"type": "SOL"
}
}
},
"wallet": {
"id": "667c1f9352919e4071561294",
"name": "",
"publicKey": "7YancRyNQyp9s6G7YNwx9H93UqswoKWqF9GuNJPufyvW",
"btcProperties": null,
"blockchainEngine": {
"id": "63b6b1200cfb4b3f6131f2b4",
"type": "SOL"
}
}
}
],
"volume": 0,
"sales": "0",
"product": null,
"additionalImages": [],
"additionalImageUrls": [],
"discountCodes": [],
"discordRoleIds": [],
"pricingCurrency": {
"id": "6340313846e4f91b8abc519b",
"name": "USD Coin",
"decimals": 6,
"order": 1,
"mintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"coinMarketCapId": 3408,
"symbol": "USDC",
"symbolPrefix": "$",
"type": "DIGITAL",
"iconUrl": "USDC.svg",
"features": [
"PAYMENT_PRICING",
"PAYMENT_RECIPIENT",
"SWAP"
],
"blockchain": {
"id": "6340313846e4f91b8abc515c",
"name": "SOL",
"symbol": "SOL",
"engine": {
"id": "63b6b1200cfb4b3f6131f2b4",
"type": "SOL"
}
}
}
}