Skip to content
nsin docs

Get one subscription's period statement

GET
/wallet/period-statement
curl --request GET \
--url https://api.nsin.ir/wallet/period-statement \
--header 'Authorization: Bearer <token>'

The period statement of one of your subscriptions, named by subscription_id or domain: the running estimate (is_estimate: true) while the subscription is active, otherwise its latest closed statement, or null when it has neither. For a domain, the subscription in force is used, else the most recent one.

Plans are per domain, so an account has no single billing period: without subscription_id or domain the answer is {"statement": null}. List your subscriptions with GET /subscriptions; closed periods are in GET /wallet/period-statements.

subscription_id
integer

One of your subscriptions (GET /subscriptions).

domain
string

A domain name; its subscription in force, else the most recent one you held on it.

The statement, or null.

Media type application/json
object
statement
One of:

One billing period’s cost. For the period in progress the traffic figures are a running estimate.

object
id
integer
subscription_id
integer
plan_id
integer
plan_name
string
plan_term_id
integer
billing_duration_days
integer
quota_reset_days
integer
period_start
string format: date-time
period_end
string format: date-time
plan_price_rials

What the plan cost for this period.

integer
traffic_cached_bytes

Bytes served from cache in the period.

integer
traffic_proxied_bytes

Bytes fetched through the edge proxy.

integer
traffic_direct_bytes

Bytes on the direct path.

integer
traffic_bypass_bytes

Legacy two-tier column, on historical periods only.

integer
traffic_charged_rials

What the period’s traffic cost.

integer
cached_price_rials_per_gb

Price per GB of cached traffic in force for the period.

integer
proxied_price_rials_per_gb

Price per GB of proxied traffic.

integer
direct_price_rials_per_gb

Price per GB of direct traffic.

integer
bypass_price_rials_per_gb

Legacy two-tier price, on historical periods only.

integer
traffic_by_domain

Per-domain split. Only on an estimate for a running period.

Array<object>

One domain’s traffic in a period estimate.

object
domain
string
cached_bytes

Bytes served from cache.

integer
proxied_bytes

Bytes fetched through the edge proxy.

integer
direct_bytes

Bytes sent directly to the origin path.

integer
estimated_charged_rials

Estimated cost of this traffic at current rates.

integer
created_at

When the statement was closed.

string format: date-time
is_estimate

true for a running period’s estimate; false for a closed period.

boolean
not_a_tax_invoice

This is a statement, not a tax invoice.

boolean
traffic_realtime

Present (true) on an estimate whose traffic figures run up to now.

boolean
Example
{
"statement": {
"not_a_tax_invoice": true
}
}

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"
}

No subscription of yours matches subscription_id / domain.

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"
}