According to documentation, I should be able to buy ETH using coinbase API (see Place buy order).
Now, looks like I am getting BTC instead.
private static void placeNonCommitBuy(String paymentMethod) {
if (sAccountID != null) {
String url = String.format("https://api.coinbase.com/v2/accounts/%s/buys", sAccountID);
try {
JSONObject params = new JSONObject();
params.put("amount", "0.001");
params.put("currency", "ETH");
params.put("payment_method", paymentMethod);
params.put("agree_btc_amount_varies", true);
params.put("commit", false);
params.put("quote", true);
doPost(url, params, sJustPrint);
} catch (JSONException ex) {
Assert.fail();
}
}
}
I got that confirmation :
{
"data": {
"id": <...snip...>,
"status": "created",
"payment_method": {
"id": <...snip...>,
"resource": "payment_method",
"resource_path": <...snip...>
},
"transaction": null,
"user_reference": <...snip...>,
"created_at": "2018-01-18T01:37:15Z",
"updated_at": "2018-01-18T01:37:16Z",
"resource": "buy",
"resource_path": <...snip...>,
"fee": {
"amount": "0.99",
"currency": "USD"
},
"amount": {
"amount": "0.00008968",
"currency": "BTC"
},
"total": {
"amount": "2.02",
"currency": "USD"
},
"subtotal": {
"amount": "1.03",
"currency": "USD"
},
"committed": true,
"payout_at": "2018-01-18T01:37:14Z",
"instant": true,
"requires_completion_step": false
}
}
In the website, I see that I now have some BTC (about 1 USD worth of it), but not ETH.
Is there a missing / undocumented params I need to use? Or a mistake in my request?