能量租用Api接口
1、下单接口 POST:https://e.foxupay.com/api/external/pay
请求数据
{
"username": "energy@163.com", //账户
"password": "aaaaaaa", //密码
"address": "TQECdSusKMTBLpvTKsgueURrvGeHo85RzV", //能量接收地址
"amount": 32000, //能量数量,整数,
"time": "1h" //租用时长 h代表小时,d代表天数, 仅支持1h、1d、3d及更多天数时间
}
返回数据:code=200是成功,其他为失败
{
"msg": "支付成功,正在安排...",
"trace_id": "e71f2069921c447f8e575fdf1e0f9b75",
"code": 200,
"data": {
"orderNo": "1801152914933288960" //订单状态 通过订单号去查询
}
}
2、状态查询接口 GET:https://e.foxupay.com/api/external/query?orderNo=
{
"msg": "操作成功",
"trace_id": "d651915fe04d40a39bf0240653a2ab21",
"code": 200,
"data": {
"amount": 32000, //租用能量数
"orderNo": "1801152914933288960", //订单编号
"address": "TQECdSusKMTBLpvTKsgueURrvGeHo85RzV", //租用地址
"price": 49.85, //单价,SUN
"time": "1h", //租用时长
"trx": 1.6, //付款金额,trx
"hash": "39fe43614e37942a0f9fe887b9c013f4fa2bca2ae8ef0b6276e2760e09b6c79b", //租用Hash
"status": 2 //租用状态 1未租用 2租用中 3租用成功 4租用失败
}
}
3、配置查询接口 GET:https://e.foxupay.com/api/external/config?username=
{
"msg": "操作成功",
"trace_id": "84bc76feba8c41388af47b72179ec79d",
"code": 200,
"data": {
"min": 32000, //下单最小数量
"max": 32876768, //当前剩余能量额度
"canPay": true, //是否可以下单
"h1": 49.852, //1小时单价,SUN
"h24": 132, //1天单价,SUN
"h72": 99, //3天单价,SUN
"other": 99 //其他单价,SUN
}
}
4、余额查询接口 GET:https://e.foxupay.com/api/external/balance?username=
{
"msg": "操作成功",
"trace_id": "26c9d2131a304177aba8b37fb5711d5a",
"code": 200,
"data": {
"balance": "1.804072"
}
}