Tuesday, 7 December 2021

Bitstamp API V2: problem with POST parameters in limit orders: missing amount and price?

Since December, Bitstamp users must switch to authenticating using API V2. I have been busy rewriting my trading bot, but I have been getting a problem with some POST parameters in limit orders. So, for example, for a buy limit order, the headers will look like this:

headers = {
    'X-Auth': 'BITSTAMP ' + api_key,
    'X-Auth-Signature': gen_signature(timestamp,nonce, url_tail),
    'X-Auth-Nonce': nonce,
    'X-Auth-Timestamp': timestamp,
    'X-Auth-Version': 'v2',
    'Content-Type': content_type,
    'amount': amount,
    'price': price
}  

Here amount and price should be strings (previously, they had to be floats). When trying to execute a buy limit order as a test, I get the following error:

{'status': 'error', 'reason': 'Missing amount and/or price POST parameters'}

I have checked several times (by printing for example) that amount and price have values, but it keeps showing me this error.

Did someone have the same problem? What am I doing wrong here?

Edit: this is the link to the API https://www.bitstamp.net/api/#buy-order



from Bitstamp API V2: problem with POST parameters in limit orders: missing amount and price?

No comments:

Post a Comment