nrg.market API reference Interactive reference

Billing

Balance, deposits, account ledger

GET /balance

Balance

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Responses

200

OK

Content type application/json.

FieldTypeRequiredDescription
balance_trxTRXrequired
held_trxTRXrequired

Reserved for active orders

available_trxTRXrequired

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

GET /deposit-address

Deposit address

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Your account's permanent address. In v1 it accepts TRX only. Funds are credited after network confirmation — the deposit.credited event. A deposit below 1 TRX is credited without deposit.credited; GET /balance and GET /ledger show it like any other.

Do not send USDT here. The balance is kept in TRX, and USDT (TRC-20) sent to this address is not credited automatically — it reaches the operator as an unidentified deposit and is credited manually, which takes time. USDT deposits with automatic conversion will come later.

Responses

200

OK

Content type application/json.

FieldTypeRequiredDescription
addressTronAddressrequired
acceptsarray of stringrequired

Currencies accepted for automatic crediting. In v1 — TRX only.

Example: ["TRX"].

confirmations_requiredintegerrequired

Example: 3.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

GET /ledger

Account ledger

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Balance movements, newest first.

Amounts are always positive. Direction comes from type, not from the sign: deposit, hold_release, refund, adjustment_credit add funds; hold, charge, adjustment_debit subtract.

balance_after_trx is the full balance after the operation. It does not change on hold and hold_release rows: a hold does not spend money, it reserves it, affecting available_trx rather than balance_trx (see GET /balance).

An order can leave more than one hold. The first is placed at creation for quoted_total_trx; each raise of a position at fulfillment adds one more for the difference, with the same order_id (see "Order price" in the introduction). A volume raise taken back before the order settles is a hold_release for the difference. When the order settles, its charge and hold_release rows together add up to all of its hold rows.

Parameters

NameInRequiredTypeDescription
typequeryoptionalstring

One of: deposit, hold, hold_release, charge, refund, adjustment_credit, adjustment_debit.

cursorqueryoptionalstring
limitqueryoptionalinteger

Default: 50. Minimum: 1. Maximum: 200.

Responses

200

OK

Content type application/json.

FieldTypeRequiredDescription
dataarray of LedgerRowrequired
next_cursorstring or nullrequired

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

GET /topup-requests

List top-up requests

Authentication: Required — an API key in Authorization: Bearer … (authentication).

What we have asked you to send, and how each ask ended. A request is created by us, never by a call: when an order is refused for lack of balance (402), or when the available balance falls under your balance_low threshold. Both only happen while auto_topup.enabled is on in GET /settings; with it off nothing here is ever written.

At most one request is open at a time. A second need raises the one already open — same id — and re-sends topup.requested; it does not add a second row. "Raises" is not only about money: the reason can escalate from balance_low to order_insufficient_balance with amount_trx unchanged, and expires_at moves on every re-send. Do not deduplicate on (topup_request_id, amount_trx).

Not to be confused with maintenance.topup (§10): that is energy delivered to a wallet under an auto-refill rule. Here it is TRX for your prepaid balance. Money actually credited is deposit.credited, as always — for a deposit of 1 TRX or more. A smaller one is credited without deposit.credited, and if it is the one that completes a request, topup.fulfilled still arrives naming its txid (see WebhookEvent).

Parameters

NameInRequiredTypeDescription
statusqueryoptionalTopupRequestStatus
cursorqueryoptionalstring
limitqueryoptionalinteger

Default: 50. Minimum: 1. Maximum: 200.

Responses

200

OK

Content type application/json.

FieldTypeRequiredDescription
dataarray of TopupRequestrequired
next_cursorstring or nullrequired

400

Malformed request

Content type application/json.

Schema: Error.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

GET /topup-requests/{topup_request_id}

Get a top-up request

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Parameters

NameInRequiredTypeDescription
topup_request_idpathrequiredstring

Responses

200

OK

Content type application/json.

Schema: TopupRequest.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

404

Not found

Content type application/json.

Schema: Error.

POST /topup-requests/{topup_request_id}/cancel

Cancel a top-up request

Authentication: Required — an API key in Authorization: Bearer … (authentication).

Withdraw a request you do not intend to pay. Only an open one can be cancelled; anything else answers 409 topup_request_not_cancelable.

This refuses nothing but the request. TRX sent to the deposit address is credited whenever it arrives, cancelled request or not. What the cancellation frees is the room the amount took in your daily auto_topup.max_per_day_trx cap, and the slot for a new request.

Parameters

NameInRequiredTypeDescription
topup_request_idpathrequiredstring

Responses

200

Cancelled

Content type application/json.

Schema: TopupRequest.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

404

Not found

Content type application/json.

Schema: Error.

409

The request is not open any more — it was fulfilled, it expired, or it has already been cancelled (topup_request_not_cancelable).

Content type application/json.

Schema: Error.