nrg.market API reference Interactive reference

Sandbox

Endpoints that exist only on https://sandbox.nrg.market. On production the same path is a 404.

POST /sandbox/deposit

Credit test TRX (sandbox only)

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

Puts test money on your sandbox balance, with no chain to wait for.

The amount is credited down the same path the deposit watcher uses in production, so what you get is an ordinary deposit and not a special case: a deposit entry in GET /ledger carrying a txid of the form sandbox-<uuid>, the balance moved by that amount, and a real deposit.credited delivery to every endpoint subscribed to it. If your integration reacts to being funded, this is the call that exercises the reaction. As in production, an amount below 1 TRX is credited without deposit.credited — which is how to rehearse the silence too.

A new account does not need it to start: activating a sandbox account — confirming the e-mail, or the first Google sign-in — grants 10,000 TRX, which arrives as an adjustment_credit.

Two limits: 100,000 TRX in one call and ten calls per client per UTC day. An amount above the cap is refused the same way a malformed one is — 400 invalid_request, with the field named in details.errors. The eleventh call of the day is 429 rate_limited with Retry-After. That allowance is counted per day and separately from the per-minute buckets in "Rate limits", and the RateLimit-* headers on this endpoint describe it: a limit of 10 and a reset at the UTC day boundary, not a minute's worth of anything.

On production this path does not exist. A POST to https://api.nrg.market/v1/sandbox/deposit answers 404 not_found like any unknown path: it is absent there rather than disabled, and no key of any kind opens it.

Request body

Required.

Content type application/json.

FieldTypeRequiredDescription
amount_trxTRXrequired

How much test TRX to credit — the same string with six decimal places as every other amount in this API. Greater than zero and no more than 100000.000000.

Example: A thousand test TRX
{
  "amount_trx": "1000.000000"
}

Responses

201

Credited. The body is the ledger entry this call wrote, and it is the same schema GET /ledger returns its rows in — literally the same LedgerRow, so one parser reads both and rehearsing here exercises the type your code will meet in production.

Three things are always true of a row from this endpoint, and they are said here rather than narrowed in the schema — a narrower schema would be a second shape, which is the divergence this wording exists to prevent:

  • type is deposit. The endpoint credits a deposit and nothing else, though the field can carry any of the seven ledger types.
  • order_id is null. A deposit belongs to no order.
  • txid matches sandbox-<uuid> — sandbox- followed by a dashed UUID. Shaped so a test deposit is recognizable at a glance and can never be mistaken for a mainnet txid: nothing on chain looks like this. Do not parse it as one.

Content type application/json.

Schema: LedgerRow.

Example: credited
{
  "id": "418223",
  "type": "deposit",
  "amount_trx": "1000.000000",
  "balance_after_trx": "11000.000000",
  "order_id": null,
  "txid": "sandbox-5f2c8a1d-7e64-4b93-9a10-c3d7e5b28f41",
  "created_at": "2026-08-31T09:14:07Z"
}

400

Malformed request

Content type application/json.

Schema: Error.

401

Invalid key or IP not allowed

Content type application/json.

Schema: Error.

404

You are on production, where this path does not exist. The envelope and the code are the ordinary ones for an unknown path (not_found); the sandbox is at https://sandbox.nrg.market/v1.

Content type application/json.

Schema: Error.

429

Rate limit exceeded (rate_limited), or too many failed authorizations from this credential (too_many_auth_failures). Both are 429 and both carry Retry-After; they differ in what you should do about it, which is why they differ in code and not only in message. rate_limited also carries the RateLimit-* state of the bucket it came from; too_many_auth_failures does not, because the counter behind it is not a bucket. See "Rate limits" and "Repeated authorization failures" above.

On POST /orders a rate_limited may also carry details.reason = bulk_volume_cap: not requests per minute but energy per window — a mode c order whose volumes would take your account past the bulk allowance. details carries cap_units (the allowance), spent_units (your volume already inside the window), requested_units (what this order asked for) and window_s (the width of the window, 3600). Retry-After is the first instant at which this body can be accepted: enough of your counted volume has to leave the window to make room for requested_units, which is not in general the moment the oldest position leaves — one departure frees only that position's units. An order whose own volume is larger than the whole allowance is not answered here at all: no waiting would help it, and it is 400 invalid_request with details.reason = bulk_order_over_cap. It is a pace limit like the others, so it is the same code: the order is not wrong, and the same body sent later is accepted. It carries no RateLimit-* headers: those describe a bucket of requests per minute, and this allowance is energy per hour — details above is its whole state.

Content type application/json.

Schema: Error.

HeaderTypeDescription
Retry-Afterinteger

Seconds to wait before retrying.

RateLimit-Limitinteger

Requests per minute in this bucket — per UTC day on POST /sandbox/deposit, the one allowance in this API that is not counted per minute. Absent in exactly three cases, and in none is a number invented for it: the limiter could not read the bucket state (the request is let through then), the answer is too_many_auth_failures, which is counted by the authorization-failure counter and not by a bucket — see "Repeated authorization failures" — or it is the volume allowance (details.reason = bulk_volume_cap), which is energy per hour rather than requests per minute.

RateLimit-Remaininginteger

Requests left in this bucket right now.

RateLimit-Resetinteger

Seconds until the bucket is full again.