Block Trade Api
General API Information
Endpoint https://api-otc.trubit.com
All endpoints return either a JSON object or array.
Data is returned in ascending order. Oldest first, newest last.
All time and timestamp related fields are in milliseconds.
HTTP
4XXreturn codes are used for for malformed requests; the issue is on the sender's side.HTTP
429return code is used when breaking a request rate limit.HTTP
418return code is used when an IP has been auto-banned for continuing to send requests after receiving429codes.HTTP
5XXreturn codes are used for internal errors; the issue is on broker's side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.Any endpoint can return an ERROR; the error payload is as follows:
{
"code": -1121,
"msg": "Invalid symbol."
}Specific error codes and messages defined in another document.
For
GETendpoints, parameters must be sent as aquery string.For
POST,PUT, andDELETEendpoints, the parameters may be sent as aquery stringor in therequest bodywith content typeapplication/x-www-form-urlencoded. You may mix parameters between both thequery stringandrequest bodyif you wish to do so.Parameters may be sent in any order.
If a parameter sent in both the
query stringandrequest body, thequery stringparameter will be used.
Endpoint security type
Each endpoint has a security type that determines the how you will interact with it.
API-keys are passed into the Rest API via the
X-BH-APIKEYheader.API-keys and secret-keys are case sensitive.
API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.
By default, API-keys can access all secure routes.
SIGNED (TRADE and USER_DATA) Endpoint security
SIGNEDendpoints require an additional parameter,signature, to be sent in thequery stringorrequest body.Endpoints use
HMAC SHA256signatures. TheHMAC SHA256 signatureis a keyedHMAC SHA256operation. Use yoursecretKeyas the key andtotalParamsas the value for the HMAC operation.The
signatureis not case sensitive.totalParamsis defined as thequery stringconcatenated with therequest body.
SIGNED Endpoint Examples for POST /openapi/v1/order
Here is a step-by-step example of how to send a vaild signed payload from the Linux command line using echo, openssl, and curl.
apiKey
tAQfOrPIZAhym0qHISRt8EFvxPemdBm5j5WMlkm3Ke9aFp0EGWC2CGM8GHV4kCYW
secretKey
lH3ELTNiFxCQTmi9pPcWWikhsjO04Yoqw3euoHUuOLC3GYBW64ZqzQsiOEHXQS76
requestBody
{"id":0}
timestamp
1538323200000
Example 1: As a query string
queryString: symbol=ETHBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1538323200000
requestBodyString: {"id":0}
HMAC SHA256 signature:
curl command:
How to obtain apiKey and secretKey
https://www.trubit.com/new/user/interface
After creating the apiKey and secretKey, you need to set the IP whitelist.



Endpoints
1. Base Data
Get Country List with Symbol Rate
Endpoint:
/openapi/v1/otc/base/symbol_rate/country/listMethod: GET
Request Query Parameters:
hasValid(optional, Integer) - Filters countries by validation status.
Response: JSON containing the list of countries with symbol rates.
Example
Get Self Data List
Endpoint:
/openapi/v1/otc/base/symbol/self/list_dataMethod: GET
Request Query Parameters:
country(string: name of the country)hasValid(number: whether to query only valid data [0: no (default), 1: yes])
Response: JSON containing self data list for symbols.
2. Rate Management
Get User Quote
Endpoint:
/openapi/v1/otc/rate/user_quote/findMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Body:
Response: JSON containing user quote information.
3. Payment Management
Get Payment Config List
Endpoint:
/openapi/v1/otc/payment/listMethod: GET
Request Query Parameters:
country(string: name of the country)
Response: JSON containing the list of payment configurations.
Example Mexico
Add Payment
Endpoint:
/openapi/v1/otc/payment/addMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Body:
Response: JSON containing the result of the add payment operation.
Get My Payment Methods
Endpoint:
/openapi/v1/otc/payment/my/listMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Query Parameters:
mcId(number: id of the merchant)country(optional,string: name of the country)fiat(optional,string: name of the fiat currency)status(optional,enum: status of the payment method [0: all(default), 1: valid, 2: authenticating, 3: authentication failed])currentPage(optional,number: current page number)pageSize(optional,number: number of results per page)
Response: JSON containing the list of user's payment methods.
4. Merchant Management
Get Merchant List
Endpoint:
/openapi/v1/otc/mc/listMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Query Parameters:
merchantName(optional,string: name of the merchant)email(optional,string: email)
Response: JSON containing the list of merchants.
ADD Merchant Info
Endpoint:
/openapi/v1/otc/mc/addMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Parameters:
Add CLABE Merchant Parameters
Add CVU Merchant Parameters
Response: JSON containing the result of the add merchant operation.
Get Merchant Transfer List
Endpoint:
/openapi/v1/otc/mc/tran/listMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Parameters:
startTime(number: optional, timestamp of the start time(millisecond))endTime(number: optional, timestamp of the end time(millisecond))mcSettingsId(number, optional, id of the merchant)type(number, optional, enum: type [0: all(default), 1: deposit, 2: withdraw, 3: Online Refund, 5: Offline Refund])status(number, optional, enum: status [0: all(default), 1: init, 2: completed, 3: canceled])currentPage(number,default 1)pageSize(number,default 10, max 1000)
Response: JSON containing the list of orders.
5. Order Management
Get Order List
Endpoint:
/openapi/v1/otc/order/listMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Parameters:
currentPage(number,default 1)pageSize(number,default 10)isPending(optional, boolean: whether the order is pending [true: pending, false: not pending])
Response: JSON containing the list of orders.
Get Order Detail
Endpoint:
/openapi/v1/otc/order/detailMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Parameters:
orderId(number: id of the order)clientId(string: id of the client)
Response: JSON containing the details of the specified order.
Buy Order Example
Sell Order Example
Finish Order
Endpoint:
/openapi/v1/otc/order/finishMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Body:
Response: JSON containing the result of the order finish.
Add Order
Endpoint:
/openapi/v1/otc/order/addMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Body:
Response: JSON containing the result of the add order operation.
Order Invoice Upload
Endpoint:
/openapi/v1/otc/pic/uploadMethod: POST
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Parameters: order status is [31: support documents pending], Use this interface to upload invoices
orderId(number: id of the order)files(file: Upload multiple file, This parameter does not participate in signature. numbwr max 5. Maxinum upload file size 5MB. format support [jpg,png,jpeg,pdf])
Response: JSON containing the result of the order invoice upload.
6. Deposit Management
Get Deposit Address
Endpoint:
/openapi/v1/otc/depositAddressMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Request Query Parameters:
tokenId(String) - ID of the tokenchainType(optional, String) - Type of the blockchain (default: "")
Response: JSON containing the deposit address.
Example tokenId = USDT ,chainType = ERC20
USDT
ERC20
USDT
TRC20
7. Account Management
Get Account Info
Endpoint:
/openapi/v1/otc/accountMethod: GET
Authorization: Requires signature and account verification
Headers: Requires signature
X-BH-APIKEY(string: API key)
Response: JSON containing account information.
Example
8. Webhooks
Order Notice Info
Method: POST
Authorization: Callback message authentication, The joint commission trubit platform obtains the public key.
Headers: Requires signature
signature(string: To verify that a webhook request is coming from trubit, you can use the signature header. The value of the header is a RSA-SHA256 signature of the request body, Use hexadecimal encoding.)
Request Body:
Response:
Last updated