下单

说明

此接口仅创建快捷交易的订单,能量充足即可下单成功,如果有其他需要可到平台自由交易市场下单。如果您有自由交易市场下单的需求。请告诉我们。

接口地址

POST /v2/order/submit

请求参数

名称位置类型必选说明
resource_typebodyintegerfalse0 带宽,1 能量,暂时只支持能量
receive_addressbodystringtrue资源接收地址
resource_valuebodyintegertrue租用资源数量
rent_durationbodyintegertrue租用时长,当时间单位等于 h,暂时只支持 1 和 3,当时间单位等于 m,暂时只支持 10
rent_time_unitbodystringtrue租用时间单位,仅支持 d 天、h 小时、m 分钟
rent_time_secondbodyintegertrue租用时长(秒),必须是大于600且为3的倍数,也可请求 查询 APIKEY 详情 接口获取允许的时长,该参数不为空且有效会忽略rent_durationrent_time_unit参数,如为0则使用rent_durationrent_time_unit设置订单时长

参数示例

{
    "resource_type": 1,
    "receive_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "resource_value": 100000,
    "rent_duration": 1,
    "rent_time_unit": "h",
    "rent_time_second": 600
}

接口返回

名称类型必选说明
codeintegertrue
msgstringtrue
request_idstringtrue
dataBuyOrderDetailfalse

返回示例

{
    "code": 0,
    "msg": "成功",
    "request_id": "4fb9aac4-573f-4c3a-afc6-94d68270b12c",
    "data": {
        "order_no": "2409254945397237760100",
        "order_type": 0,
        "resource_type": 1,
        "receive_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
        "price_in_sun": 120,
        "freeze_time": 0,
        "create_time": 1727254190,
        "resource_value": 32000,
        "frozen_resource_value": 0,
        "rent_duration": 1,
        "rent_time_unit": "d",
        "rent_time_second": 86400,
        "rent_expire_time": 0,
        "frozen_tx_id": "",
        "pay_time": 1727254190,
        "pay_amount": 4.4,
        "refund_amount": 0,
        "refund_time": 0,
        "is_split": 0,
        "is_lock": 1,
        "lock_period": 28800,
        "status": 4,
        "business_status": 1
    }
}

代码示例

curl --location --request POST 'https://feee.io/open/v2/order/submit' \
--header 'key: <key>' \
--header 'User-Agent: Feee.io Client/1.0.0 (https://feee.io)' \
--header 'Content-Type: application/json' \
--data-raw '<body data here>'
package main

import (
   "fmt"
   "strings"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://feee.io/open/v2/order/submit"
   method := "POST"

   payload := strings.NewReader(`<body data here>`)

   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, payload)

   if err != nil {
      fmt.Println(err)
      return
   }
   req.Header.Add("key", "<key>")
   req.Header.Add("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)")
   req.Header.Add("Content-Type", "application/json")

   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://feee.io/open/v2/order/submit',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'POST',
   CURLOPT_POSTFIELDS =>'<body data here>',
   CURLOPT_HTTPHEADER => array(
      'key: <key>',
      'User-Agent: Feee.io Client/1.0.0 (https://feee.io)',
      'Content-Type: application/json'
   ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

import http.client
import json

conn = http.client.HTTPSConnection("feee.io")
payload = "<body data here>"
headers = {
   'key': '<key>',
   'User-Agent': 'Feee.io Client/1.0.0 (https://feee.io)',
   'Content-Type': 'application/json'
}
conn.request("POST", "/open/v2/order/submit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "<body data here>");
Request request = new Request.Builder()
   .url("https://feee.io/open/v2/order/submit")
   .method("POST", body)
   .addHeader("key", "<key>")
   .addHeader("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)")
   .addHeader("Content-Type", "application/json")
   .build();
Response response = client.newCall(request).execute();
上次更新: