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-Netts-Billing-Formatnocontract-v1 for charges with their currency and recorded rate; not sent — the original format below

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'
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.

A charge in contract-v1 ​

With X-Netts-Billing-Format: contract-v1 every charge shows its original amount, the rate recorded for it and the resulting amount, each with its currency. The query parameters and pages are the same. This format is enabled per account.

bash
curl -s 'https://netts.io/apiv2/billing/usage?from=2026-10-01T00:00:00Z&limit=1' \
  -H 'X-API-KEY: your-api-key' \
  -H 'X-Netts-Billing-Format: contract-v1'
json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": 4,
        "orderId": "1H0b5da50629",
        "productCode": "energy_1h",
        "address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        "quantity": 65000,
        "unitPriceSun": "22.000000",
        "discount": null,
        "baseAmount": { "amount": "1.43", "currency": "TRX" },
        "amount": { "amount": "0.00000579", "currency": "BTC" },
        "paid": { "amount": "0.00000000", "currency": "BTC" },
        "exchangeRate": {
          "base": "TRX",
          "quote": "BTC",
          "rate": "0.0000040521641344872153848384410760900598648246789630478",
          "at": "2026-10-23T10:51:45.234722+00:00"
        },
        "breakdown": "complete",
        "quoteId": "q_4f540f16fabf431da49687a76f730068",
        "txHash": "00484ee218af650b3c918b58c2e7f316ae48653f0f3c2dd122fc6cb9ed578312",
        "fulfilledAt": "2026-10-23T10:52:03+00:00",
        "status": "accrued",
        "invoiceId": null,
        "reversesId": null
      }
    ],
    "nextCursor": 4,
    "total": 25
  },
  "timestamp": "2026-10-22T13:42:40+00:00"
}

The example uses BTC; your responses show the currency of your contract. Here 1.43 × 0.0000040521641344872153848384410760900598648246789630478 = 0.0000057945947…, rounded half-even to the eight places of BTC — 0.00000579, the recorded amount. The rate is the one of the quotation this order used, so exchangeRate.at is earlier than fulfilledAt.

FieldDescription
baseAmountthe price of this component in its original currency: TRX for energy, bandwidth and activation, USD for an AML check. null when breakdown is incomplete
amountthe recorded amount of this component in the currency of your contract; amountUsdc in the original format
paidhow much of it is already paid; paidUsdc in the original format
exchangeRatethe rate recorded for this component, with full precision: from its quotation if the quotation fixed the price, otherwise at the time the service was supplied. For an AML check — from US dollars to the currency of your contract. null when breakdown is incomplete
breakdowncomplete — amount can be reproduced from baseAmount and exchangeRate; incomplete — the original amount and the rate cannot be shown for this charge. amount is final in both cases
totalhow many charges match from and to, over all pages. Only in contract-v1

The other fields are as in the original format. amountTrx, paidTrx and usdPerTrx are not sent: the original amount is baseAmount, and the rate is exchangeRate. How to reconcile — see reconciling a charge.

The two parts of one order — energy and its activation, for example — are separate lines, each with its own rate and time; they do not have to share a rate.

Pages ​

Send the nextCursor value as cursor to get the next, older page. nextCursor is null on the last page. In contract-v1, total is the number of charges of the whole selection, so you can show the number of pages; it does not depend on cursor.

Errors ​

HTTPcodeMeaning
400invalid_requestwrong parameter, or from/to without a time zone
400unsupported_billing_formatunknown X-Netts-Billing-Format value
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
403billing_format_not_enabledcontract-v1 is not enabled for your account yet
406billing_format_not_availablethe original format was requested, but your contract uses contract-v1 only