Trader API --go to Public API

Every api call needs a valid apikey and signature. They should be provided in the request header and 'Content-Type: application/json' is also needed.

Response Style: {"status":{"success":1},"result":null} success if success = 1 and result is the return data.

Base URL: https://rightbtc.com/api/trader/ See Also: Apply apikey and signature


ORDERS

ORDERS - CREATE ORDER

Creates a new order

POST

/order

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" -d'{"side":"BUY","quantity":12300000,"trading_pair":"BTCCNY","limit":1000000000000,"type":"LIMIT"}' https://www.rightbtc.com/api/trader/order

Success 200

Parameter:

Field Type Description
trading_pair String see /trading pairs for available tradingpair
quantity Number buy/sell quantity, max decimal digits list at /trading_pairs, should multiply by 1E8
limit Number buy/sell at price, max decimal digits list at /trading_pairs, should multiply by 1E8
type String "LIMIT"
side String "BUY" or "SELL"
Field Type Description
order_id Number order id
message String error type: ERR ASSETNOT_EXISTS
frozen Number frozen amount, should divide by 1E8

Success-Response

{
    "status": {
        "success": 1,
        "message": "CREATE_ORDER"
    },
    "result": {
        "frozen": "150000000000000.00000000",
        "order_id": "608391"
    }
}

Error-Response

{
    "status": {
        "success": 0,
        "message": "ERR_CREATE_ORDER"
    }
}

ORDERS - CANCEL ORDERS

Cancel orders.

DELETE

/order/:trading_pair/:id/:id:/:id/...

Example Usage:

curl -X DELETE -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/order/BTCCNY/10000

Success 200

Parameter:

Field Type Description
order_id Number return order_id if cancel request is accepted, wait to be processed

Success-Response

{
    "status": {
        "success": 1,
        "message": "CANCEL_ORDER"
    },
    "result": {
        "order_id": "2345,2344,2342"
    }
}

ORDERS - LIST ACTIVE ORDERS IN PAGE

Returns users active orders to the given trading pair as pages from the given cursor.

GET

/orderpage/:trading_pair/:page

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/orderpage/BTCCNY/0

Success 200

Parameter:

Field Type Description
cursor String new cursor for next api call if cursor != "0"
orders Array see also /orders/:trading_pair/:id

Success-Response

{
    "status": {
        "success": 1,
        "message": "SUC_LIST_AVTICE_ORDERS_PAGE"
    },
    "result": {
        "cursor": "0",
        "orders": [
            {
                "id": 4180528,
                "quantity": 20000000,
                "rest": 20000000,
                "limit": 1000000,
                "price": null,
                "side": "BUY",
                "created": 1496005693738
            }
        ]
    }
}

ORDERS - LIST ACTIVE ORDERS

Returns users active orders to the given trading pair.

GET

/orders/:trading_pair/:id/:id:/id/...

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/orders/BTCCNY curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/orders/BTCCNY/10000

Success 200

Parameter:

Field Type Description
id Number order id
quantity Number amount of original order, should divide by 1E8
rest Number amount not matched, should divide by 1E8
limit Number price of original orde, should divide by 1E8
price Number average price, should divide by 1E8
side String order direction
created Number order created timestamp

Success-Response

{
    "status": {
        "success": 1,
        "message": "SUC_LIST_AVTICE_ORDERS"
    },
    "result": [
        {
            "id": 4180528,
            "quantity": 20000000,
            "rest": 20000000,
            "limit": 1000000,
            "price": null,
            "side": "BUY",
            "created": 1496005693738
        }
    ]
}

ORDERS - LIST HISTORY ORDERS

Returns users history orders to the given trading pair.

GET

/history/:trading_pair/:id/:id/:id

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/history/BTCCNY/11060

Success 200

Parameter:

Field Type Description
id Number order id
status String NEW:not matched order/TRADE:full filled or partial filled order/CANCEL:order canceled
fee Number fee rate in percentage
min_fee Number minumun fees,should divide by 1E8
created_at String order created datetime
cost Number total cost of the filled quantity
limit Number price of original order, should divide by 1E8
quantity Number amount of original order, should divide by 1E8
filled_quantity Number matched amount, should divide by 1E8

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "trading_pair": "ETPCNY",
            "status": "TRADE",
            "fee": 0.23,
            "min_fee": 10000000,
            "created_at": "2017-05-25T00:12:27.000Z",
            "cost": 1152468000000,
            "limit": 3600000000,
            "id": 11060,
            "quantity": 32013000000,
            "filled_quantity": 32013000000
        }
    ]
}

ACCOUNT

ACCOUNT - GET BALANCE

Returns the users account balance for a specified asset(see /balances for available assets).

GET

/balance/:symbol

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/balance/CNY

Success 200

Parameter:

Field Type Description
symbol String asset symbol
balance String available amount, should divide by 1E8.
frozen String frozen amount, should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": "BALANCE"
    },
    "result": {
        "symbol": "CNY",
        "balance": "3530103600",
        "frozen": "240790000"
    }
}

ACCOUNT - LIST BALANCES

  • Returns the users account balances.

GET

/balances

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/balances

Success 200

Parameter:

Field Type Description
asset String asset symbol
balance String available amount, should divide by 1E8.
frozen String frozen amount, should divide by 1E8.

Success-Response

{
    "status": {
        "success": 1,
        "message": "GET_BALANCES"
    },
    "result": [
        {
            "asset": "ETP",
            "balance": "5000000000000",
            "frozen": "0",
            "state": "1"
        },
        {
            "asset": "CNY",
            "balance": "10000000000000",
            "frozen": "240790000",
            "state": "1"
        }
    ]
}

ACCOUNT - LIST DEPOSIT

Returns deposits

GET

/deposits/:asset/:page

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/deposits/CNY/0

Success 200

Parameter:

Field Type Description
amount Number deposit amount, should divide by 1E8
state String deposit state (PENDING
created_at String deposit time

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "amount": 10000000000000,
            "state": "PENDING",
            "created_at": "2017-05-08T11:12:46.000Z"
        },
        {
            "amount": 10000000000000,
            "state": "COMPLETE",
            "created_at": "2016-10-18T04:31:13.000Z"
        }
    ]
}

ACCOUNT - LIST WITHDRAWAL

Returns withdrawals

GET

/withdrawals/:asset/:page

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/withdrawals/BTC/0

Success 200

Parameter:

Field Type Description
amount Number withdrawal amount, should divide by 1E8
state String withdrawal state (PENDING
created_at String withdrawal time

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "amount": 30000000,
            "status": "PENDING",
            "created_at": "2017-02-15T23:30:03.000Z"
        },
        {
            "amount": 30000000,
            "status": "PENDING",
            "created_at": "2017-01-12T20:15:32.000Z"
        },
        {
            "amount": 100000000,
            "status": "PENDING",
            "created_at": "2017-01-12T01:47:38.000Z"
        },
        {
            "amount": 300000000,
            "status": "PENDING",
            "created_at": "2016-12-13T23:34:38.000Z"
        },
        {
            "amount": 100000000,
            "status": "COMPLETE",
            "created_at": "2016-12-13T23:26:54.000Z"
        }
    ]
}

ORDERS - LIST HISTORY TRADES

Returns users history trades to the given trading pair.

GET

/historys/:trading_pair/:page

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/historys/BTCCNY/0

Success 200

Parameter:

Field Type Description
order_id Number order id
trade_id Number trade id
side String 'B' for 'BUY' / 'S' for 'SELL'
price Number deal price, should divide by 1E8
quantity Number deal amount, should divide by 1E8
created_at String order created datetime

Success-Response

{
    "status": {
        "success": 1,
        "message": null
    },
    "result": [
        {
            "order_id": 118735,
            "trade_id": 7,
            "trading_pair": "BTCCNY",
            "side": "B",
            "quantity": 1000000000,
            "price": 900000000,
            "created_at": "2017-06-06T20:45:27.000Z"
        },
        {
            "order_id": 118734,
            "trade_id": 7,
            "trading_pair": "BTCCNY",
            "side": "S",
            "quantity": 1000000000,
            "price": 900000000,
            "created_at": "2017-06-06T20:45:27.000Z"
        }
    ]
}

ORDERS - LIST TRADING PAIRS

Returns all trading pairs.

GET

/trading_pairs

Example Usage:

curl -H"apikey: your api key" -H"signature: your signature" -H"Content-Type: application/json" https://www.rightbtc.com/api/trader/trading_pairs

Success 200

Parameter:

Field Type Description
name String trading pair
ask assetsymbol String FIAT
ask assetdecimals String max decimal digits
bid assetsymbol String COIN
bid assetdecimals String max decimal digits

Success-Response

{
    "BTCCNY": {
        "name": "BTCCNY",
        "ask_asset_symbol": "CNY",
        "ask_asset_decimals": 2,
        "ask_asset_type": "FIAT",
        "bid_asset_symbol": "BTC",
        "bid_asset_decimals": 3,
        "bid_asset_type": "COIN"
    },
    "ETCCNY": {
        "name": "ETCCNY",
        "ask_asset_symbol": "CNY",
        "ask_asset_decimals": 2,
        "ask_asset_type": "FIAT",
        "bid_asset_symbol": "ETC",
        "bid_asset_decimals": 2,
        "bid_asset_type": "COIN"
    },
    "ETHCNY": {
        "name": "ETHCNY",
        "ask_asset_symbol": "CNY",
        "ask_asset_decimals": 2,
        "ask_asset_type": "FIAT",
        "bid_asset_symbol": "ETH",
        "bid_asset_decimals": 3,
        "bid_asset_type": "COIN"
    },
    "ETPCNY": {
        "name": "ETPCNY",
        "ask_asset_symbol": "CNY",
        "ask_asset_decimals": 2,
        "ask_asset_type": "FIAT",
        "bid_asset_symbol": "ETP",
        "bid_asset_decimals": 2,
        "bid_asset_type": "COIN"
    },
    "ZECCNY": {
        "name": "ZECCNY",
        "ask_asset_symbol": "CNY",
        "ask_asset_decimals": 2,
        "ask_asset_type": "FIAT",
        "bid_asset_symbol": "ZEC",
        "bid_asset_decimals": 3,
        "bid_asset_type": "COIN"
    }
}