Exchange Documentation
API Documentation

Moonbit Exchange API (1.0)

Download OpenAPI specification:Download

This documentation will give you an overview of the Moonbit Exchange API.

HMAC can be obtained using a Secret key. This pre shared secret key ensures that the message is encrypted by a legitimate source. You can run through HMAC test using:

Secret-Key : 03c06dd7-4982-441a-910d-5fd2cbb3f1c6

Authentication

httpBearer

Security Scheme Type HTTP
HTTP Authorization Scheme bearer

Market

Market - Market Summary By Pair

This endpoint returns the market summary of given pair.
A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency.
Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Market - Market Summary

this end point returns summary of all listed currency pairs

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Market - Trade History

This end point returns recent 50 trades for a given pair.
A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency.
Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH.

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    [
    ]
}

Market - BID-ASK Price By Pair

This endpoint returns the highest bid and lowest ask price for a given pair.
A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency.
Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH.

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Market - Open Order By Pair/Side/Depth

This endpoint returns the open orders based on a pair, order-side and book-depth supplied in the request.\

Param Name Description Mandatory
pair A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency. Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH. Yes
side Order Side. e.g. BUY or SELL Yes
depth Default is 10. No
Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Market - Get Price By Pair

This end point returns last traded price (current market price) for a given pair.
A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency.
Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH.

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Get Crypto Prices in USD

This endpoint returns the Cryptocurrency price in USD.

Authorizations:

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Market - Depth

This endpoint returns depth of a supplied currency pair and limit.\

Param Name Description Mandatory
symbol A symbol or pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency. Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH. Yes
limit Number of buy & sell orders to fetch. Options are 5, 10, 20, 50, 100, 500, 1000. No
Authorizations:
query Parameters
symbol
required
string
Example: symbol=BTC_ETH
limit
required
integer <int32>
Example: limit=10

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "string",
  • "errorMessage": "string",
  • "data":
    {
    }
}

Market - Chart Historical Data

This endpoint returns the historical chart data.

Param Name Description Mandatory
baseCurrency Base currency. e.g. BTC YES
quoteCurrency Quote currency. e.g. ETH YES
interval Interval in minutes. Default is 1440 NO
limit Default is 250 NO
timestamp Time in seconds before which data to be fetched. YES
Authorizations:
query Parameters
baseCurrency
required
string
Example: baseCurrency=BTC
quoteCurrency
required
string
Example: quoteCurrency=ETH
interval
required
integer <int32>
Example: interval=60
limit
required
integer <int32>
Example: limit=200
timestamp
required
integer <int64>
Example: timestamp=1541228704517

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    [
    ]
}

Liquidity Provider (v2)

Order - Place New Order

Param Name Description Mandatory
side Order Side. e.g. BUY or SELL YES
market Market currency. e.g. BTC YES
trade Trade currency. e.g. ETH YES
type Type of order. e.g. MARKET, LIMIT or STOPLIMIT YES
volume Amount of your order YES
rate Rate of your order at which it will be matched. YES
timeInForce Must be GTC, IOC or FOK. Default is GTC. NO
clientOrderId Unique order id for every order. NO
timestamp Current time in seconds (starting from Jan 1, 1970) YES
recvWindow Time in milliseconds for which HMAC is valid. Default is 10. NO
Authorizations:
header Parameters
apiKey
required
string
Example: b6048b8b-3736-4389-ba12-10daa6d1bb56
HMAC
required
string
Example: 45823D764D57C3F289864AE38B07519172C9BABC2AAF7896DC65265E44ADB8BF6B1B6046B87E958F8E3811D6CFDDCA37A171BD20E9C54222349E49C3B0FAA95D
Request Body schema: application/json
side
required
string
volume
required
string
rate
required
string
stop
required
string
market
required
string
trade
required
string
type
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "side": "BUY",
  • "volume": "4",
  • "rate": "0.2",
  • "stop": "0.1",
  • "market": "BTC",
  • "trade": "ETH",
  • "type": "LIMIT",
  • "timestamp": 1574679286,
  • "recvWindow": 100000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": "Success!",
  • "data":
    {
    }
}

Order - Get Wallet Balance

Param Name Description Mandatory
currency Currency to get the balance of. e.g. 'BTC'. or you can pass 'ALL' to get the balance of all the currencies. YES
timestamp Current time in seconds (starting from Jan 1, 1970) YES
recvWindow Time in milliseconds for which HMAC is valid. Default is 10. NO
Authorizations:
header Parameters
apiKey
required
string
Example: 846d3c72-761d-41ce-86cb-70204678ec31
HMAC
required
string
Example: 30FBB89923D4748AF2BCB1C466DB69E3035D63067AC384CCE88A56515727F9BFFE9A89EF028BF2247789851E94D3FEDDF7D7512EA55E9438B903DCAF09CE63C6E
Request Body schema: application/json
currency
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "currency": "ALL",
  • "timestamp": 1557310990,
  • "recvWindow": 18000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    [
    ]
}

Order - Open Orders

This endpoint returns one thousand orders that preceeds provided order-id.

Param Name Description Mandatory
apiKey Your API Public Key Yes
side Order Side. e.g. BUY or SELL Yes
order-Id Numeric Order-id e.g 122432324 No
pair Market_Currency e.g. BTC_LTC No
openOrders true returns open orders only, false returns filled & cancelled orders only No
Authorizations:
header Parameters
apiKey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 9DB66A45CBA0590A68F446BE24D5D28F3EAD767E2E3246A2C2A5A8E83B2FF57C21EA0500A7D9B5A774534F4909B52E14BE390274CFFC44E9FFF9B61C5CA6873E
Request Body schema: application/json
side
required
string
OrderId
required
integer <int32>
pair
required
string
openOrders
required
boolean
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "side": "ALL",
  • "OrderId": -1,
  • "pair": "ETH_BTC",
  • "openOrders": false,
  • "timestamp": 1566218873,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Error",
  • "errorMessage": "Invalid Side",
  • "data": null
}

Order - Order Status

This endpoint returns status of an order.

Param Name Description Mandatory
apiKey Your API Public Key Yes
side Order Side. e.g. BUY or SELL Yes
orderId Numeric Order-id e.g 122432324 Yes

Response Examples:

Side: BUY or SELL

Status: true or false

Status_String : Cancelled Filled Partially-Cancelled Filled Pending

Authorizations:
header Parameters
apiKey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 0A198EA60AC7C8B7D4B90C70C3704D4D02110ACB510971D4B8F7A0CE3C0778B5DEDF22877F7A0C184A769952218F5F3FE297D70DD1AD8B6C264E27CA4CDD6B59
Request Body schema: application/json
side
required
string
OrderId
required
integer <int32>
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "side": "ALL",
  • "OrderId": 311112792,
  • "timestamp": 1566218873,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    {
    }
}

Order - Trade History

This endpoint returns recent 1000 trades for a given pair.

Param Name Description Mandatory
apiKey Your API Public Key Yes
pair A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency. Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH. Yes
side order side, matched order where you were a buyer or a seller. Ex. BUY or SELL No
orderId Numeric Order-id e.g 122432324, if you do not know an orderId & wish to pull recent 1000 orders, you can pass orderid=-1. This order-id No
is used as a cursor. when you pass 122432324, you will get 1000 orders matched after 122432324 orderid No
Authorizations:
header Parameters
apiKey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 316B988CD22AB19FB43CC87C9079A0F975065DB42B3CE4BCF06043849E000640793D855F517724902D9927D8A80051E3138E48A482530D8A913146F22F1470E3
Request Body schema: application/json
pair
required
string
SIDE
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "pair": "BTC_ETH",
  • "SIDE": "SELL",
  • "timestamp": 1566218873,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": null,
  • "data":
    [
    ]
}

Order - Cancel an Order

Param Name Description Mandatory
side Order Side. e.g. BUY or SELL YES
orderId Order id of the order to cancel. Mandatory if clientOrderId is not passed. YES
clientOrderId Order id you passed for while placing order. It will be taken into account if orderId is not passed. NO
timestamp Current time in seconds (starting from Jan 1, 1970) YES
recvWindow Time in milliseconds for which HMAC is valid. Default is 10. NO
Authorizations:
header Parameters
apiKey
required
string
Example: 2753ba67-1289-46f3-88b2-313c1bc6a153
HMAC
required
string
Example: 4CD91D6F18C042AB35E8802AF24D74284613B15F91B7C6C8E16B0EA9F403036942FA12E696B10D3752699619870D50725D3D3904C8A585EAA73013FF384F6CC3
Request Body schema: application/json
side
required
string
orderId
required
string
clientOrderId
required
string Nullable
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "side": "BUY",
  • "orderId": "31369533",
  • "clientOrderId": null,
  • "timestamp": 1557918629,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": "Success_General",
  • "data": "Success!"
}

Order - Cancel All Orders

Param Name Description Mandatory
side Order Side. e.g. BUY or SELL YES
pair A pair is specified as MARKET_CURRENCY or quoteCurrency_baseCurrency. Ex. BTC is market/quoteCurrency & ETH is baseCurrency in BTC_ETH. YES
Authorizations:
header Parameters
apiKey
required
string
Example: 846d3c72-761d-41ce-86cb-70204678ec31
HMAC
required
string
Example: D96FA3783969d4CA4039BA40F4CB706D76AA5890E9E6D7448D4D8B2B6CDFA58F0178CD49BD60D599493F5CF7DFBABA40792D8B752EE53BCB97D8E6133FCDE3E55
Request Body schema: application/json
side
required
string
pair
required
string

Responses

Request samples

Content type
application/json
{
  • "side": "SELL",
  • "pair": "TUSD_ETH"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Error",
  • "errorMessage": "HMAC validation failed.",
  • "data": null
}

Deposits List

Fetches a list of all deposits done for a specific wallet by a client

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: BD38EBD758E0E0D1260ACD7205059DFE9785880AAF7AFAE66BC0EB6A6D50E9828390DF60AFD425F65B662D4DBB2E6BCCDA063780F9ECF8ADD177120B41CBEDD6
Request Body schema: application/json
currency
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>
pagesize
required
integer <int32>
pageno
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "currency": "ALL",
  • "timestamp": 1566468127,
  • "recvWindow": 1800,
  • "pagesize": 5,
  • "pageno": 0
}

Response samples

Content type
application/json; charset=utf-8
{}

Withdrawals List

Fetches a list of requested withdrawals by a customer. this endpoint reverts payment address, status and txnhashes with which a paymnet is processed.

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 50F7A9E4186AE07FBDD69528BC65F32074220F4CA12EFB52C743DBCC5C0170A8C3165BAC8CD9BCE87D89A21221E1A11972941D21CA0D15AF470C172624EB017B
Request Body schema: application/json
currency
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>
pagesize
required
integer <int32>
pageno
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "currency": "ALL",
  • "timestamp": 1567347083,
  • "recvWindow": 1800,
  • "pagesize": 5,
  • "pageno": 0
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Error",
  • "errorMessage": "Invalid key",
  • "data": null
}

Generate Deposit Address

Generates a deposit address for any supported coin using this endpoint.

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 07E77617253273CD3236EE5F8EADFABD76BA2FC330425063E9B494E44797D32CAF3E72C0B753C88F2B92D8AF0CEB6AE30C817DE50E0F32E3A6B37E43EFECD0D0
Request Body schema: application/json
currency
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "currency": "ETH",
  • "timestamp": 1566218112,
  • "recvWindow": 100000
}

Response samples

Content type
application/json
{
  • "status": "Error",
  • "errorMessage": "Timestamp for this request is outside of the recvWindow.",
  • "data": null
}

Get User Withdrawal Limits

This api returns user's specific withdrawal limits and also how much he/she had withdrawn.

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: D571E48C68B8E8B174F538EDC609DC7D81B27A3324BE54FC21F084B7255357A108638173C7118BB45D8B36BE2201B2A03C5B5EDDCB71825D040D38D09E5A6638
Request Body schema: application/json
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "timestamp": 1566824164,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": "Success!",
  • "data":
    [
    ]
}

List All Addresses

This endpoint is used to get the address of all currencies generated by the customer till now.

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: D571E48C68B8E8B174F538EDC609DC7D81B27A3324BE54FC21F084B7255357A108638173C7118BB45D8B36BE2201B2A03C5B5EDDCB71825D040D38D09E5A6638
Request Body schema: application/json
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "timestamp": 1566824164,
  • "recvWindow": 10000
}

Response samples

Content type
application/json
{
  • "status": "Success",
  • "errorMessage": "Success!",
  • "data":
    {
    }
}

Withdrawal Request (Step 1)

Endpoint to request a withdraw.

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: 7F03EBFB4FFB820C534057857C59C763EB07789EDE37A8F799DB59012364DEA5516AFA72FE868D349FEBEC4FB00F596A881B2ACE7A7F73B0207F58CB2F4AB4D2
Request Body schema: application/json
currency
required
string
amount
required
number
address
required
string
addressTag
required
string Nullable
gauth_code
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "currency": "ETH",
  • "amount": 0.071,
  • "address": "0xE28CE3A999d6035d042D1a87FAab389Cb0B78Db6",
  • "addressTag": null,
  • "gauth_code": "999888",
  • "timestamp": 1566221501,
  • "recvWindow": 10000
}

Response samples

Content type
application/json
{
  • "status": "Error",
  • "errorMessage": "ChainAlysis_Blacklisted",
  • "data": "AML Risk Assessment Failed for this transaction."
}

Withdrawal Confirmation (Step 2)

Endpoint to pass on the Email Token received from first request to the back-end for withdrawal MFA

Authorizations:
header Parameters
apikey
required
string
Example: 3d8cd5bc-88a3-4360-8dc6-375659fdadc5
HMAC
required
string
Example: C25B556F9E0A55173B637D21E7E494151C321968784B3E924C300D65D7B4765AADB78D390B764F590203E78E93E3FD76943331084CB99AC777F09223B6DA64FF
Request Body schema: application/json
EmailToken
required
string
timestamp
required
integer <int32>
recvWindow
required
integer <int32>

Responses

Request samples

Content type
application/json
{
  • "EmailToken": "0613C07-8BC1-4BB5-BEAA-5FCF6A75BD26",
  • "timestamp": 1566221748,
  • "recvWindow": 10000
}

Response samples

Content type
application/json; charset=utf-8
{
  • "status": "Success",
  • "errorMessage": "Success_General",
  • "data": "Request Approved."
}