Docs menu

Batches — API reference

One request, many receivers.

MethodPathSummary
GET/v1/batchesList batches
POST/v1/batchesOrder for many receivers in one call
GET/v1/batches/{batchId}Batch progress
POST/v1/batches/{batchId}/cancelCancel the not-yet-started part of a batch

Generated from openapi.yaml at build time. Base URL https://api.tenergy.me/v1, or https://api-nile.tenergy.me/v1 on Nile (Environments). Every request below is signed as in Authentication unless its Auth line says otherwise.

List batches

GET /v1/batches · listBatches

Auth: API key (HMAC).

Parameters

NameInTypeRequiredDescription
limitqueryinteger
cursorquerystringOpaque cursor from a previous response’s next_cursor.

Responses

StatusMeaning
200OK
401Missing, malformed or rejected credentials.
429Too many requests.
500Something broke on our side.

Response fields

FieldTypeRequiredDescription
dataarray of object (Batch)yes
data[].idstringyes
data[].client_batch_idstring | null
data[].statusenum: queued, processing, completed, partial, failed, cancelledyesThe batch’s own state, derived from its items. partial means some receivers succeeded and some did not — inspect items, never assume all-or-nothing.
data[].items_acceptedintegeryes
data[].summaryobjectyesCounts by item status. Cheaper to poll than the full item list.
data[].summary.totalinteger
data[].summary.queuedinteger
data[].summary.processinginteger
data[].summary.completedinteger
data[].summary.partialinteger
data[].summary.failedinteger
data[].summary.insufficient_fundsinteger
data[].summary.cancelledinteger
data[].itemsarray of object (BatchItem)yes
data[].items[].receiverstringyesBase58Check TRON address (starts with T, 34 characters).
data[].items[].tracking_idstringyes<client_batch_id>:<receiver> — the identity of one receiver in one batch.
data[].items[].statusenum: queued, processing, completed, partial, failed, insufficient_funds, cancelledyes
data[].items[].resourceenum: energy, bandwidth, activationenergy — TRON energy, the resource a TRC-20 transfer consumes. · bandwidth — TRON bandwidth (net), consumed by transaction size. · activation — one-off account activation; amount and tier do not apply.
data[].items[].amountinteger
data[].items[].tierenum: 5m, 15m, 1h, 1d, 3d, 30dRental period. The API sells 5m and 1h; 1d exists but is switched off. 15m, 3d and 30d are retired and never sold — they stay in the enum only so old orders parse. Check available on each GET /v1/prices row; a tier that is not available is rejected with 2003 tier_unavailable.
data[].items[].delivered_amountintegerHow much was actually delegated. Below amount when status is partial.
data[].items[].order_idsarray of stringThe orders created for this receiver — more than one when a large amount was chunked. These are ordinary orders: inspect and reclaim them individually.
data[].items[].delegate_hashesarray of string
data[].items[].charged_amount_suninteger (int64)An amount in SUN (1 TRX = 1 000 000 SUN). Always an integer.
data[].items[].activationobject
data[].items[].bandwidthobject
data[].items[].attemptsinteger
data[].items[].started_atstring (date-time) | null
data[].items[].finished_atstring (date-time) | null
data[].items[].failurenull | object
data[].created_atstring (date-time)yes
data[].finished_atstring (date-time) | null
next_cursorstring | nullyes

Order for many receivers in one call

POST /v1/batches · createBatch

Auth: API key (HMAC).

Up to 100 receivers per request. For each receiver the platform runs the whole sequence — activate the address if it is not active, top up its bandwidth if it is short, then deliver the resource, splitting large amounts into chunks automatically.

The response is 202 Accepted: the batch is queued, nothing is charged yet, and nothing has been delivered. Read the result from GET /v1/batches/{id} or from the per-order webhooks.

One receiver failing never affects the others, and a failed activation or bandwidth step does not stop the resource order for that receiver.

Receivers are billed individually, at the price in force when each one is executed — so a long batch may span a pricing period boundary. Pass max_price_sun per item to cap that.

Each receiver produces its own order with its own id, which is what you reclaim, inspect and reconcile against. client_batch_id is the idempotency key for the batch as a whole: a repeat with the same id and the same body returns the original batch; the same id with a different body is rejected with 3010 idempotency_conflict.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringClient-chosen key making this mutating request safe to retry, 8–128 characters of A-Z a-z 0-9 . _ : -. A repeat with the same key and the same body returns the original result; the same key with a different body is rejected with 3010 idempotency_conflict. Records live for 24 hours.

Request body

JSON (BatchRequest), required.

FieldTypeRequiredDescription
client_batch_idstringYour reference for the batch and its idempotency key. Required unless you send the Idempotency-Key header; with neither the request is rejected with 2005 idempotency_key_required.
defaultsobject (BatchItemOptions)Applied to every item that does not override the field itself.
defaults.resourceenum: energy, bandwidth, activationenergy — TRON energy, the resource a TRC-20 transfer consumes. · bandwidth — TRON bandwidth (net), consumed by transaction size. · activation — one-off account activation; amount and tier do not apply.
defaults.amountinteger
defaults.tierenum: 5m, 15m, 1h, 1d, 3d, 30dRental period. The API sells 5m and 1h; 1d exists but is switched off. 15m, 3d and 30d are retired and never sold — they stay in the enum only so old orders parse. Check available on each GET /v1/prices row; a tier that is not available is rejected with 2003 tier_unavailable.
defaults.activateboolean
defaults.bandwidthbooleanTop the receiver’s bandwidth up when it is short, before delivering energy.
defaults.bandwidth_amountintegerBandwidth units to add when the top-up runs.
defaults.max_price_suninteger (int64)An amount in SUN (1 TRX = 1 000 000 SUN). Always an integer.
defaults.client_order_id_prefixstringWhen set, each generated order gets client_order_id = "<prefix>-<receiver>", so your side can reconcile without keeping our ids.
itemsarray of objectyesDuplicate receivers within one batch are rejected with 2006 duplicate_receiver.
items[].receiverstringyesBase58Check TRON address (starts with T, 34 characters).
items[].resourceenum: energy, bandwidth, activationenergy — TRON energy, the resource a TRC-20 transfer consumes. · bandwidth — TRON bandwidth (net), consumed by transaction size. · activation — one-off account activation; amount and tier do not apply.
items[].amountinteger
items[].tierenum: 5m, 15m, 1h, 1d, 3d, 30dRental period. The API sells 5m and 1h; 1d exists but is switched off. 15m, 3d and 30d are retired and never sold — they stay in the enum only so old orders parse. Check available on each GET /v1/prices row; a tier that is not available is rejected with 2003 tier_unavailable.
items[].activateboolean
items[].bandwidthbooleanTop the receiver’s bandwidth up when it is short, before delivering energy.
items[].bandwidth_amountintegerBandwidth units to add when the top-up runs.
items[].max_price_suninteger (int64)An amount in SUN (1 TRX = 1 000 000 SUN). Always an integer.
items[].client_order_id_prefixstringWhen set, each generated order gets client_order_id = "<prefix>-<receiver>", so your side can reconcile without keeping our ids.

Example request body, from the contract (illustrative values):

json
{
  "client_batch_id": "acme-payout-2026-09-11-01",
  "defaults": {
    "resource": "energy",
    "tier": "1h",
    "amount": 65000,
    "activate": true,
    "bandwidth": true,
    "bandwidth_amount": 400
  },
  "items": [
    {"receiver":"TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"},
    {"receiver":"TXXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","amount":131000},
    {"receiver":"TYYyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy","bandwidth":false}
  ]
}

Responses

StatusMeaning
200Same client_batch_id and same body — the original batch is returned.
202Batch accepted and queued. Nothing charged yet.
400Malformed request — bad JSON, unknown field, wrong type.
401Missing, malformed or rejected credentials.
402Not enough balance to cover the order.
409The request contradicts the current state of the object.
422Syntactically valid but semantically impossible.
429Too many requests.
500Something broke on our side.
503Temporarily unable to serve. On order creation this is fail-secure: nothing was stored and nothing was charged, so retrying verbatim with the same client_order_id is safe.

Response fields (Batch)

FieldTypeRequiredDescription
idstringyes
client_batch_idstring | null
statusenum: queued, processing, completed, partial, failed, cancelledyesThe batch’s own state, derived from its items. partial means some receivers succeeded and some did not — inspect items, never assume all-or-nothing.
items_acceptedintegeryes
summaryobjectyesCounts by item status. Cheaper to poll than the full item list.
summary.totalinteger
summary.queuedinteger
summary.processinginteger
summary.completedinteger
summary.partialinteger
summary.failedinteger
summary.insufficient_fundsinteger
summary.cancelledinteger
itemsarray of object (BatchItem)yes
items[].receiverstringyesBase58Check TRON address (starts with T, 34 characters).
items[].tracking_idstringyes<client_batch_id>:<receiver> — the identity of one receiver in one batch.
items[].statusenum: queued, processing, completed, partial, failed, insufficient_funds, cancelledyes
items[].resourceenum: energy, bandwidth, activationenergy — TRON energy, the resource a TRC-20 transfer consumes. · bandwidth — TRON bandwidth (net), consumed by transaction size. · activation — one-off account activation; amount and tier do not apply.
items[].amountinteger
items[].tierenum: 5m, 15m, 1h, 1d, 3d, 30dRental period. The API sells 5m and 1h; 1d exists but is switched off. 15m, 3d and 30d are retired and never sold — they stay in the enum only so old orders parse. Check available on each GET /v1/prices row; a tier that is not available is rejected with 2003 tier_unavailable.
items[].delivered_amountintegerHow much was actually delegated. Below amount when status is partial.
items[].order_idsarray of stringThe orders created for this receiver — more than one when a large amount was chunked. These are ordinary orders: inspect and reclaim them individually.
items[].delegate_hashesarray of string
items[].charged_amount_suninteger (int64)An amount in SUN (1 TRX = 1 000 000 SUN). Always an integer.
items[].activationobject
items[].activation.statusenum: planned, not_needed, done, failed, skipped
items[].activation.hashstring | null
items[].bandwidthobject
items[].bandwidth.statusenum: planned, enough, done, failed, skipped
items[].bandwidth.order_idstring | null
items[].bandwidth.skip_reasonenum: option_off, amount_large | nullWhy the bandwidth step did not run. option_off — you disabled it; amount_large — a large energy order does not need a bandwidth top-up.
items[].attemptsinteger
items[].started_atstring (date-time) | null
items[].finished_atstring (date-time) | null
items[].failurenull | object
items[].failure.codeinteger
items[].failure.slugstring
items[].failure.messagestring
created_atstring (date-time)yes
finished_atstring (date-time) | null

Batch progress

GET /v1/batches/{batchId} · getBatch

Auth: API key (HMAC).

Parameters

NameInTypeRequiredDescription
batchIdpathstringyesPlatform id (bat_…) or cid:<client_batch_id>.
receiverquerystringReturn only the item for this address instead of the whole batch.

Responses

StatusMeaning
200OK
401Missing, malformed or rejected credentials.
404No such object, or it belongs to another account. The two are not distinguished.
429Too many requests.
500Something broke on our side.

Response fields (Batch)

FieldTypeRequiredDescription
idstringyes
client_batch_idstring | null
statusenum: queued, processing, completed, partial, failed, cancelledyesThe batch’s own state, derived from its items. partial means some receivers succeeded and some did not — inspect items, never assume all-or-nothing.
items_acceptedintegeryes
summaryobjectyesCounts by item status. Cheaper to poll than the full item list.
summary.totalinteger
summary.queuedinteger
summary.processinginteger
summary.completedinteger
summary.partialinteger
summary.failedinteger
summary.insufficient_fundsinteger
summary.cancelledinteger
itemsarray of object (BatchItem)yes
items[].receiverstringyesBase58Check TRON address (starts with T, 34 characters).
items[].tracking_idstringyes<client_batch_id>:<receiver> — the identity of one receiver in one batch.
items[].statusenum: queued, processing, completed, partial, failed, insufficient_funds, cancelledyes
items[].resourceenum: energy, bandwidth, activationenergy — TRON energy, the resource a TRC-20 transfer consumes. · bandwidth — TRON bandwidth (net), consumed by transaction size. · activation — one-off account activation; amount and tier do not apply.
items[].amountinteger
items[].tierenum: 5m, 15m, 1h, 1d, 3d, 30dRental period. The API sells 5m and 1h; 1d exists but is switched off. 15m, 3d and 30d are retired and never sold — they stay in the enum only so old orders parse. Check available on each GET /v1/prices row; a tier that is not available is rejected with 2003 tier_unavailable.
items[].delivered_amountintegerHow much was actually delegated. Below amount when status is partial.
items[].order_idsarray of stringThe orders created for this receiver — more than one when a large amount was chunked. These are ordinary orders: inspect and reclaim them individually.
items[].delegate_hashesarray of string
items[].charged_amount_suninteger (int64)An amount in SUN (1 TRX = 1 000 000 SUN). Always an integer.
items[].activationobject
items[].activation.statusenum: planned, not_needed, done, failed, skipped
items[].activation.hashstring | null
items[].bandwidthobject
items[].bandwidth.statusenum: planned, enough, done, failed, skipped
items[].bandwidth.order_idstring | null
items[].bandwidth.skip_reasonenum: option_off, amount_large | nullWhy the bandwidth step did not run. option_off — you disabled it; amount_large — a large energy order does not need a bandwidth top-up.
items[].attemptsinteger
items[].started_atstring (date-time) | null
items[].finished_atstring (date-time) | null
items[].failurenull | object
items[].failure.codeinteger
items[].failure.slugstring
items[].failure.messagestring
created_atstring (date-time)yes
finished_atstring (date-time) | null

Cancel the not-yet-started part of a batch

POST /v1/batches/{batchId}/cancel · cancelBatch

Auth: API key (HMAC).

Removes from the queue every receiver that has not been picked up yet. Receivers already being processed are not interrupted — part of their resource may already be paid for. Cancel is best-effort on the remainder.

Parameters

NameInTypeRequiredDescription
batchIdpathstringyes

Responses

StatusMeaning
200OK
401Missing, malformed or rejected credentials.
404No such object, or it belongs to another account. The two are not distinguished.
429Too many requests.
500Something broke on our side.

Response fields

FieldTypeRequiredDescription
idstringyes
cancelledintegeryesHow many receivers were removed from the queue.

    ↑ ↓ to move · Enter to open · Esc to close