Skip to content

Latest commit

 

History

History
222 lines (184 loc) · 4.03 KB

API.md

File metadata and controls

222 lines (184 loc) · 4.03 KB

API List

Please familiarize yourself with the meaning of some common parameters before reading the API list:

param description
type Filled with "blockchain" for now
coin_type 60: eth, 195: trx, 9006: bsc, 966: matic, 3: doge
account Contains the suffix .bit in it
key Generally refers to the blockchain address for now

Get Version

Request

  • path: /v1/version
  • param: none

Response

{
  "err_no": 0,
  "err_msg": "",
  "data": {
    "version": ""
  }
}

Usage

curl -X POST localhost/v1/server/info

Get Order Info

Request

  • path: /v1/order/info
  • param:
{
  "business_id": "",
  "order_id": ""
}

Response

{
  "err_no": 0,
  "err_msg": "",
  "data": {
    "order_id": "",
    "payment_address": "",
    "contract_address": "",
    "client_secret": ""
  }
}

Usage

curl -X POST localhsot/v1/order/info -d'{"business_id": "","order_id": ""}'

Get Payment Info

Request

  • path: /v1/order/info
  • param:
{
  "business_id": "",
  "order_id_list": [],
  "pay_hash_list": []
}

Response

{
  "err_no": 0,
  "err_msg": "",
  "data": {
    "payment_list": [
      {
        "order_id": "",
        "pay_hash": "",
        "source_payment": "",
        "pay_address": "",
        "amount": 0.00,
        "algorithm_id": 0,
        "pay_hash_status": 0,
        "refund_hash": "",
        "refund_status": 0,
        "payment_address": "",
        "contract_address": ""
      }
    ]
  }
}

Usage

curl -X POST localhsot/v1/payment/info -d'{"business_id": "","order_id_list": [],"pay_hash_list": []}'

Order Create

Request

  • path: /v1/order/crate
  • param:
{
  "type": "blockchain",
  "key_info": {
    "coin_type": "60",
    "key": "0x111..."
  },
  "business_id": "",
  "amount": 0.00,
  "pay_token_id": "eth_eth",
  "payment_address": "",
  "premium_percentage": 0.00,
  "premium_base": 0.00,
  "premium_amount": 0.00,
  "meta_data": {
  }
}

Response

{
  "err_no": 0,
  "err_msg": "",
  "data": {
    "payment_list": [
      {
        "order_id": "",
        "payment_address": "",
        "contract_address": "",
        "stripe_payment_intent_id": "",
        "client_secret": ""
      }
    ]
  }
}

Usage

curl -X POST localhsot/v1/order/create -d'{"type":"blockchain","key_info":{"coin_type":"60","key":"0x111..."},"business_id":"","amount":0.00,"pay_token_id":"eth_eth","payment_address":"","premium_percentage":0.00,"premium_base":0.00,"premium_amount":0.00,"meta_data":{}}'

Order Refund

Request

  • path: /v1/order/refund
  • param:
{
  "business_id": "",
  "amount": 0.00,
  "refund_list": [
    {
      "order_id": "",
      "pay_hash": ""
    }
  ]
}

Response

{
  "err_no": 0,
  "err_msg": "",
  "data": null
}

Usage

curl -X POST localhsot/v1/order/refund -d'{"business_id":"","amount":0.00,"refund_list":[{"order_id":"","pay_hash":""}]}'

Error

Error Example

{
  "err_no": 20007,
  "err_msg": "account not exist",
  "data": null
}

Error Code

Error code list