Skip to content
nsin docs

Get one of the domain's invoices

GET
/domains/{domain}/invoices/{id}
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.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
id
required
integer

Invoice with its subscription.

Media type application/json
object
invoice
object
id
integer
number

Human-facing invoice number, sequential per Jalali year.

string
user_id
integer
domain_id
integer
domain_name
string
subscription_id
integer
payment_id
integer
kind

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

string
Allowed values: subscription period topup manual
status
string
Allowed values: paid unpaid cancelled
subtotal_rials

Before tax, in rials.

integer
tax_rials

VAT, in rials.

integer
total_rials

What was charged, in rials.

integer
issued_at
string format: date-time
paid_at
string | null format: date-time
notes
string
created_at
string format: date-time
updated_at
string format: date-time
items
Array<object>
object
id
integer
invoice_id
integer
description
string
quantity
integer
unit_price_rials
integer
total_rials
integer
user

The invoice’s holder, as printed on it.

object
id
integer
email
string
phone_number
string
name
string
address
string
birth_date
string format: date
subscription

The subscription the invoice belongs to, when it has one.

object
id
integer
user_id
integer
domain_id
integer
domain_name
string
plan_id

The plan this subscription is on.

integer
plan

The plan this subscription is on.

object
key
additional properties
any
plan_term_id

The billing term purchased.

integer
plan_term

The billing term purchased.

object
key
additional properties
any
status

For example active, expired, grace or cancelled.

string
started_at

Start of the subscription term.

string format: date-time
expires_at

End of the paid term.

string format: date-time
grace_until

End of the grace period after expiry, during which the plan keeps working.

string format: date-time
auto_renew

Renew from the wallet at expiry.

boolean
quota_reset_days

Traffic-allowance reset cadence, frozen at purchase time so later plan changes cannot shift an existing subscriber’s quota window.

integer
is_trial

The free trial granted at signup. Downgrades to the free plan on expiry rather than entering grace.

boolean
cancelled_at

When the subscription was cancelled. Absent unless cancelled.

string format: date-time
cancel_reason

Why NSIN cancelled it, for a cancellation the system made. Absent otherwise.

string
Allowed values: domain_deleted recycled_domain_id plan_switch trial_ended
created_at
string format: date-time
updated_at
string format: date-time
effective_features

The entitlements this subscription carries — its plan with any overrides applied. On single-subscription reads.

object
key
additional properties
any
quota_period_start

Start of the current traffic-allowance window. On single-subscription reads of an active or grace subscription.

string format: date-time
quota_period_end

End of the current traffic-allowance window.

string format: date-time
quota_period_used_bytes

Traffic used so far in the current allowance window, in bytes. Only on GET /domains/{domain}/subscription.

integer format: int64
override_max_records

Support-set override of the plan’s max_records. Present only when set.

integer
override_max_traffic_gb

Support-set override of the plan’s max_traffic_gb. Present only when set.

integer
override_max_rules_per_set

Support-set override of the plan’s max_rules_per_set. Present only when set.

integer
override_max_gateway_requests_30d

Support-set override of the plan’s max_gateway_requests_30d. Present only when set.

integer
override_max_gateway_gb_30d

Support-set override of the plan’s max_gateway_gb_30d. Present only when set.

integer
override_max_cache_cap_mb

Support-set override of the plan’s max_cache_cap_mb. Present only when set.

integer
override_max_cache_disk_gb

Support-set override of the plan’s max_cache_disk_gb. Present only when set.

integer
override_max_cache_ttl_days

Support-set override of the plan’s max_cache_ttl_days. Present only when set.

integer
override_max_email_rules

Support-set override of the plan’s max_email_rules. Present only when set.

integer
override_max_email_forwards_per_day

Support-set override of the plan’s max_email_forwards_per_day. Present only when set.

integer
override_max_email_sends_per_day

Support-set override of the plan’s max_email_sends_per_day. Present only when set.

integer
override_max_custom_rules

Support-set override of the plan’s max_custom_rules. Present only when set.

integer
override_disabled_rule_types

Support-set override of the plan’s disabled_rule_types, as a JSON array in a string ([] lifts every restriction). Present only when set.

string
override_gateways_enabled

Support-set override of the plan’s gateways_enabled. Present only when set.

boolean
override_logs_enabled

Support-set override of the plan’s logs_enabled. Present only when set.

boolean
override_monitoring_enabled

Support-set override of the plan’s monitoring_enabled. Present only when set.

boolean
override_rules_enabled

Support-set override of the plan’s rules_enabled. Present only when set.

boolean
override_cache_purge_enabled

Support-set override of the plan’s cache_purge_enabled. Present only when set.

boolean
override_custom_ssl_enabled

Support-set override of the plan’s custom_ssl_enabled. Present only when set.

boolean
override_ws_enabled

Support-set override of the plan’s ws_enabled. Present only when set.

boolean
override_host_header_edit_enabled

Support-set override of the plan’s host_header_edit_enabled. Present only when set.

boolean
override_uptime_sms_enabled

Support-set override of the plan’s uptime_sms_enabled. Present only when set.

boolean
override_dedicated_support_enabled

Support-set override of the plan’s dedicated_support_enabled. Present only when set.

boolean
override_shield_enabled

Support-set override of the plan’s shield_enabled. Present only when set.

boolean
override_bot_cache_enabled

Support-set override of the plan’s bot_cache_enabled. Present only when set.

boolean
override_under_attack_allowed

Support-set override of the plan’s under_attack_allowed. Present only when set.

boolean
override_email_routing_enabled

Support-set override of the plan’s email_routing_enabled. Present only when set.

boolean
override_email_sending_enabled

Support-set override of the plan’s email_sending_enabled. Present only when set.

boolean
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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

Domain or invoice not found.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}