createCoinbaseExchangeTransfer
Creates a transfer from a Coinbase exchange account to an external wallet address. This lets users withdraw cryptocurrency from their Coinbase holdings to a wallet they control.
Before calling this function, use getCoinbaseAccounts to get the accountId and check the available balance.
Coinbase transfers can involve two extra steps beyond a normal API call, covered in detail below:
- Two-step verification (2FA): a one-time code Coinbase sends to the account holder.
- Travel Rule information: some recipient details Coinbase is legally required to collect for certain transfers.
Usage
Parameters
Returns
Promise<ExchangeTransferResponse> - A promise that resolves to the transfer details:
Two-step verification (2FA)
Coinbase requires its own two-step verification for most transfers, separate from any authentication Dynamic handles. The first createCoinbaseExchangeTransfer call for a given transfer makes Coinbase automatically send the account holder a short-lived code (SMS, or a push to an authenticator app like Authy). The call throws CoinbaseTransferMfaRequiredError; retry the same transfer with mfaCode set to that code.
The “Travel Rule” is a law that requires exchanges like Coinbase to know who is sending money to whom for larger or cross-border transfers, not just wallet addresses but basic recipient identity. Whether it applies, and which fields it needs, depends on the sender’s and recipient’s countries and the transfer amount, so it can’t be predicted ahead of time. If Coinbase needs this information and it’s missing, the call throws CoinbaseTravelRuleRequiredError listing exactly which fields are required, each with a description you can show the user.
Coinbase checks 2FA before Travel Rule on every request. If a transfer needs both and travelRuleData is missing on the attempt that finally includes a correct mfaCode, that attempt fails on the Travel Rule check instead of succeeding, and the mfaCode you just used is now spent, forcing the user through 2FA a second time. Send travelRuleData upfront whenever you already have it (e.g. a saved recipient), rather than waiting to be asked, so a transfer needing both only ever costs one 2FA prompt.
Errors
Examples
Transfer USDC on a specific network
When transferring tokens that exist on multiple networks, specify the target network:
Idempotent transfers
Use an idempotency key to safely retry failed requests without creating duplicate transfers:
Complete transfer flow (2FA + Travel Rule)
Prerequisites
- User must have connected their Coinbase account through Dynamic
- The Coinbase account must have sufficient balance for the transfer
Notes
- Transfers are processed by Coinbase and may take time to complete depending on network conditions
- The
status field indicates the current state of the transfer
- Use idempotency keys (
id parameter) in production to prevent duplicate transfers from network retries
- For tokens on multiple networks (like USDC), always specify the
networkObject to ensure the transfer goes to the correct chain
- Always send
travelRuleData upfront when you already have the recipient’s information. It’s optional, but supplying it late costs users an extra two-step verification prompt