- You have a Mesh dashboard account with a sandbox API key (see Prepare to build)
- You know which use case(s) you’re building for
Overview
A Link token, as the name implies, is an access key for a session of Link, Mesh’s SDK. You’ll request it with an API call to Mesh, and the parameters you include will configure the user session. This is how you’ll start every user session. This guide will walk you through how to request a Link token, including code snippets for specific use cases.How to request a Link token
General information
Endpoint: Get Link token with parameters (/api/v1/linktoken) You will start every user session with this request. Its parameters configure the user’s experience within Link.- Tokens are short-lived (must be used within 10mins).
- Tokens are one-time use.
Use-case-specific example requests
Parameter reference
Parameter reference
X-Client-Id requiredX-Client-Secret requireduserId requiredrestrictMultipleAccounts optionalDefaults to true, which is standard used for any transfer flow.
On some non-transfer flows (ie. “read” use cases), a user could connect multiple accounts in a row if this value were false. Sometimes valuable for withdrawal use cases to let the user create an external “address book”.
integrationId optionalA unique Mesh identifier representing a specific integration.
Use the Get integrations endpoint (/api/v1/transfers/managed/integrations) to pull a list of integrations and the corresponding Mesh integrationId. These values won’t change, so you do not have to hit this endpoint before each Link Token request.
To be used if the user selects the integration in your UX before launching Mesh (most commonly in an onramp flow).
transferOptions.transactionId optionaltransferOptions.transferType optionaldeposit.transferOptions.isInclusiveFeeEnabled optionalSpecifies if fees should be included in the amount to transfer.
false is standard for deposit and payment, meaning any applicable fees are on top of the deposit/payment amount. true is standard for onramp, meaning the amount the user receives is the amount specified minus applicable fees.
transferOptions.generatePayLink optionalWhen true, this request will return a url in addition to the Link token that can be used to launch Mesh Link in a separate web page.
This should only be used if you’re launching Mesh in a separate webpage (see more about “PayLinks” in the Launch the Mesh SDK guide).
transferOptions.amountInFiat optionalThe fiat-equivalent amount of the symbol to be purchased.
To be used if the user enters an amount in your UX before launching Mesh (most commonly in an onramp flow).
transferOptions.toAddresses.networkId optional required for transfersMesh’s unique identifier for the network to be used for this toAddress.
Use the Get networks endpoint (/api/v1/transfers/managed/networks) to pull a list of all supported networks and the corresponding Mesh networkId. These values won’t change, so you do not have to hit this endpoint before each Link Token request.
transferOptions.toAddresses.symbol optional required for transferstoAddress.transferOptions.toAddresses.address optional required for transferssymbol can be sent on the specified networkId.transferOptions.toAddresses.amount optional required for paymentsExact amount of the asset that should be transferred.
This parameter is optional for deposit and onramp, but required when transferType: payment. Not to be used in combination with the amountInFiat field.
transferOptions.toAddresses.displayAmountInFiat optionalA fiat-equivalent amount that will be shown to the user in the Mesh UI.
This ensures a consistent experience from your checkout experience to Mesh. It will only be used if it is within 1% of the amountInFiat Mesh determines based on its pricing data. This is generally used for non-stablecoin payments, as Mesh maps stablecoins to a 1:1 price with USD for display purposes.
verifyWalletOptions.verificationMethods optional required for verificationsMethod by which the user must verify their self-hosted wallet.
Enum to support future verification methods, but only one option for now.
verifyWalletOptions.message optionalThe message the user should sign in their wallet.
The exact language isn’t important. Mesh has standard language if this isn’t provided.
verifyWalletOptions.networkId optionalA unique Mesh identifier for the network on which the user must verify their self-hosted address.
Use the Get networks endpoint (/api/v1/transfers/managed/networks) to pull a list of all supported networks and the corresponding Mesh networkId. These values won’t change, so you do not have to hit this endpoint before each Link Token request.
To be used if you need your user to verify an address on a specific network. Should not be used in combination with networkType.
verifyWalletOptions.networkType optionalThe network type on which the user must verify their self-hosted address.
To be used if you need your user to verify an address on a particular network type (eg. EVM). Should not be used in combination with networkId.
verifyWalletOptions.address optionalA list of address from which the user can verify ownership. User is not allowed to verify an address outside this list.
Used if you need your user to verify ownership of a specific address. If not provided, user can verify ownership of any self-hosted address they connect.
Use case: Deposits
Use case: Deposits
-
The
toAddressesare the possible destinations at which user deposits can be received. This object is an array. The example request shows 3 possible destination addresses (USDC.sol, USDC.eth, USDC.base), but you should provide all possible destination addresses to maximize the chances that Mesh can make a transaction happen.Want more help? Use our toAddress generator. This tool helps you quickly construct your toAddress array. -
There is an additional parameter for
addressTagwithin thetoAddressobject. Be sure to include that for assets like XRP or XLM if necessary for proper attribution to your user accounts. -
There are additional parameters for
minAmount&minAmountInFiatwithin thetoAddressobject. Be sure to include this if you have deposit minimums.
Use case: Payments
Use case: Payments
-
The
toAddressesare the possible destinations at which user payments can be received. This object is an array. The example request shows 4 possible destination addresses (USDC.sol, USDC.eth, USDC.base, BTC.btc), but you should provide all possible destination addresses to maximize the chances that Mesh can make a transaction happen.Want more help? Use our toAddress generator. This tool helps you quickly construct your toAddress array. -
The
amountparameter is the amount of thesymbolspecified in this object that must be transferred (ie. the total payment amount, in crypto). Do not use theamountInFiatparameter, as Mesh cannot guarantee exchange rates. -
There is an additional parameter for
addressTagwithin thetoAddressobject. Be sure to include that for assets like XRP or XLM if necessary for proper attribution on your end.
Use case: Onramps
Use case: Onramps
-
There is an additional parameter for
addressTagwithin thetoAddressobject. Be sure to include that for assets like XRP or XLM if necessary for proper attribution to your user accounts.Want more help? If you’re passing an array of multiple possible destinations for your user’s purchase, use our toAddress generator. This tool helps you quickly construct your toAddress array. -
There are additional parameters for
minAmount&minAmountInFiatwithin thetoAddressobject. Be sure to include this if you have deposit minimums. - Read more about this in Add Mesh onramp integrations to your “Buy” lineup.
Use case: Withdrawals
Use case: Withdrawals
- This user flow will end immediately after they connect their account.
- At that point, you will receive an accessToken for the user’s account, which you can use to hit Mesh’s Get deposit addresses endpoint (/api/v1/transfers/managed/address/list).
- Read more about this in the Add Mesh to your withdrawal flow guide.
Use case: Verify (self-hosted wallets)
Use case: Verify (self-hosted wallets)
- Wallet verification is fully compatible with the deposit & payment use cases. If you require users to verify that they own a self-custody wallet before initiating a deposit or payment from that wallet, you can add these configurations into the same Link Token request.
- Read more about this in Verify self-hosted wallets.
What’s next
Next up: Launch the Mesh SDK — use the Link Token you just requested to initialize and launch a user-facing SDK session.AI coding reference (llms.txt)
AI coding reference (llms.txt)
POST /api/v1/linktokenRequired params: userId (unique, persistent, non-PII, ≤300 chars) — the only universally required body param.Conditionally required: transferOptions.toAddresses[].networkId, .symbol, .address — required for any transfer flow | transferOptions.toAddresses[].amount — required for payment flows (not for deposit/onramp) | verifyWalletOptions.verificationMethods — required when using wallet verificationKey optional params: transferOptions.transferType (deposit/payment/onramp — defaults to deposit) | integrationId (deep-link to specific provider) | accessTokens (MMT return-user array) | restrictMultipleAccounts (default true) | generatePayLink (true returns paymentLink URL) | transferOptions.isInclusiveFeeEnabled (false for deposit/payment; true for onramp) | transferOptions.amountInFiat | transferOptions.toAddresses[].addressTag (for XRP, XLM) | transferOptions.toAddresses[].minAmount / minAmountInFiatverifyWalletOptions (wallet ownership): verificationMethods: ["signedMessage"] | message | networkId or networkType (not both) | addresses[]Get networkIds: Use GET /api/v1/transfers/managed/networks to fetch the full list of supported networks and their networkId values. These values don’t change — safe to cache permanently, no need to call this endpoint before every Link Token request.Key networkIds: Solana 0291810a-5947-424d-9a59-e88bb33e999d | Ethereum e3c7fdd8-b1fc-4e51-85ae-bb276e075611 | Base aa883b03-120d-477c-a588-37c2afd3ca71 | Bitcoin 03dee5da-7398-428f-9ec2-ab41bcb271daTool: toAddress generator — quickly construct your toAddresses array.Deposit use case — canonical request body:"amount": 99.99 to each toAddress entry and set "transferType": "payment".Onramp use case — add "integrationId": "...", "amountInFiat": 100.00, "isInclusiveFeeEnabled": true and set "transferType": "onramp".Verify use case — replace transferOptions with "verifyWalletOptions": { "verificationMethods": ["signedMessage"], "message": "...", "networkId": "..." }.