Onchain withdrawals are supported for all wallet types in Coinbase Prime. By default, all withdrawals require consensus approval in the Prime UI before completion. This ensures control over all withdrawal actions. For fully automated use cases, these approval requirements can be adjusted. All withdrawals are further governed by Prime’s address book.
Adding to the address book
By default, Coinbase Prime leverages an address book to prevent withdrawals to unknown or unauthorized destinations. New address entries can be submitted via Create Address Book Entry; however, each entry still requires consensus approval in the UI. If desired, the address book feature can be disabled in the UI for more streamlined workflows.
When submitting an address book entry, provide:
- A name for the address
- The address itself
- The asset (symbol) associated with that address
Prime will validate the address format to ensure it matches the specified asset. Currently, only the default network for each asset is supported, but additional network parameters may be enabled in a future release. For details on which networks are available, refer to Account Structure.
AddressBookService addressBookService = PrimeServiceFactory.createAddressBookService(client);
CreateAddressBookEntryRequest request = new CreateAddressBookEntryRequest.Builder("portfolio_id")
.accountIdentifier("account_identifier")
.address("address")
.currencySymbol("currency_symbol")
.name("name")
.build();
CreateAddressBookEntryResponse response = addressBookService.createAddressBookEntry(request);
To learn more about this SDK, please visit the Prime Java SDK.
AddressBookService addressBookService = PrimeServiceFactory.createAddressBookService(client);
CreateAddressBookEntryRequest request = new CreateAddressBookEntryRequest.Builder("portfolio_id")
.accountIdentifier("account_identifier")
.address("address")
.currencySymbol("currency_symbol")
.name("name")
.build();
CreateAddressBookEntryResponse response = addressBookService.createAddressBookEntry(request);
To learn more about this SDK, please visit the Prime Java SDK.
var addressBookService = new AddressBookService(client);
var request = new CreateAddressBookEntryRequest("portfolio_id")
{
Address = "address",
CurrencySymbol = "currency_symbol",
Name = "name",
AccountIdentifier = "account_identifier",
};
var response = addressBookService.CreateAddressBookEntry(request);
To learn more about this SDK, please visit the Prime .NET SDK.
addressBookService := addressbook.NewAddressBookService(client)
request := &addressbook.CreateAddressBookEntryRequest{
PortfolioId: "portfolio-id",
Address: "address",
Symbol: "currency_symbol",
Name: "name",
AccountIdentifier: "account_identifier",
}
response, err := addressBookService.CreateAddressBookEntry(context.Background(), request)
To learn more about this SDK, please visit the Prime Go SDK.
prime_client = PrimeClient(credentials)
request = CreateAddressBookEntryRequest(
portfolio_id="portfolio_id",
address="address",
currency_symbol="currency_symbol",
name="name",
account_identifier="account_identifier",
)
response = prime_client.get_address_book(request)
To learn more about this SDK, please visit the Prime Python SDK.
primectl create-address-book-entry --help
To learn more about this CLI, please visit the Prime CLI.
const addressBooksService = new AddressBooksService(client);
addressBooksService.createAddressBook({
portfolioId: 'PORTFOLIO_ID_HERE',
address: 'ADDRESS_HERE',
currencySymbol: 'ETH',
name: 'XYZ Address',
}).then(async (response) => {
console.log('Address Book: ', response);
})
To learn more about this SDK, please visit the Prime TS SDK.
Creating a Crypto Withdrawal
Onchain crypto withdrawals to an allowlisted address are created via the Create Withdrawal endpoint. Specify the Wallet ID to withdraw from; for a refresher on obtaining Wallet IDs, see the Wallets page.
Even though withdrawals can be created through the API, the default behavior requires UI approval to finalize the transaction. The API response will include:
- A Transaction ID, which can be used to track the transaction
- An Activity ID specific to the consensus process in Prime
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
CreateWithdrawalRequest request = new CreateWithdrawalRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.walletId("WALLET_ID_HERE")
.amount("0.001")
.destinationType(DestinationType.DESTINATION_BLOCKCHAIN)
.idempotencyKey(UUID.randomUUID().toString())
.currencySymbol("ETH")
.blockchainAddress(new BlockchainAddress.Builder()
.address("DESTINATION_WALLET_ADDRESS")
.build();
CreateWithdrawalResponse response = transactionsService.createWithdrawal(request);
To learn more about this SDK, please visit the Prime Java SDK.
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
CreateWithdrawalRequest request = new CreateWithdrawalRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.walletId("WALLET_ID_HERE")
.amount("0.001")
.destinationType(DestinationType.DESTINATION_BLOCKCHAIN)
.idempotencyKey(UUID.randomUUID().toString())
.currencySymbol("ETH")
.blockchainAddress(new BlockchainAddress.Builder()
.address("DESTINATION_WALLET_ADDRESS")
.build();
CreateWithdrawalResponse response = transactionsService.createWithdrawal(request);
To learn more about this SDK, please visit the Prime Java SDK.
var transactionsService = new TransactionsService(client);
var request = new CreateWithdrawalRequest("PORTFOLIO_ID_HERE", "WALLET_ID_HERE")
{
Amount = "0.001",
DestinationType = DestinationType.DESTINATION_BLOCKCHAIN,
IdempotencyKey = Guid.NewGuid().ToString(),
CurrencySymbol = "ETH",
BlockchainAddress = new BlockchainAddress
{
Address = "DESTINATION_WALLET_ADDRESS",
},
};
var response = transactionsService.CreateWithdrawal(request);
To learn more about this SDK, please visit the Prime .NET SDK.
transactionsService := transactions.NewTransactionsService(client)
request := &transactions.CreateWalletWithdrawalRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
WalletId: "WALLET_ID_HERE",
Amount: "0.001",
DestinationType: "DESTINATION_BLOCKCHAIN",
IdempotencyKey: uuid.New().String(),
Symbol: "ETH",
BlockchainAddress: &transactions.BlockchainAddress{
Address: "DESTINATION_WALLET_ADDRESS",
},
}
response, err := transactionsService.CreateWalletWithdrawal(context.Background(), request)
To learn more about this SDK, please visit the Prime Go SDK.
prime_client = PrimeClient(credentials)
request = CreateWithdrawalRequest(
portfolio_id="PORTFOLIO_ID_HERE",
wallet_id="WALLET_ID_HERE",
amount = '0.001',
destination_type = 'DESTINATION_BLOCKCHAIN',
idempotency_key = str(uuid.uuid4()),
currency_symbol = 'ETH',
blockchain_address = BlockchainAddress(
address='DESTINATION_WALLET_ADDRESS',
)
response = prime_client.create_withdrawal(request)
To learn more about this SDK, please visit the Prime Python SDK.
const transactionsService = new TransactionsService(client);
transactionsService.createWithdrawal({
portfolioId: 'PORTFOLIO_ID_HERE',
walletId: 'WALLET_ID_HERE',
amount: "0.001",
idempotencyKey: uuidv4(),
currencySymbol: "ETH",
destinationType: DestinationType.DestinationBlockchain,
blockchainAddress: {
address: 'DESTINATION_WALLET_ADDRESS',
}
}).then(async (response) => {
console.log('Withdrawal: ', response);
})
To learn more about this SDK, please visit the Prime TS SDK.
primectl create-withdrawal --help
Tracking withdrawals
Use the Transaction ID returned by the Create Withdrawal endpoint to track the transaction’s status:
The transaction STATUS
field in these responses indicates the current stage of withdrawal processing (e.g., pending approval, approved, completed).
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
GetTransactionByTransactionIdRequest request = new GetTransactionByTransactionIdRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.transactionId("TRANSACTION_ID_HERE")
.build();
GetTransactionByTransactionIdResponse response = transactionsService.getTransactionByTransactionId(request);
To learn more about this SDK, please visit the Prime Java SDK.
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
GetTransactionByTransactionIdRequest request = new GetTransactionByTransactionIdRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.transactionId("TRANSACTION_ID_HERE")
.build();
GetTransactionByTransactionIdResponse response = transactionsService.getTransactionByTransactionId(request);
To learn more about this SDK, please visit the Prime Java SDK.
var transactionsService = new TransactionsService(client);
var request = new GetTransactionByTransactionIdRequest("PORTFOLIO_ID_HERE", "TRANSACTION_ID_HERE");
var response = transactionsService.GetPortfolioById(request);
To learn more about this SDK, please visit the Prime .NET SDK.
transactionsService := transactions.NewTransactionsService(client)
request := &transactions.GetPortfolio{
PortfolioId: "PORTFOLIO_ID_HERE",
TransactionId: "TRANSACTION_ID_HERE",
}
response, err := transactionsService.GetTransactions(context.Background(), request)
To learn more about this SDK, please visit the Prime Go SDK.
prime_client = PrimeClient(credentials)
request = GetTransactionRequest(
portfolio_id="PORTFOLIO_ID_HERE",
transaction_id="TRANSACTION_ID_HERE",
)
response = prime_client.get_transaction(request)
To learn more about this SDK, please visit the Prime Python SDK.
primectl get-transaction --help
const transactionsService = new TransactionsService(client);
transactionsService.getTransaction({
portfolioId: 'PORTFOLIO_ID_HERE',
transactionId: 'TRANSACTION_ID_HERE',
}).then(async (response) => {
console.log('Transaction: ', response);
})
To learn more about this SDK, please visit the Prime TS SDK.
Fiat withdrawals
The Create Withdrawal endpoint can also be used to withdraw fiat. Before doing so, link a bank account in the Prime UI. Once linked, retrieve the bank account’s payment_method_id
via the List Entity Payment Methods endpoint. This endpoint requires the entity ID, which can be found by following instructions in the Account Structure page.
Once the correct payment_method_id
is obtained, call Create Withdrawal again, specifying the fiat amount, the payment method, and the destination type DESTINATION_PAYMENT_METHOD
. For a straightforward example, see Create Withdrawal To Payment Method.
Please note: All requests discussed above require proper authentication. For more information, visit REST API Authentication.