Hi I am trying to hit POST request on https://api.exchange.coinbase.com/conversions API but getting Cannot convert ETH to BTC.
I wanted to know if there is something I have done wrong or does the API doesn’t support it.
It would be really helpful if somebody guide me in this regard
Hello @salman116. Welcome to Coinbase Cloud Developer Forum! We appreciate your interest in our Coinbase APIs.
We understand that you are receiving a 400 status code error whenever you try to convert ETH to BTC. This is because the /conversions
endpoint only works for scenarios wherein you want to convert crypto to fiat or vice versa. Hence, this endpoint is not applicable for crypto to crypto conversions. However, as of now, this API endpoint only supports the USDC <-> USD pair.
On the other hand, if you want to convert crypto to crypto, we believe you can utilize the /orders
endpoint since it supports the ETH-BTC pair. You may confirm this by pushing a GET request to https://api.exchange.coinbase.com/products/ETH-BTC.
We hope we were able to help you with your concern. Thank you!
Hello @LaRisa so what will be the flow
if we want to convert SHIBA INU into ETH and then withdraw on ETH network, what will be the step by step process then
Hello @salman116! For the step by step process of converting SHIB into ETH and withdrawing it on an ETH wallet (“ETH network”), I have enumerated the process below:
- To convert SHIB to ETH, you may utilize the /orders endpoint we mentioned since it supports crypto to crypto transactions.
- You can use the said endpoint by sending a POST request to https://api.exchange.coinbase.com/orders.
- Please note that SHIB-ETH is not supported in the /orders endpoint as of now. You may need to sell SHIB first into its supported pair (e.g USDT, USD, GBP and EUR). After that, you can now use it to buy ETH.
- To view all the supported trading pairs, you may send a GET request to https://api.exchange.coinbase.com/products. For more information regarding the said endpoint, you may go through this link: Get all known trading pairs
- Once SHIB is converted to ETH, you may now use the /withdrawals/crypto endpoint to withdraw it to an ETH wallet (“ETH network”) through a crypto address.
- This endpoint lets you withdraw funds from the specified profile_id to an external crypto address by sending a POST request to https://api.exchange.coinbase.com/withdrawals/crypto.
Additionally, you may also use the /withdrawals/coinbase-account endpoint to withdraw ETH to a Coinbase account by sending a POST request https://api.exchange.coinbase.com/withdrawals/coinbase-account.
We hope we were able to help you with your concern. Please feel free to reach us again if you have further questions. Thank you!