2.1.25 Purchase Crypto Coin

Path:/openapi/card/buy/coin

Method:POST

Content-Type:application/json

Response Content-Type:application/json

Description:

Use fiat currency to purchase crypto coin

Restriction: Only 1 transaction should be active in a time.

Example Request:

{
  "card_currency": "usd",
  "card_id": "00003454323400000028888",
  "currency_amount": "188",
  "mc_trade_no": "48d2741747a4493223feb22",
  "remark": "Remark"
}

Request Parameter:

Parameter Name Type Required Description
card_currency string false Card currency;Only mandatory for card with dual currency;Maximum 10 characters;e.g:usd,eur
card_id string true Card ID
currency_amount string true Fiat currency amount use to pay the transaction
mc_trade_no string true Transaction no,merchant defined,must be unique for each transaction;Maximum 128 characters
remark string false Transaction remark,use by merchant;Maximum 255 characters

API Response:

Parameter Name Type Description
code string Error code
data object Data object for this respond
card_currency string Card currency
coin string Crypto coin to purchase
coin_amount string Crypto coin amount received
create_time string Transaction creation time in Unix timestamp(second)
currency_amount string Fiat currency amount
exchange_fee string Exchange fee
status integer Transaction status;Eg:0:Pending,1: Success,2:Fail
tx_id string Transaction id, generated by HyperCard,No more than 64 characters
reason string Failure reason
msg string Error message

Example Response:

{
  "code": "00000",
  "data": {
    "card_currency": "usd",
    "coin": "usdt",
    "coin_amount": "188.88",
    "create_time": "1595497477",
    "currency_amount": "188",
    "exchange_fee": "0.88",
    "status": 0,
    "tx_id": "202211231505292302221643837177",
    "reason": ""
  },
  "msg": "ok"
}
Copyright © HyperCard 2023 all right reserved,powered by GitbookUpdate Time: 2024-09-11 10:55:00

results matching ""

    No results matching ""