Create Order
TIP
This API only creates orders for fast transactions, and the order can be placed successfully with sufficient energy. If you need to post to the free trade market. please tell us.
API Method
POST /v2/order/submit
Request params
Field | Position | Type | Required | Description |
---|---|---|---|---|
resource_type | body | integer | false | Pass 0 for bandwidth, 1 for energy,only 1 is allowed |
receive_address | body | string | true | Resource receiving address |
resource_value | body | integer | true | The number of resources to rent |
rent_duration | body | integer | true | When the time unit is equal to 'd', 1-30, when the time unit is equal to 'h', only 1 and 3 are supported temporarily |
rent_time_unit | body | string | true | Only allowed when d and h are equal to d, rent_ Duration allows 1 to 30, which is equal to h. Currently, only 1 and 3 are allowed |
Request params example
{
"resource_type": 1,
"receive_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"resource_value": 100000,
"rent_duration": 3,
"rent_time_unit": "d"
}
Responses
Field | Type | Required | Description |
---|---|---|---|
code | integer | true | |
msg | string | true | |
request_id | string | true | |
data | BuyOrderDetail | false |
Response example
{
"code": 0,
"msg": "success",
"request_id": "4fb9aac4-573f-4c3a-afc6-94d68270b12c",
"data": {
"order_no": "2304170329503866885309",
"order_type": 0,
"resource_type": 1,
"receive_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"price_in_sun": 130,
"min_amount": 0,
"min_payout": 0,
"min_freeze": 0,
"max_amount": 32779,
"max_payout": 3.195953,
"max_freeze": 1917,
"freeze_time": 1681720304,
"unfreeze_time": 1681723933,
"expire_time": 1681979504,
"create_time": 1681720304,
"resource_value": 32779,
"resource_split_value": 100000,
"frozen_resource_value": 32779,
"rent_duration": 1,
"rent_time_unit": "h",
"rent_expire_time": 1681723904,
"frozen_balance": 1917,
"frozen_tx_id": "f6df4349b954e9d57ebcf0cecb98e072e182e29ad31545a34868316fc155bd06",
"unfreeze_tx_id": "56af796b309b4a044d6bd407b5f34b1d280d3495ad7a2dc0c59eda45b9cdcc46",
"settle_amount": 3.195953,
"settle_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"settle_time": 1681723933,
"pay_time": 1681720303,
"pay_amount": 4.26127,
"refund_amount": 0,
"refund_time": 0,
"is_split": 0,
"status": 9
}
}
Code demo
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();