BTCMarkets / API

API
119 stars 30 forks source link

Authentication Failed on create order only #105

Closed bjay207a closed 6 years ago

bjay207a commented 6 years ago

Hi there,

I have tried everything but the Create/Order always fails. See the response below. {"success":false,"errorCode":1,"errorMessage":"Authentication failed."}

The code appears to be correct as other API calls such as the following returns successfully: /order/history /order/open /order/trade/history

The only difference between the above and Create/Oder is that its a POST while the above are GET requests.

Attached is the screenshot of API request where you can see the exact request. Please let me know if you need more info.

I would really appreciate if you can point out what might be the issue.

Regards, Bjay btcm-create-order

justin-ngin commented 6 years ago

@bjay207a ,

The above mentioned routes are indeed POST routes according to our API documentation. However the difference between these and create/order is that order requires a price and a volume, in the appropriate format. For consistency in most situations, these numbers should be long integers, with no decimal points. Please try formatting the data in your POST requests this way, and let me know if that resolves the issue.

Regards, Justin

bjay207a commented 6 years ago

Hi Justin,

I really appreciate your help.

Formatting the price and volume to long has successfully created the order.

Cheers, Bjay