hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
322 stars 152 forks source link

Patch order not working, #277

Closed gasse4life closed 2 years ago

gasse4life commented 2 years ago

hi i need help to patch order,

i tried in v2 and v3,

i can cancel or put an limitMarket or stopLimit order,

but both return error 500 when i tru to patch, anybody can help?

hitbtc-com commented 2 years ago

Please share request body.

gasse4life commented 2 years ago

https://api.hitbtc.com/api/2/explore/

PATCH /spot/order/{client_order_id}

always invalid path share or error 500, and after an error 500 if i retry i got duplicate client order id

gasse4life commented 2 years ago

curl -X POST "https://api.hitbtc.com/api/3/spot/order" -H "accept: application/json" -H "Authorization: Basic Z2c3X0lhQ08tZTRfSzJBcjR1M0FQd2pUaVQwMXFRSlY6SFJpd0x2S0s3Yk4yYVdfcWVJQ1lnbVFYSmQ4Zkwxang=" -H "Content-Type: application/x-www-form-urlencoded" -d "client_order_id=43fggt56677ucfvffft567uyy&symbol=XRPUSDT&side=sell&type=stopMarket&time_in_force=GTC&quantity=0.1&price=1.50000&stop_price=1.115421"

{ "id": 704904230579, "client_order_id": "43fggt56677ucfvffft567uyy", "symbol": "XRPUSDT", "side": "sell", "status": "suspended", "type": "stopMarket", "time_in_force": "GTC", "quantity": "0.1", "quantity_cumulative": "0", "stop_price": "1.115421", "post_only": false, "created_at": "2021-11-10T21:49:53.933Z", "updated_at": "2021-11-10T21:49:53.933Z" }

INSERT IS OKAY

now patch

curl -X PATCH "https://api.hitbtc.com/api/3/spot/order/43fggt56677ucfvffft567uyy" -H "accept: application/json" -H "Authorization: Basic Z2c3X0lhQ08tZTRfSzJBcjR1M0FQd2pUaVQwMXFRSlY6SFJpd0x2S0s3Yk4yYVdfcWVJQ1lnbVFYSmQ4Zkwxang=" -H "Content-Type: application/x-www-form-urlencoded" -d "quantity=0.1&price=1.100000&new_client_order_id=43fggt56okokokucfvffft567uyy"

{ "error": { "code": 500, "message": "Internal Server Error" } }

hitbtc-com commented 2 years ago

Thank you for this report.

Unfortunately, order Cancel/Replace is not supported for suspended (stop) orders. Once supported, you will know it from Change Log section in the API documentation. Error 500 will be replaced by 400 with description.

gasse4life commented 2 years ago

ok thank you for your help and very fast reply,

i hope it will be soon..

its pulling a tons of request to the server for nothing,

maybe you can tip me to reduce request,

is there any type of trade i can patch?

hitbtc-com commented 2 years ago

Any active limit order can be replaced.