I am trying to create transfer between accounts of the same user with different crypto currencies using the Coinbase API. I am using it’s official library which I know wasn’t exactly maintained but I tried to debug everything manyually and it seems that the request it’s sending to the API server is correct according to the official documentation.
Specifically, it uses GuzzleHttpPsr7 to send to /v2/accounts/[sender-account-id]/transactions the following parameters:
array:4 ["type" => "transfer", "amount" => "1", "to" => "[receiver-account-id]", "currency" => "USD"]
According to the documentation I should receive a response with 201 status code and with the transaction info in the body. Instead I get a 200 response with empty body and no transaction is recorded on the server.
If I mess up any of the fields of the request I get a proper exception and corresponding error status code. This makes me feel like there isn’t something wrong with my actual request.
I’ve noticed someone else got the same problem about a year ago and got no response. I hope I’d have more luck since I really don’t know where to look at next and Coinbase’s support link just points to stackoverflow 🙂
Update 2021.06.07:
Just to make sure I wasn’t crazy, I tried today to reproduce the same problem by sending the same request without using the official library and just writing the code for the request from scratch and the result is the same.
I also tried another endpoint that is supposed to return a 201 response, the one used for sending money to an external email / wallet. This one worked like a charm, I got my 201 response with the transaction info and it was also processed on the server.
This makes me feel more and more like the issue is not with me but with the API endpoint itself but with how big Coinbase actually is, this somehow doesn’t feel right, there’s no way they wouldn’t have fixed it in one year, right?
Advertisement
Answer
Ok so after a bit of even more digging I found an answer to a different question detailing how I could interact with the /v2/trades endpoint which actually does what I need it to do.
You can find more details here, just mind the fact that the endpoint for making the original order is /v2/trades instead of /v2/trade as specified there. Otherwise, his description is accurate and works as of today.
I should also mention that I did open a ticket to Coinbase before getting this solution and their response was that they are only providing support through their public documentation which is short for “you’re an idiot, it’s all written there”.
Needless to say that the public API documentation does not mention the /v2/trades endpoint, instead it documents the /transaction endpoint which does not work for transfers as specified in the original question.