- Your core Mesh integration is working end-to-end (see Prepare for go-live)
- Youâre on the
Web SDK
3.14.1or later.- Please contact your Mesh representative if you need Mesh-hosted withdrawals in the Mesh
iOS,
Android,
React Native, or
Flutter SDKs.
- Please contact your Mesh representative if you need Mesh-hosted withdrawals in the Mesh
- You have a withdrawal or payout flow in your app, and a custodian or wallet that sends funds from your platform
- Youâve registered a webhook callback URI (see Transfer status webhooks)
Overview
Most withdrawal or payout flows require users to select an asset/network and then paste an address, just like they do in a deposit flow. And their primary concern is the same: losing funds because they make a mistake (ie. wrong network, wrong address, etc.). Mesh removes that risk, and lets users withdraw in the asset and network they want rather than only the ones you pay out in. There are two ways to integrate:- Mesh-hosted withdrawals: Mesh Link renders the full withdrawal flow and captures everything needed for the withdrawal. Mesh then delivers to you a payload with all the details, and you send the funds.
- Client-hosted withdrawals: You keep your own withdrawal UI and call Mesh APIs to retrieve addresses from connected accounts and, optionally, to bridge to additional destinations.
Choose your integration path
Option 1: Mesh-hosted withdrawals
Mesh-hosted withdrawals is a complete withdrawal UX inside Mesh Link. You tell Mesh what the user can withdraw; the user chooses a destination, asset, network, and amount; and Mesh delivers a payload with everything you need to send the funds. Mesh never holds funds: your platform sends the payout, just as it does today.Key benefits
- Automated address retrieval: The user connects the exchange account or self-custody wallet they want to withdraw to, and Mesh retrieves the correct address for the selected asset and network. No copy/paste, no wrong-network mistakes. Users can also enter an address manually.
- Bridging and swapping: Users can withdraw in the asset and network they want, not only the pairs you pay out in. When a destination needs a bridge or swap, Mesh gives you a single-use bridging address. You send your standard payout asset to it, and Mesh converts and delivers to the userâs destination automatically.
- Wallet verification (coming soon): Confirm that your user controls the self-custody wallet theyâre withdrawing to, without leaving the withdrawal flow.
- Clear expectations: Before the user confirms, Link shows the amount theyâll receive after any applicable fees (and slippage for bridged routes).
- A consistent round trip: The withdrawal experience looks and feels like the Mesh deposit flow your users already know, so the way out feels as familiar and trustworthy as the way in.
How it works
- Your backend requests a Link token with
transferType: "withdrawal"and the asset/network pairs you can pay out from. - You launch Mesh Link.
- The user selects a destination, asset, network, and amount, then reviews and confirms.
- Mesh fires the
withdrawalRequestedSDK event.
- You use the
onEvent()callback to manage the user journey in your app, such as triggering 2FA if applicable. - You receive the webhook event to your server with the money movement details of the requested withdrawal, including the address to send funds to.
- Your platform sends the funds. Mesh detects the transfer onchain, bridges or swaps if needed, and delivers to the userâs destination.
- Mesh sends a
Succeededwebhook once the funds arrive.
1. Request a Link token for a withdrawal
Call the Link Token endpoint with the same credentials you use today. Add atransferOptions object with transferType: "withdrawal" and fromPairs (the asset/network pairs your platform pays out from, with the maximum amount the user can withdraw from each).
Parameter reference
Parameter reference
X-Client-Id requiredX-Client-Secret requireduserId requiredtransferOptions.transactionId optionalTransactionId in webhooks so you can match events to your records.transferOptions.transferType requiredwithdrawal to launch the Mesh-hosted withdrawal flow.transferOptions.fromPairs.networkId requiredMeshâs identifier for a network you pay out from.
Use the Get networks endpoint (/api/v1/transfers/managed/networks) to pull the list of supported networks and their networkId. These values donât change, so you can cache them.
transferOptions.fromPairs.symbol requiredUSDC).transferOptions.fromPairs.maxAmount requiredThe maximum amount of symbol the user can withdraw from this pair, typically their withdrawable balance. Mesh enforces this limit in the userâs session.
This must be provided for every fromPairs entry.
Important note: Exclude amounts reserved for pending Mesh withdrawals.
Link Token request
Link Token request
fromPairsdescribes what you send, not what the user receives. Mesh uses it to determine every destination asset/network the user can choose, including bridged and swapped routes.- We recommend passing a new
transactionId(up to 128 characters) for every withdrawal. Itâs the easiest way to match webhooks to the withdrawal in your system. - Set
maxAmountto the userâs withdrawable balance. The user canât request more than this amount in the session.
2. Launch Mesh Link
Launch Link with the token the same way you do for deposits (see Launch the Mesh SDK for SDK setup across platforms). Link then guides the user through:- Destination: connect an exchange account or self-custody wallet, or enter an address manually.
- Asset and network: Link shows your
fromPairsand any supported bridging routes from thosefromPairsthat are supported by the userâs chosen destination. - Amount: The user can enter the amount theyâd like to withdraw, up to their
maxAmount. - Review and confirm: Link shows the amount the user will receive after any applicable fees (and slippage for bridged routes).
3. Handle the withdrawalRequested SDK event (use if you require 2FA)
When the user confirms the withdrawal, Mesh fires the withdrawalRequested event and closes. You should record the withdrawal, and use the onEvent() callback to manage the user journey in your app (only after Link has closed): trigger 2FA or any other step your withdrawal flow requires, and show the user the right screen next (eg. a confirmation or a pending state).
This event only tells you that the user requested a withdrawal. Its payload is transferId (Meshâs identifier for the withdrawal) and status (pending or success; in practice pending, because you havenât sent the funds yet). The money movement details (what to send, how much, and where) arrive separately, by webhook to your server (step 4).
Web SDK example
Web SDK example
- If the user fails or abandons 2FA, donât send funds. The withdrawal ends as
FailedonceExpiresAtpasses, and no funds move. - If you donât require 2FA, use this event to update your UI, then act on the webhook in step 4.
4. Receive the withdrawal details by webhook
When the user completes the flow, Mesh sends aPending transfer webhook to your registered callback URI with the money movement details of the requested withdrawal. This webhook, not the SDK event, is your source of truth for initiating the transfer. Verify the signature and respond exactly as described in Transfer status webhooks.
Parameter reference
Parameter reference
TransferTypeWithdrawal for Mesh-hosted withdrawals.TransactionIdtransactionId you passed in the Link token request, if any.TransferIdSendToken, SendChain, SendNetworkIdfromPairs.SendAmountSendToken you must send.SendToAddressIsBridged is true; otherwise the userâs destination address.SendToAddressTagnull otherwise.ExpiresAtIsBridgedtrue when Mesh bridges or swaps your funds to reach the userâs chosen asset/network.Token, ChainDestinationAddress, DestinationAddressTagDestinationProviderPhantom, Coinbase), or Manual for an entered address. Useful for display (eg. Your Phantom wallet (7xKXâŚgAsU)).ExpectedDestinationAmount, MinDestinationAmountPayload: withdrawal requested (Pending)
Payload: withdrawal requested (Pending)
TransactionId from the managed transfers endpoint (/api/v1/transfers/managed/mesh). It returns the same details as the webhook.
5. Send the funds
Use the webhook payload to initiate the transfer from your custodian or wallet: send exactlySendAmount of SendToken on SendChain to SendToAddress, including SendToAddressTag if present. Mesh detects the transfer onchain, and when IsBridged is true, bridges or swaps it and forwards it to the userâs DestinationAddress.
Send before ExpiresAt. The deadline starts when the user confirms the withdrawal in Link:
- Not bridged (same asset and network you pay out in): 2 hours.
- Bridged: up to 2 hours. It can be shorter, because the bridge providerâs deposit address can expire sooner. Always use the
ExpiresAtvalue in the payload; never assume 2 hours. - Mesh only sends the webhook while at least 1 minute remains. A retried webhook can arrive later, so compare
ExpiresAtwith your own clock before you send. - If your payout flow has extra steps (eg. 2FA or manual review), make sure they finish before
ExpiresAt.
Failed and you receive a Failed webhook. Ask the user to start a new withdrawal, which gives them a new quote and a new deadline.
6. Track delivery
Mesh monitors the transfer onchain and sends aSucceeded webhook once funds reach the userâs destination. For bridged withdrawals, TransferSteps lists each onchain leg with its TxHash, and DestinationAmount is what the user actually received.
Payload: withdrawal delivered (Succeeded)
Payload: withdrawal delivered (Succeeded)
Wallet verification (coming soon)
Wallet verification for Mesh-hosted withdrawals is coming soon. When a user withdraws to a self-custody wallet, youâll be able to confirm that your user is in control of that destination wallet before any funds move. The user proves ownership by signing a message in their wallet as part of the same withdrawal flow: no gas fees and no extra steps outside Link.- Protect your users: reduce the risk of sending funds to a wallet your user doesnât control.
- Support your compliance program: capture proof of wallet ownership for Travel Rule and audit requirements.
- No separate flow: verification happens inside the same Mesh-hosted session.
Test your implementation
What to test:- Full flow: Launch a production withdrawal session with a small
maxAmount, choose a destination you control, asset, network, and amount, and confirm. - 2FA hook: Confirm your
onEventhandler receiveswithdrawalRequestedand triggers your 2FA step. - Webhook capture: Confirm your server receives and verifies the
Pendingwebhook, and thatTransactionIdmatches your record (if you passed one). - Payout: Send
SendAmountofSendTokentoSendToAddressand confirm you receive theSucceededwebhook. - Abandon path: Close Link or fail 2FA before sending, and confirm no funds move and your app handles it gracefully.
Option 2: Client-hosted withdrawals
Keep your own withdrawal UI and use Mesh for automated address retrieval. After connecting an account, Mesh lets you pull addresses with clear asset/network mapping, eliminating human error and the risk of lost funds. Additionally, after a deposit, ârefund addressesâ are also available via Mesh SDK events and webhooks. Together, these can form the foundation of an âaddress bookâ where users save their preferred withdrawal destinations for future use.1. Register for, and consume Mesh Transfer Status webhooks
Why?: Mesh provides real-time updates to transfer statuses which can be used to power several things for your app. But one piece (providing theRefundAddress for user transfers from external accounts) can be the underpinning of creating a seamless roundtrip journey.
Instructions
Instructions
- See the Transfer status webhooks guide for more info.
- Callback URIs can be added in the Mesh dashboard in Account > API keys > Webhooks.
2. Save the RefundAddress and surface it as a withdrawal destination
Why?: Creating a seamless roundtrip journey for the user builds trust. Users often want to withdraw funds back to the same source from where they deposited. This process makes that easy. It feels personalized.
Instructions
Instructions
- The objects below are in Mesh transfer webhook events. Save this data, and surface it as a possible withdrawal destination in your UX (eg.
Your Binance account (0x31âŚcF98)).
- Important notes:
- Take proper care to ensure you associate it with the correct user.
- That
RefundAddressis specific to theChain&Token. Any transfer of that specific token on that chain to that address is safe, but sending any other token or on any other network to that address may result in lost funds.- See Concepts for more information about
refundAddress
- See Concepts for more information about
3. Add a Connect account option in the withdrawal flow
Why?: Usersâ number-one fear when transferring crypto is making a mistake â wrong network, wrong address. With Mesh Link, that becomes impossible because itâs all automated. Providing an automated address retrieval option adds a layer of trust and certainty to the withdrawal process.
Instructions
Instructions
- Call for a Link Token using the request structure below, and launch the Mesh Link SDK for the user.
Parameter reference
Parameter reference
X-Client-Id requiredX-Client-Secret requireduserId requiredrestrictMultipleAccounts optionalDefaults to false if omitted. Pass true for transfer-style Link (hides âLink another accountâ).
Set false if you want users to connect multiple accounts for an 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).
- The user will select an account, authenticate / provide access, and then their session will end.
- You will receive an SDK event called
integrationConnected. You should use theonIntegrationConnected()callback function to save thetokenId&brokerTypevalues, associated with thatuserId.- See the Supercharge return-users guide for more information about this step.
- Call the Mesh Get deposit addresses endpoint (/api/v1/transfers/managed/address/list), supplying the
authToken(accessToken.accountTokens[].tokenIdfromintegrationConnected) &type(accessToken.brokerType, e.g.coinbase,uphold,deFiWallet).- The response will return all addresses for each network on which the user can receive the specified crypto token. It will also have other helpful data to build you UX like a
networkNamefor displaying the network and alogoUrlfor that network. - Important note: Be sure to capture the
memofor deposits of relevant assets (eg. XRP) into any custodial platform.
- The response will return all addresses for each network on which the user can receive the specified crypto token. It will also have other helpful data to build you UX like a
Parameter reference
Parameter reference
X-Client-Id requiredX-Client-Secret requiredtype requiredThe type of integration from which your pulling the userâs deposit addresses.
This is deFiWallet for self-hosted wallets, or a name of an exchange account (eg. uphold).
authToken requiredThe tokenId returned to you in the integrationConnected event when the user connected this account.
This provides access to read data from the account.
symbol requirednetworks.networkId optionalMeshâs unique identifier for a specific network for which you would like to pull the userâs deposit address for symbol at the specified integration.
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.
This should not be used with caipId. Use one or the other. If both are left blank, this endpoint will return addresses for all eligible networks for the specified symbol.
networks.caipId optionalA standardized identifier for blockchain networks/assets (e.g. eip155:1 is Ethereum mainnet).
This should not be used with networkId. Use one or the other. If both are left blank, this endpoint will return addresses for all eligible networks for the specified symbol.
4. Expand withdrawal destinations with bridging
Why?: The account-connection flow above returns the addresses a user natively holds. With Mesh headless bridging, you can offer additional withdrawal destinations you donât natively settle in â Mesh bridges from an asset/network you do send from into the asset/network the user chooses, and returns an address for you to send to. Itâs a pure API (no Mesh UI), so you keep your own withdrawal experience.Instructions
Instructions
- Call Discover withdrawal routes (
POST /api/v1/bridging/routes/withdrawal) with the asset/network pairs your platform can pay out from (your settlement / omnibus legs). Mesh returns the bridged destinations it can reach from those sources. Mesh does not know which pairs the user already holds natively, so de-duplicate against the native addresses from the connection flow above before showing options. - When the user picks a native pair, send it as you do today â no extra Mesh call. When they pick a bridged pair, optionally call
POST /api/v1/bridging/quotewith the withdrawal amount to show the user an estimated receive amount, then call Create bridged address (POST /api/v1/bridging/address) with the selected route and the userâs destination address, and send your settlement funds to the returned bridging address before itsconstraints.expirationTime(6 hours). Mesh bridges them to the userâs chosen pair. - Each bridged transfer returns a Mesh
transferId. Mesh sends aSucceededorFailedwebhook for it (noPending), and you can pollGET /api/v1/transfers/managed/meshbyIdorClientTransactionIdat any point; the transfer is listed immediately aspending. - Important: Headless bridging is gated per-client, and its routes are configured on Meshâs side. Contact your Mesh representative to enable it and to set up the routes for your settlement pairs.
- See the full Headless bridging guide for request/response details, parameter tables, and status tracking.
Whatâs next
Explore the other Extend guides:- Add Mesh onramp integrations to your âBuyâ lineup â add exchange-based onramps to your âBuyâ flow.
- Verify self-hosted wallets â add wallet ownership verification for compliance or security.
AI coding reference (llms.txt)
AI coding reference (llms.txt)
RefundAddress from webhooks, and optional headless bridging.Option 1 â Endpoint: POST /api/v1/linktoken (same credentials as deposits). Web SDK 3.14.1+.Option 1 â Required params: userId | transferOptions.transferType: "withdrawal" | transferOptions.fromPairs[] with networkId, symbol, maxAmount (pairs the client pays out from; maxAmount = userâs withdrawable balance). Recommended optional: transferOptions.transactionId (clientâs own id for the withdrawal, up to 128 characters; echoed as TransactionId). If the user has no eligible balance (maxAmount would be 0), donât offer Withdraw; Mesh only shows a generic error. Minimum withdrawal: $0.10 direct, $0.50 bridged.Option 1 â Coming soon: wallet verification (signed-message proof that the user controls a self-custody destination wallet) inside the hosted withdrawal flow. Not yet available; no parameters to pass today.Option 1 â SDK event: withdrawalRequested via onEvent() fires when the user confirms, then Link closes. Payload: transferId, status (pending | success; pending in practice). Use it to manage the user journey (eg. trigger 2FA, show a pending screen). It carries no money movement details. Never send funds from SDK event data; the server-side webhook is the source of truth for what to send, how much, and where.Option 1 â Webhook (Pending): TransferType: "Withdrawal" | TransactionId | TransferId | SendToken | SendChain | SendNetworkId | SendAmount | SendToAddress (single-use bridging address if IsBridged, else userâs address) | SendToAddressTag | ExpiresAt | IsBridged | Token / Chain (what the user receives) | DestinationAddress | DestinationAddressTag | DestinationProvider | ExpectedDestinationAmount | MinDestinationAmount. Shape is provisional.Option 1 â Payout rules: send exactly SendAmount of SendToken on SendChain to SendToAddress (with SendToAddressTag if present) before ExpiresAt. ExpiresAt starts at user confirmation: 2 hours if not bridged, up to 2 hours if bridged (always read the payload value). Webhook is sent only while at least 1 minute remains; retries can arrive later, so check ExpiresAt against your clock before sending. If you canât send in time, donât send: the withdrawal ends Failed (Failed webhook) and the user starts a new one. Late sends arenât tracked or auto-returned: not bridged, funds reach the user but status is Failed; bridged, contact Mesh support. Wrong asset/network may lose funds. Never reuse a bridging address. Before every payout, validate SendAmount against the userâs remaining eligible balance in the clientâs own system (final safeguard; Mesh also enforces maxAmount and guards against duplicate requests).Option 1 â Testing: not available in sandbox. Test in production with small amounts (eg. 1 USDC) to an address you control, starting with a non-bridged route.Option 1 â Completion: Succeeded webhook with TxHash, DestinationAmount, and TransferSteps[] per onchain leg. Fallback read: GET /api/v1/transfers/managed/mesh by TransactionId.Option 2 â RefundAddress from transfer webhooks: Save RefundAddress + Chain + Token + SourceAccountProvider per userId. Surface as a withdrawal destination (e.g. âYour Binance account (0x31âŚcF98)â). RefundAddress is specific to that chain+token.Option 2 â Withdrawal Link Token: POST /api/v1/linktoken with userId, optional restrictMultipleAccounts (defaults false when omitted; true hides âLink another accountâ, leave false to let users build an âaddress bookâ across multiple accounts), optional integrationId. No transferOptions. Receive integrationConnected â save accessToken.accountTokens[].tokenId + accessToken.brokerType â call address list.Option 2 â Deposit address retrieval: POST /api/v1/transfers/managed/address/list. Params: type (broker type, e.g. uphold, or deFiWallet for self-custody) | authToken (= accessToken.accountTokens[].tokenId) | symbol | networks[].networkId or networks[].caipId (optional; omit for all networks). Response includes address per network, networkName, logoUrl, memo (important for XRP, XLM).Option 2 â Headless bridging: To offer withdrawal destinations you donât natively settle in, discover bridged destinations with POST /api/v1/bridging/routes/withdrawal (send your settlement pairs as sources; de-duplicate against the userâs native addresses, since Mesh does not know them), optionally quote the amount with POST /api/v1/bridging/quote, then when the user picks a bridged pair call POST /api/v1/bridging/address and send your settlement funds to the returned address before constraints.expirationTime (6h); track via the returned transferId (Succeeded/Failed webhooks, no Pending; list API shows it as pending immediately). Gated per-client. See the Headless bridging guide for full details.Get networkIds: GET /api/v1/transfers/managed/networks. Values donât change; safe to cache.