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/usageRequest headers
| Header | Required | Description |
|---|---|---|
X-API-KEY | yes | API key with the billing.read permission |
X-Netts-Billing-Format | no | contract-v1 for charges with their currency and recorded rate; not sent — the original format below |
Query parameters
| Parameter | Required | Description |
|---|---|---|
from | no | charges from this moment, ISO 8601 with a time zone: 2026-10-01T00:00:00Z |
to | no | charges before this moment, same format |
limit | no | lines per page, 1–500, default 100 |
cursor | no | nextCursor from the previous page |
A time without a zone is refused with 400 invalid_request — the period would be ambiguous.
Example
curl -s 'https://netts.io/apiv2/billing/usage?from=2026-10-01T00:00:00Z&limit=2' \
-H 'X-API-KEY: your-api-key'{
"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
| Field | Description |
|---|---|
id | the charge number |
orderId | the order this charge belongs to — the same id the order endpoint returned |
productCode | energy_1h, energy_5m, bandwidth, activation or aml_check |
address | the TRON address the order was for |
quantity | energy or bandwidth units, or 1 for an activation or a check |
unitPriceSun | the price per unit in SUN you were charged, your personal price included; null for products priced per order |
discount | a separate discount on this order — type percent or sun_per_unit and its value — or null |
amountTrx, amountUsdc | the recorded amount of this component, in TRX and in the currency of your contract |
usdPerTrx | the 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 |
quoteId | the quote the order used, if any |
txHash | the TRON transaction of this component, when there is one |
fulfilledAt | when this component was supplied, UTC |
status | accrued — not invoiced yet; invoiced; paid; reversed — cancelled by a later correction |
paidTrx, paidUsdc | how much of the charge is already paid, in TRX and in the currency of your contract |
invoiceId | the invoice that contains it |
reversesId | for 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.
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'{
"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.
| Field | Description |
|---|---|
baseAmount | the price of this component in its original currency: TRX for energy, bandwidth and activation, USD for an AML check. null when breakdown is incomplete |
amount | the recorded amount of this component in the currency of your contract; amountUsdc in the original format |
paid | how much of it is already paid; paidUsdc in the original format |
exchangeRate | the 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 |
breakdown | complete — 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 |
total | how 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
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request | wrong parameter, or from/to without a time zone |
| 400 | unsupported_billing_format | unknown X-Netts-Billing-Format value |
| 401 | -1, -2 | the key is missing or invalid, or the IP is not whitelisted — answered by the API gateway, see response format |
| 403 | billing_read_required, postpaid_required | no permission, or no postpaid billing |
| 403 | billing_format_not_enabled | contract-v1 is not enabled for your account yet |
| 406 | billing_format_not_available | the original format was requested, but your contract uses contract-v1 only |