Huobi Global is going to optimize the error message while order cancellation fails

Dear API users,

To enhance user experience , Huobi Global is going to optimize the error message while order cancellation fails.

Effective Date:September 19, 2019 (GMT+8)
All the changes will be updated on 【API Docs】

Huobi Global
September 24, 2019

The following are change details:
Currently,
If order cancellation fails via this REST endpoint - POST /v1/order/orders/{order-id}/submitcancel, following error message is returned –
{
  "status": "error",
  "err-code": "order-orderstate-error",
  "err-msg": " Incorrect order state"
}

If order cancellation fails via this REST endpoint - POST /v1/order/orders/batchcancel, following error message is returned –
{
  "status": "ok",
  "data": {
    "success": ["123","456"],
    "failed": [
      {
        "err-msg": " Incorrect order state",
        "order-id": "12345678",
        "err-code": "order-orderstate-error"
      }
    ]
  }
}

Since the effective date of this notification,

If order cancellation fails via this REST endpoint - POST /v1/order/orders/{order-id}/submitcancel, following error message will be returned –
{
  "status": "error",
  "err-code": "order-orderstate-error",
  "err-msg": "Incorrect order state ",
  "order-state":-1 // current order state
}

If order cancellation fails via this REST endpoint - POST /v1/order/orders/batchcancel, following error message will be returned –
{
  "status": "ok",
  "data": {
    "success": ["123","456"],
    "failed": [
      {
        "err-msg": "Incorrect order state ",
        "order-id": "12345678",
        "err-code": "order-orderstate-error",
        "order-state":-1 // current order state
      }
    ]
  }
}

The newly added field “order-state” will be only returned while order cancellation fails.

The possible values of “order-state” are –
-1 order was already closed in the long past (order state = canceled, partial-canceled, filled, partial-filled)
0 order-id not found
5 partial-canceled
6 filled
7 canceled
10 cancelling.