Reputation: 2543
I'm trying to send some btc using an authenticated access_token to another coinbase address. Everything seems to be working, except Coinbase always responds with 'amount below minimum.' Can anyone catch what I'm doing wrong here?
url = "https://coinbase.com/api/v1/transactions/send_money?access_token=XXX"
params = {
"transaction": {
"to": "1G8f9pRvgprVMUymuQugZrhYSqBNXuwzNt",
"amount": "0.011",
"notes": "Testing transaction"
}
}
r = requests.post(url, data=json.dumps(params)
Coinbase returns:
{
"success":false,
"errors":["You must enter a positive amount","This transaction amount is below the current minimum amount to be accepted by the bitcoin network. (0.00005430 BTC)"],
"transaction":{"id":"XXX",
"created_at":null,
"hsh":null,
"notes":null,
"amount":{"amount":"0.00000000","currency":"BTC"},
"request":false,
"status":"pending",
"recipient_address":""
}
}
Upvotes: 3
Views: 1047
Reputation: 730
If anyone else is getting this error using Coinbase API v2 - you can only send micropayments to a Coinbase email, not any bitcoin wallet.
Upvotes: 1
Reputation: 2543
Ugh. Forgot to set the headers :(
This works:
url = "https://coinbase.com/api/v1/transactions/send_money?access_token=XXX"
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
params = {
"transaction": {
"to": "1G8f9pRvgprVMUymuQugZrhYSqBNXuwzNt",
"amount": "0.011",
"notes": "Testing transaction"
}
}
r = requests.post(url, data=json.dumps(postData), headers=headers)
Upvotes: 1