Get one subscription
const url = 'https://api.nsin.ir/subscriptions/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/subscriptions/1 \ --header 'Authorization: Bearer <token>'One of your subscriptions with its billing-period statement (the closed statement for a finished period) and its invoices.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”Subscription with its statement and invoices.
object
A plan attached to one domain. Entitlements are not read from the
plan directly — use GET /domains/{domain}/features, which resolves any
per-subscription overrides.
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.
One billing period’s cost. For the period in progress the traffic figures are a running estimate.
object
What the plan cost for this period.
Bytes served from cache in the period.
Bytes fetched through the edge proxy.
Bytes on the direct path.
Legacy two-tier column, on historical periods only.
What the period’s traffic cost.
Price per GB of cached traffic in force for the period.
Price per GB of proxied traffic.
Price per GB of direct traffic.
Legacy two-tier price, on historical periods only.
Per-domain split. Only on an estimate for a running period.
One domain’s traffic in a period estimate.
object
Bytes served from cache.
Bytes fetched through the edge proxy.
Bytes sent directly to the origin path.
Estimated cost of this traffic at current rates.
When the statement was closed.
true for a running period’s estimate; false for a closed period.
This is a statement, not a tax invoice.
Present (true) on an estimate whose traffic figures run up to now.
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
Example
{ "subscription": { "cancel_reason": "domain_deleted" }, "period_statement": { "not_a_tax_invoice": true }, "invoices": [ { "kind": "subscription", "status": "paid" } ]}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"}No such subscription on this account.
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"}