Skip to content

Place an order

POST
/api/v1/orders
curl --request POST \
--url https://trongas.ai/api/v1/orders \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "resource": "example", "targetAddress": "example", "volume": 1, "duration": "example" }'

Required API-key scope: trade

Buy energy or bandwidth for an address, paid from your TRX balance.

Requires an Idempotency-Key header: retrying with the same key returns the original order instead of charging twice — always send one, and reuse it on retry.

The order settles asynchronously; it is Created on return and becomes Filled once the provider delivers. Subscribe to the order.filled / order.failed webhooks rather than polling.

402 wallet.insufficient_balance — not enough TRX. 502 — provider failed and your balance was refunded.

Idempotency-Key
string
object
resource
null | string
<= 16 characters
targetAddress
required
string
<= 64 characters
volume
integer | string format: int64
>= 1 <= 9223372036854776000 /^-?(?:0|[1-9]\d*)$/
duration
required
string
<= 16 characters
Examplegenerated
{
"resource": "example",
"targetAddress": "example",
"volume": 1,
"duration": "example"
}

OK

object
id
required
string format: uuid
resource
required
string
targetAddress
required
string
volume
required
integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
duration
required
string
priceTrx
required
string
activationTrx
required
string
totalTrx
required
string
status
required
string
feeSaverOrderId
required
null | integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
txId
required
null | string
createdAt
required
string format: date-time

Payment Required

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string