Skip to content

0312limit_batch_orders

张帅磊 edited this page May 13, 2021 · 7 revisions

Place Multiple Limit Orders

  • Request description:place multiple limit orders in the same market, limit up to 100.

  • Request type: POST

  • Signature required: Yes

  • Rate limit: 100/10s

  • Request Header:

    authorization:"xxxx" (32-digit capital letters, see generating methos in <API invocation instruction>)

  • Request Url:https://api.coinex.com/v1/order/limit/batch

  • Request parameter:

    name type required description
    access_id String Yes access_id
    batch_orders String(json) Yes multiple orders json format string, add option parameter, order option, NORMAL: normal order, IOC: an Immediate or Cancel Order, FOK: Fill or kill Order, MAKER_ONLY: only maker order, default value is NORMAL
    market String Yes See <API invocation description·market>
    type String Yes sell: sell order;
    buy: buy order;
    amount String Yes order amount, min. 0.001, accurate to 8 decimal places
    price String Yes order amount, accurate to 8 decimal places
    source_id String no user defines number and return
    account_id Integer no margin account ID/future account ID. If margin trade, See < Inquire Margin Account Market Info>. If future trade, See < Inquire Future Account Market Info>.
    tonce Integer Yes Tonce is a timestamp with a positive Interger that represents the number of milliseconds from Unix epoch to the current time. Error between tonce and server time can not exceed plus or minus 60s
  • Return value description:

    name type description
    amount String order count
    avg_price String average price
    create_time Interger time when placing order
    deal_amount String count
    deal_fee String transaction fee
    deal_money String amount
    finished_time Interger complete time
    id Interger Order No.
    maker_fee_rate String maker fee
    market String See <API invocation description·market>
    order_type String limit:limit order;
    market:market order;
    price String order price
    status String not_deal: unexecuted;
    part_deal: partly executed;
    done: executed;
    taker_fee_rate String taker fee
    type String sell: sell order;
    buy: buy order;
    client_id String client_id: return what you give;
  • Example:

# Request
POST https://api.coinex.com/v1/order/limit/batch
# Request.Body
{
  "access_id":" BFFA64957AA240F6BBEA26F4E07EC0D9",
  "tonce": 1513746038205,
  "market":"BTCBCH",  # market type
  "account_id":"2",
  "batch_orders": "[{\"source_id\": \"123\", \"amount\": \"56.5\", \"type\": \"sell\", \"price\": \"10\", \"client_id\": \"xxxx\", \"option\": \"NORMAL\"}, {\"source_id\": \"234\", \"amount\": \"56.6\", \"type\": \"sell\", \"price\": \"10.5\", \"client_id\": \"xxxxx\", \"option\": \"MAKER_ONLY\"}]"
}
# Response
{
  "code": 0,
  "data": [
            {
                "code": 0,
                "data": {
                    "amount": "56.5",              # order count       
                    "avg_price": "11641.3",        # average order price
                    "create_time": 1496798479,     # order placing time 
                    "deal_amount": "56.5",         # executed amount
                    "deal_fee": "1315.4669122",    # transaction fee
                    "deal_money": "657733.4561",   # executed value
                    "id": 300032,                  # order no.
                    "left": "0",                   # unexecuted amount
                    "maker_fee_rate": "0.001",     # maker rate
                    "market": "BTCBCH",            # market
                    "order_type": "limit",         # order type: limit: limit order;market: market order;
                    "price": "10",                 # order price
                    "source_id": "123",            # user-defined no.
                    "status": "done",              # order status: done:executed;part_deal:partly executed;not_deal:unexecuted;
                    "taker_fee_rate": "0.002",     # taker rate
                    "type": "sell",                # order type: sell: sell;buy: buy;
                    "client_id": "xxxx"
                    },
                "message": "",
            },
            ......
          ]
  "message": "Ok"
}

HTTP API Introduction

Common API

Market API

Account API

Trading API

Margin API

Contract API

WebSocket API Introduction

Clone this wiki locally