Withdraw Crypto - How to estimate the fees?

Hi,

so I want to withdraw 1 BTC and the recipient will receive 1 BTC - transaction-fee.

My plan was to use:
https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getwithdrawfeeestimate

But it seems not usable because I never got a passphrase (and I know it’s deprecated).
How can I realize this?

Hey @bu11it, Welcome to the Developer Forum Community!

In order to use the endpoint https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getwithdrawfeeestimate , you need to have an Exchange account with Coinbase. Coinbase Exchange API is for our Institutional customers.

However, if you are using Sign in with Coinbase APIs or Advance Trade APIs (Coinbase.com), we do not have a direct api for coinbase.com to get the withdrawal fees, you may however follow the below steps to see the fee associated with the withdrawals.

Using Withdrawals Endpoint:

  • Utilize the Withdraw Funds endpoint by pushing a POST request to https://api.coinbase.com/v2/accounts/:account_id/withdrawals.
  • Set the commit parameter into false, useful to display a withdrawal before executing. The withdrawal will not be completed immediately. This way, you can be able to see the fee associated with the withdrawals.
  • For more information about the Withdrawals endpoint you may go through here

Using Sells Endpoint

  • You may use the Place Sell Order endpoint by pushing a POST request to https://api.coinbase.com/v2/accounts/:account_id/sells.
  • Set the commit parameter into false, useful when displaying the confirmation for a sell. The sell order will not be completed immediately. This way, you can be able to see the fee associated with the sell order.
  • For more information about the Sells endpoint you may go through here.

We hope this helps. We’d be happy to answer any more questions.

Thank you!

1 Like

Using Withdrawals Endpoint:

  • Utilize the Withdraw Funds endpoint by pushing a POST request to https://api.coinbase.com/v2/accounts/:account_id/withdrawals.
  • Set the commit parameter into false, useful to display a withdrawal before executing. The withdrawal will not be completed immediately. This way, you can be able to see the fee associated with the withdrawals.
  • For more information about the Withdrawals endpoint you may go through here

I read this in another thread. But isn’t the withdrawals endpoint just for FIAT withdrawals? What do I have to use as payment_method if I want to withdraw e.g. BTC?

The Sells endpoint will only give me the fee from the order/trade. Thats not what I need.

Hey @bu11it,

Yes. Using Withdrawals Endpoint allows you to withdraw funds using a payment method (e.g., a bank).
Using Sells Endpoint allows you to sell your crypto in exchange for a fiat.

For your use-case: “to withdraw 1 BTC and the recipient receive 1 BTC”, the Send Money can be used, however this endpoint doesn’t have a fees parameter. We do not have an API to estimate the transaction fees.

We have taken this as a feedback request. While we can’t offer any specific timeline for adding features, we are constantly working to build products our customers will love.

Thank you!

1 Like

With the Pro API, there was a flag to enable including fees in the amount. I did not have to estimate fees if I wanted to withdraw the entire balance (as the fee is just subtracted from the amount specified).
Send Money API does not have “include fees” feature AND there is no API to estimate fees with the new APIs.
I would like to have BOTH but please provide at least one of these features

1 Like

Hey @telos, if you are looking for fee details, Expand=All option would display the fees information under transactions → Expanding Sign in with Coinbase Resources | Coinbase Cloud.

Sample API response → https://api.coinbase.com/v2/accounts/:account_id/transactions?expand=all

Please note that, Send Money API doesn’t have a fee parameter. Rest assured, this is taken as feature request.

2 Likes