Postpaid billing
With postpaid billing you order energy, bandwidth, activation and AML checks without topping up a deposit first. Services are priced using the applicable customer-specific tariff, including applicable discounts. Charges, payments and adjustments are reflected in your invoice under the billing and payment terms of your contract.
Postpaid is enabled by Netts on request for business accounts. The endpoints in this section answer only for accounts with postpaid billing; other accounts receive 403 postpaid_required.
How it works
- You order as usual. The same order endpoints, the same API key. A postpaid account does not need a deposit balance for these orders. The price is the price under your contract, including your discounts.
- Supplied services are recorded as charges. An accepted order is not by itself a supplied service. A charge appears in usage once the service or a separately chargeable part of the order has been supplied — this can be later than the order response.
- The price and rate are fixed and kept. A valid quotation fixes the price under your contract for that order. Without a quotation, the price under your contract when the order is placed applies, and the amount in the currency of your contract is calculated at the rate when the service is supplied. Recorded amounts are not recalculated when you read usage, receive an invoice or make a payment.
- You receive and pay your invoice. The billing period and payment terms are those agreed in your contract. An invoice shows the services of the period, the payments and adjustments applied, and the amount still payable; a payment does not delete the service records. The payment term starts when the invoice is delivered to you. Each invoice has a number, a PDF and a usage statement; an advance is requested with a proforma, and a correction is made with a credit note. See invoices and payments. The payment currency, network and payment term are shown in
settlementin account. An overpayment stays on your account as credit and is used for the next charges.
Tariff, quotation and recorded exchange rate
A quotation (freezePrice) fixes the price under your contract for one minute. Place the order with quoteId and the same parameters within that minute, and it is billed at the quoted price, even if the price changes or the service is supplied later. A quotation is optional; see 1-hour energy and 5-minute energy for the request fields.
Without a quotation, the amount in the currency of your contract is calculated at the rate when the service is supplied, not when you looked at a price or at your account. The current rate — your rate and the rate in account responses — is for comparison only; it is not a promise of the rate of a future order.
AML checks are priced in US dollars and recorded in the currency of your contract; the TRX equivalent is calculated at the rate when the check is completed. Do not recalculate an AML charge from its rounded TRX amount.
Amounts are shown in TRX and in the currency of your contract; your limits are counted in the currency of your contract. In the original response format usdPerTrx is the rate of TRX to the currency of your contract; in contract-v1 every amount and rate names its currency — see response format versions. You pay in the currency and network of your contract, shown in account.
An order can have more than one charge, for example energy and a separately chargeable activation. Each charge has its own time and rate. An amount is rounded once, half-even, to the decimal places of its currency — six for TRX, eight for BTC, for example; a quotation keeps its quoted amounts. A recorded amount keeps the decimal places it was recorded with. Reconcile an order by its charges, not by applying a current rate to its total.
All times are UTC. All amounts are decimal strings, for example "30000.000000" — parse them with a decimal type, not a float.
Credit limit
Netts sets the credit limit of your account: the most you can owe at any moment. It is shown in account and limits with "origin": "netts". You can see it but cannot change or switch it off — ask your Netts manager if you need a different limit.
Products and API keys share this one account-level credit limit. Each new order is checked against every applicable limit. When that check finds insufficient available credit, the order is refused before execution:
{
"detail": {
"code": 1004,
"msg": "Postpaid credit limit reached.",
"paymentMode": "postpaid",
"reason": "limit_reached",
"product": "*",
"period": "outstanding",
"limitId": 1
}
}The order endpoint answers 402. A payment frees the limit again. If the check is temporarily unavailable, the order endpoint answers 503 with code 5036 — retry later, nothing was charged by the rejected attempt. An available amount shown by a read request is the current figure, not a reservation for a later order; other accepted orders can change it.
Your own limits
Inside the Netts limit you can set your own, lower limits — to keep spending under control or restrict individual products:
- Your own overall limit — the total you allow yourself to owe, below the Netts limit.
- A product limit — how much one product may use, for example
energy_5m.
Your limits never add credit. Product limits do not add up: with a Netts limit of 50 USD, product limits of 50 USD for energy_1h and 50 USD for energy_5m still share 50 USD of account-level credit. The order check applies every relevant limit, and limits shows for each product how much can currently be spent.
A limit can count:
period | What is counted |
|---|---|
outstanding | unpaid charges, plus accepted orders not recorded yet |
day | charges of the current UTC day, paid ones included, plus accepted orders not recorded yet |
week | charges of the current UTC week from Monday 00:00 UTC, paid ones included, plus accepted orders not recorded yet |
order | the amount of a single new order |
A payment reduces your debt but does not reset the day's or week's usage. Credit from an overpayment is shown as creditApplied and counts once against your overall debt; it does not add to each product limit.
Your limits are in the currency of the Netts limit and cannot be higher than it. If Netts lowers its limit below one of yours, the lower applicable constraint remains in force.
Products: energy_1h, energy_5m, bandwidth, activation, aml_check.
API key permissions
Each API key needs a permission for this section. Your Netts manager grants it per key:
| Permission | Allows |
|---|---|
billing.read | account, rate, limits, usage, invoices with their PDF and usage statement, and payments |
limits.write | creating, changing, switching off and on your own limits |
Without the permission the endpoint answers 403 with billing_read_required or forbidden. The key's IP whitelist applies as for every other endpoint. These endpoints stay available when the deposit balance is zero.
Endpoints
| Endpoint | What it does |
|---|---|
GET /apiv2/billing/account | credit limit, debt and what is available now |
GET /apiv2/billing/rate | your current rate of TRX to the currency of your contract |
GET /apiv2/billing/limits | all limits with used and available amounts, available per product |
POST /apiv2/billing/limits | create, change, switch off and on your own limits |
GET /apiv2/billing/usage | charge components, linked to their orders |
GET /apiv2/billing/invoices | proformas, invoices and credit notes; one document with its charges, its PDF and its usage statement |
GET /apiv2/billing/payments | payments and credit |
Response format versions
The billing endpoints return the same records in two formats, on the same URLs. You choose with a request header:
X-Netts-Billing-Format | Response |
|---|---|
not sent, or legacy | the original format, unchanged. Amounts are plain strings; the field name or this documentation says which currency they are in (amountTrx, amountUsdc, usdPerTrx) |
contract-v1 | every amount carries its currency, every rate names its pair |
The header changes only how the response is written. It does not change any amount, does not grant a permission and does not bypass the IP whitelist. If you do not send it, your integration keeps working exactly as before.
Which format you get without the header depends on your contract:
- A contract with amounts in its own currency —
contract-v1is the default, you do not need the header. The original format is not available: a request withlegacyis refused with406 billing_format_not_available. - An account set up on postpaid before
contract-v1— the original format is the default and keeps working unchanged.contract-v1is enabled per account — ask your Netts manager. Until it is enabled, a request withcontract-v1is refused with403 billing_format_not_enabled.
Any other value is refused with 400 unsupported_billing_format; for the limit endpoints this check happens before anything is changed.
A successful response repeats the format in its X-Netts-Billing-Format header and carries Vary: X-Netts-Billing-Format and Cache-Control: private, no-store. Error responses do not carry the format header.
Retrying a limit change with the same Idempotency-Key returns the original result in the format of the retry; the change is not made again. See manage limits.
Amount
{ "amount": "1.300000", "currency": "TRX" }amount is a decimal string, currency is the currency of this amount: TRX, USD or the currency of your contract. A recorded amount keeps the currency it was recorded in; it is not relabelled when your contract changes.
Exchange rate
{
"base": "TRX",
"quote": "BTC",
"rate": "0.0000040521641344872153848384410760900598648246789630478",
"at": "2026-10-23T10:51:45.234722+00:00"
}One base is worth rate of quote at the moment at, UTC. The example uses BTC; your responses show the currency of your contract. A rate has only these four fields. When base and quote are the same, rate is "1" and at is null.
Reconciling a charge
In contract-v1 every charge in usage and in an invoice has:
baseAmount— the price of this component in its original currency: TRX for energy, bandwidth and activation, US dollars for an AML check;exchangeRate— the rate recorded for this component, with full precision: from its quotation if a quotation fixed the price, otherwise at the time the service was supplied;amount— the recorded amount in the currency of your contract.
amount equals baseAmount × exchangeRate.rate, rounded half-even to the decimal places of amount. Because the rate is given in full, the result matches exactly. In the original format usdPerTrx of a charge is rounded to 18 decimal places, so a recalculation from it can differ in the last digit — use the recorded amount, or contract-v1.
breakdown says whether both parts are shown: complete, or incomplete — the original amount and the rate cannot be shown for this charge, baseAmount and exchangeRate are null. The amount is the recorded, final amount in both cases. Do not calculate a rate by dividing rounded amounts.
The current rate and the rate in account and limit responses are for comparison only; they never change a recorded charge.
Response format
{ "success": true, "data": { }, "timestamp": "2026-10-19T20:12:30+00:00" }An error from the service:
{
"success": false,
"error": { "code": "postpaid_required", "message": "this account has no postpaid billing" },
"timestamp": "2026-10-19T20:12:30+00:00"
}A missing or invalid key, or a request from an IP outside the key's whitelist, is refused by the API gateway before it reaches the service, with 401:
{ "detail": { "code": -1, "msg": "Invalid or missing API key" } }Code -2 with "Invalid API key or IP not in whitelist" means the IP is not in the key's whitelist. More than 10 requests per second or 300 per minute from one IP are refused with 429 and {"message": "API rate limit exceeded"}.
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request, invalid_amount, idempotency_key_required, invalid_idempotency_key | a parameter is missing or has a wrong format |
| 400 | unsupported_billing_format | X-Netts-Billing-Format is neither legacy nor contract-v1 |
| 403 | billing_format_not_enabled | contract-v1 is not enabled for your account yet — the original format works |
| 406 | billing_format_not_available | the original format was requested, but your contract uses contract-v1 only |
| 403 | postpaid_required | the account has no postpaid billing |
| 403 | postpaid_disabled | postpaid billing is paused: you can read, but not change limits |
| 403 | billing_read_required, forbidden | the key lacks billing.read or limits.write |
| 403 | netts_limit_readonly | the limit is set by Netts and cannot be changed |
| 404 | not_found | no such limit or document on your account |
| 409 | revision_conflict | the limit was changed meanwhile — read it again |
| 409 | limit_exists | you already have a limit for this product and period |
| 409 | idempotency_conflict | the Idempotency-Key was used with another request |
| 409 | no_account_limit | the account has no credit limit set by Netts yet |
| 422 | above_account_limit | the value is higher than the Netts limit |
| 422 | product_not_postpaid | the product is not available on postpaid |
| 422 | unit_mismatch | the currency of the Netts limit changed — set a new value before switching your limit on |
| 503 | unavailable | temporarily unavailable — retry later |
| 503 | rate_unavailable | your rate is temporarily unavailable — retry later |