Prime API vs. Stableswapper: This page covers the Prime API withdrawal path, which moves tokens from Coinbase Prime custody to an onchain wallet. If your tokens are already onchain, use the Stableswapper to swap directly between USDC and your custom stablecoin.
Prerequisites
- A Coinbase Prime account with API credentials configured. See the Prime Quickstart for setup instructions.
- Your portfolio ID and wallet ID. See Wallets for how to retrieve these.
- The destination address must be added to your Prime address book. See Adding to the address book for setup instructions.
Creating a withdrawal
Use the Create Withdrawal endpoint to withdraw your custom stablecoin to an onchain wallet. ReplaceCBTUSD with your custom stablecoin symbol.
- Python
- TS/JS
Approval workflow
By default, all Prime withdrawals require consensus approval in the Prime UI before completion. The API response includes:- A Transaction ID for tracking the withdrawal
- An Activity ID specific to the consensus process in Prime
Tracking a withdrawal
Use the transaction ID returned by the Create Withdrawal endpoint to track its status via Get Transaction by ID. You can also use List Transactions with aWITHDRAWAL filter to list all withdrawal transactions.
For code examples on tracking transactions, see the Prime Withdrawals guide.
What to read next
Prime Conversions
Convert between USDC and your custom stablecoin via Prime API
Stableswapper Quickstart
Swap tokens directly onchain via the Stableswapper program