Creating a multiple order

API method
HTTP
POST https://api.tronmart.net/v1/Order/CreateMultiple

Request parameters
FieldTypeDescription
resource_typeinteger0 … bandwidth
1 … energy
only 1 is allowed now
rent_durationinteger1 – 23 for 'h'
1 – 30 for 'd'
1200 - etc. for 'T' (20 tron time units equals 1 minute)
rent_time_unitchar'h' … hour
'd' … day
'T' … tron time unit
receiversarrayRecipients to receive resources
   {
      receive_addressstringResource receiving address
      resource_valueintegerThe number of resources to rent
   }

Example of request parameters
JSON
{
    "resource_type": 1,
    "rent_duration": 1,
    "rent_time_unit": "h",
    "receivers": [
        {
            "receive_address": "HCjRQtYH..................KHUarM3w",
            "resource_value": 32000
        },
        {
            "receive_address": "QF7eE1Jt..................HY4g77eS",
            "resource_value": 90000
        },
        {
            "receive_address": "7Ujw8a4P..................T47h7Er2",
            "resource_value": 120000
        }
    ]
}

Response parameters
FieldTypeDescription
codestringThe return code of the request call, the list of error codes is here
msgstringDetailed information about a possible error
errorsarrayDetailed information on errors
request_idstringAn internal request identifier that is used to identify the request in case of problems
datajsonOrder details, details is here

Example of response parameters
JSON
{
    "code": "Success",
    "msg": "Success",
    "errors": [],
    "request_id": "18ff17a5-28b1-4046-afd5-5956b676b4b8",
    "data": {
        "order_no": "5bb98a44-fa53-4dd1-9114-9892829fe566",
        "resource_type": 1,
        "receivers": [
            {
                "receive_address": "HCjRQtYH..................KHUarM3w",
                "resource_value": 32000,
                "price_in_sun": 95,
                "fixed_tax": 0.560000,
                "price": 3.600000
            },
            {
                "receive_address": "QF7eE1Jt..................HY4g77eS",
                "resource_value": 90000,
                "price_in_sun": 95,
                "fixed_tax": 0.000000,
                "price": 8.550000
            },
            {
                "receive_address": "7Ujw8a4P..................T47h7Er2",
                "resource_value": 120000,
                "price_in_sun": 95,
                "fixed_tax": 0.000000,
                "price": 11.400000
            }
        ],
        "create_time": 1715768567928,
        "expire_time": 1715854967928,
        "settle_address": "YEg7yUff..................72j78oH4",
        "resource_value": 242000,
        "resource_split_value": 0,
        "rent_duration": 1200,
        "rent_time_unit": "T",
        "frozen_balance": null,
        "payment_address": "TThsE7hE..................r1dEF4zH",
        "pay_amount": 23.550000,
        "pay_time": null,
        "refund_tx_id": null,
        "refund_time": 0,
        "refund_amount": 0,
        "refund_status": null,
        "status": "New",
        "sub_order": null
    }
}

Example of a call
HTTP
POST /v1/Order/CreateMultiple HTTP/1.1
Host: api.tronmart.net
key: C2CC6C80-B86A-4E08-AE69-E28DA009A50F
Content-Type: application/json
Content-Length: 499

{
    "resource_type": 1,
    "rent_duration": 1,
    "rent_time_unit": "h",
    "receivers": [
        {
            "receive_address": "HCjRQtYH..................KHUarM3w",
            "resource_value": 32000
        },
        {
            "receive_address": "QF7eE1Jt..................HY4g77eS",
            "resource_value": 90000
        },
        {
            "receive_address": "7Ujw8a4P..................T47h7Er2",
            "resource_value": 120000
        }
    ]
}
cURL
curl -X POST 'https://api.tronmart.net/v1/Order/CreateMultiple' 
     -H 'key: C2CC6C80-B86A-4E08-AE69-E28DA009A50F' 
     -H 'Content-Type: application/json' 
     -d '{
            "resource_type": 1,
            "rent_duration": 1,
            "rent_time_unit": "h",
            "receivers": [
              {
                 "receive_address": "HCjRQtYH..................KHUarM3w",
                 "resource_value": 32000
              },
              {
                 "receive_address": "QF7eE1Jt..................HY4g77eS",
                 "resource_value": 90000
              },
              {
                 "receive_address": "7Ujw8a4P..................T47h7Er2",
                 "resource_value": 120000
              }
            ]
         }'
C# (HttpClient)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.tronmart.net/v1/Order/CreateMultiple");
request.Headers.Add("key", "C2CC6C80-B86A-4E08-AE69-E28DA009A50F");
var content = new StringContent("{\r\n    \"resource_type\": 1,\r\n    \"rent_duration\": 1,\r\n    \"rent_time_unit\": \"h\",\r\n    \"receivers\": [\r\n        {\r\n            \"receive_address\": \"HCjRQtYH..................KHUarM3w\",\r\n            \"resource_value\": 32000\r\n        },\r\n        {\r\n            \"receive_address\": \"QF7eE1Jt..................HY4g77eS\",\r\n            \"resource_value\": 90000\r\n        },\r\n        {\r\n            \"receive_address\": \"7Ujw8a4P..................T47h7Er2\",\r\n            \"resource_value\": 120000\r\n        }\r\n    ]\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Java (OkHttp)
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"resource_type\": 1,\r\n    \"rent_duration\": 1,\r\n    \"rent_time_unit\": \"h\",\r\n    \"receivers\": [\r\n        {\r\n            \"receive_address\": \"HCjRQtYH..................KHUarM3w\",\r\n            \"resource_value\": 32000\r\n        },\r\n        {\r\n            \"receive_address\": \"QF7eE1Jt..................HY4g77eS\",\r\n            \"resource_value\": 90000\r\n        },\r\n        {\r\n            \"receive_address\": \"7Ujw8a4P..................T47h7Er2\",\r\n            \"resource_value\": 120000\r\n        }\r\n    ]\r\n}");
Request request = new Request.Builder()
  .url("https://api.tronmart.net/v1/Order/CreateMultiple")
  .method("POST", body)
  .addHeader("key", "C2CC6C80-B86A-4E08-AE69-E28DA009A50F")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
Go (native)
package main

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

func main() {

  url := "https://api.tronmart.net/v1/Order/CreateMultiple"
  method := "POST"

  payload := strings.NewReader(`{`+"
"+`
    "resource_type": 1,`+"
"+`
    "rent_duration": 1,`+"
"+`
    "rent_time_unit": "h",`+"
"+`
    "receivers": [`+"
"+`
        {`+"
"+`
            "receive_address": "HCjRQtYH..................KHUarM3w",`+"
"+`
            "resource_value": 32000`+"
"+`
        },`+"
"+`
        {`+"
"+`
            "receive_address": "QF7eE1Jt..................HY4g77eS",`+"
"+`
            "resource_value": 90000`+"
"+`
        },`+"
"+`
        {`+"
"+`
            "receive_address": "7Ujw8a4P..................T47h7Er2",`+"
"+`
            "resource_value": 120000`+"
"+`
        }`+"
"+`
    ]`+"
"+`
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("key", "C2CC6C80-B86A-4E08-AE69-E28DA009A50F")
  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))
}