Get one of the domain's invoices
const url = 'https://api.nsin.ir/domains/example.com/invoices/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nsin.ir/domains/example.com/invoices/1 \ --header 'Authorization: Bearer <token>'One invoice of the domain with its line items and the subscription it
belongs to; user (the holder) is included when the invoice is yours.
Traffic statements answer 404. Requires billing on the domain, or
being its nominated payer; anyone else gets 404.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comResponses
Section titled “ Responses ”Invoice with its subscription.
object
object
Human-facing invoice number, sequential per Jalali year.
subscription — a plan purchase or renewal (taxed). period — the
traffic of a closed billing period, when it had metered traffic
(no VAT). topup — a wallet top-up (no VAT). manual — issued by
NSIN support (taxed).
Before tax, in rials.
VAT, in rials.
What was charged, in rials.
object
The invoice’s holder, as printed on it.
object
The subscription the invoice belongs to, when it has one.
object
The plan this subscription is on.
The plan this subscription is on.
object
The billing term purchased.
The billing term purchased.
object
For example active, expired, grace or cancelled.
Start of the subscription term.
End of the paid term.
End of the grace period after expiry, during which the plan keeps working.
Renew from the wallet at expiry.
Traffic-allowance reset cadence, frozen at purchase time so later plan changes cannot shift an existing subscriber’s quota window.
The free trial granted at signup. Downgrades to the free plan on expiry rather than entering grace.
When the subscription was cancelled. Absent unless cancelled.
Why NSIN cancelled it, for a cancellation the system made. Absent otherwise.
The entitlements this subscription carries — its plan with any overrides applied. On single-subscription reads.
object
Start of the current traffic-allowance window. On single-subscription reads of an active or grace subscription.
End of the current traffic-allowance window.
Traffic used so far in the current allowance window, in bytes. Only on GET /domains/{domain}/subscription.
Support-set override of the plan’s max_records. Present only when set.
Support-set override of the plan’s max_traffic_gb. Present only when set.
Support-set override of the plan’s max_rules_per_set. Present only when set.
Support-set override of the plan’s max_gateway_requests_30d. Present only when set.
Support-set override of the plan’s max_gateway_gb_30d. Present only when set.
Support-set override of the plan’s max_cache_cap_mb. Present only when set.
Support-set override of the plan’s max_cache_disk_gb. Present only when set.
Support-set override of the plan’s max_cache_ttl_days. Present only when set.
Support-set override of the plan’s max_email_rules. Present only when set.
Support-set override of the plan’s max_email_forwards_per_day. Present only when set.
Support-set override of the plan’s max_email_sends_per_day. Present only when set.
Support-set override of the plan’s max_custom_rules. Present only when set.
Support-set override of the plan’s disabled_rule_types, as a JSON array in a string ([] lifts every restriction). Present only when set.
Support-set override of the plan’s gateways_enabled. Present only when set.
Support-set override of the plan’s logs_enabled. Present only when set.
Support-set override of the plan’s monitoring_enabled. Present only when set.
Support-set override of the plan’s rules_enabled. Present only when set.
Support-set override of the plan’s cache_purge_enabled. Present only when set.
Support-set override of the plan’s custom_ssl_enabled. Present only when set.
Support-set override of the plan’s ws_enabled. Present only when set.
Support-set override of the plan’s host_header_edit_enabled. Present only when set.
Support-set override of the plan’s uptime_sms_enabled. Present only when set.
Support-set override of the plan’s dedicated_support_enabled. Present only when set.
Support-set override of the plan’s shield_enabled. Present only when set.
Support-set override of the plan’s bot_cache_enabled. Present only when set.
Support-set override of the plan’s under_attack_allowed. Present only when set.
Support-set override of the plan’s email_routing_enabled. Present only when set.
Support-set override of the plan’s email_sending_enabled. Present only when set.
Example
{ "invoice": { "kind": "subscription", "status": "paid" }, "subscription": { "cancel_reason": "domain_deleted" }}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}Domain or invoice not found.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}