HTX is going to launch two new restful APIs for stable coin

Dear API users,

With System Upgrade, Introduce two new Restful APIs to allow user to exchange between HUSD and a stable coin with Offline the previous interfaces.

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

HTX
September 12, 2019

The following are change details:

1. GET v1/stable-coin/quote
API permission: read-only

Request Parameters.

Parameter Data Type Required Description Allowable Values
currency string true Stable coin name USDT/PAX/USDC/TUSD
amount string true amount of stable coin to exchange (the value must be an intger.)  
type string true type of the exchange ‘buy’, ‘sell’

Response Pamameters.

Parameter Data Type Description Note
currency string Stable coin name USDT/PAX/USDC/TUSD
amount string amount of stable coin to exchange Due to factors such as the amount of the exchange account, the amount returned may be smaller than the amount requested.
type string type of the exchange ‘buy’, ‘sell’
exchange-amount string amount of HUSD to exchange in or out()  
quote-id string stable currency quoteID  
expiration string Term of validity  

Error Code.

Error-code Description
invalid-currency  
invalid-amount amount<100,000 or amount>the max
invalid-type type not 'buy' or 'sell'
quote-failure other errors

2. POST v1/stable-coin/exchange
API permission: Trade

Request Parameters.

Parameter Data Type Required Description Allowable Values
quote-id string true stable currency quoteID  

Response Pamameters.

Parameter Data Type Description Note
transact-id long Exchange record id  
currency string Stable coin name USDT/PAX/USDC/TUSD
amount string amount of stable coin to exchange  
type string type of the exchange ‘buy’, ‘sell’
exchange-amount string amount of HUSD to exchange in or out  
time long time stamp  

Error Code.

Error-code Description
invalid-quote-id Paramemter ‘quote-id’ is invalid
insufficient-balance insufficient balance to buy or sell stable coins
insufficient-quota the quota is exceeded
exchange-failure other errors
Base-user-request-exceed-limit Operation is too frequen