Skip to content

GET /apiv2/billing/usage ​

Your postpaid charges: one line per separately chargeable component of an order, newest first. A line appears after the service has been supplied and recorded, which can be later than the order response. Use it to reconcile orders with the debt and with invoices. Part of postpaid billing.

Endpoint URL ​

GET https://netts.io/apiv2/billing/usage

Request headers ​

HeaderRequiredDescription
X-API-KEYyesAPI key with the billing.read permission
X-Real-IPyesAn address from the key whitelist

Query parameters ​

ParameterRequiredDescription
fromnocharges from this moment, ISO 8601 with a time zone: 2026-10-01T00:00:00Z
tonocharges before this moment, same format
limitnolines per page, 1–500, default 100
cursornonextCursor from the previous page

A time without a zone is refused with 400 invalid_request — the period would be ambiguous.

Example ​

bash
curl -s 'https://netts.io/apiv2/billing/usage?from=2026-10-01T00:00:00Z&limit=2' \
  -H 'X-API-KEY: your-api-key' \
  -H 'X-Real-IP: 203.0.113.10'
json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": 1024,
        "orderId": "AB2EF201B582AA1",
        "productCode": "energy_1h",
        "address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "quantity": 65000,
        "unitPriceSun": "20.000000",
        "discount": null,
        "amountTrx": "1.300000",
        "amountUsdc": "0.430096",
        "usdPerTrx": "0.330842760000000000",
        "quoteId": null,
        "txHash": "5c1f0e0d3a2b4c6d8e9f0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f",
        "fulfilledAt": "2026-10-19T10:11:42.563494+00:00",
        "status": "accrued",
        "paidTrx": "0.000000",
        "paidUsdc": "0.000000",
        "invoiceId": null,
        "reversesId": null
      }
    ],
    "nextCursor": 1023
  },
  "timestamp": "2026-10-19T20:31:10+00:00"
}

A charge ​

FieldDescription
idthe charge number
orderIdthe order this charge belongs to — the same id the order endpoint returned
productCodeenergy_1h, energy_5m, bandwidth, activation or aml_check
addressthe TRON address the order was for
quantityenergy or bandwidth units, or 1 for an activation or a check
unitPriceSunthe price per unit in SUN you were charged, your personal price included; null for products priced per order
discounta separate discount on this order — type percent or sun_per_unit and its value — or null
amountTrx, amountUsdcthe recorded amount of this component, in TRX and in the currency of your contract
usdPerTrxthe rate of TRX to the currency of your contract recorded for this component: from its quotation if the quotation fixed the amount, otherwise at the time the service was supplied
quoteIdthe quote the order used, if any
txHashthe TRON transaction of this component, when there is one
fulfilledAtwhen this component was supplied, UTC
statusaccrued — not invoiced yet; invoiced; paid; reversed — cancelled by a later correction
paidTrx, paidUsdchow much of the charge is already paid, in TRX and in the currency of your contract
invoiceIdthe invoice that contains it
reversesIdfor a correction line: the charge it cancels

An order with energy and an activation has two lines, one per part. A correction never edits an old line: it adds a new one with reversesId.

Pages ​

Send the nextCursor value as cursor to get the next, older page. nextCursor is null on the last page.

Errors ​

HTTPcodeMeaning
400invalid_requestwrong parameter, or from/to without a time zone
401-1, -2the key is missing or invalid, or the IP is not whitelisted — answered by the API gateway, see response format
403billing_read_required, postpaid_requiredno permission, or no postpaid billing