nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Billing

List completed billing-period statements

gethttps://api.nsin.ir/wallet/period-statements

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

One statement per closed billing period across all your subscriptions, newest period first: the plan price, traffic by class and what the traffic cost, with the per-GB prices in force for that period. These are statements, not tax invoices (not_a_tax_invoice: true).

Query parameters

  • limitintegerquery

    How many statements to return, 1–200.

    Default: 50
  • subscription_idintegerquery

    Only this subscription's statements.

  • domainstringquery

    Only statements of the subscriptions you have held on this domain.

Responses

200Completed statements, newest first.

Content type: application/json

  • idinteger
  • subscription_idinteger
  • plan_idinteger
  • plan_namestring
  • plan_term_idinteger
  • billing_duration_daysinteger
  • quota_reset_daysinteger
  • period_startstring (date-time)
  • period_endstring (date-time)
  • plan_price_rialsinteger

    What the plan cost for this period.

  • traffic_cached_bytesinteger

    Bytes served from cache in the period.

  • traffic_proxied_bytesinteger

    Bytes fetched through the edge proxy.

  • traffic_direct_bytesinteger

    Bytes on the direct path.

  • traffic_bypass_bytesinteger

    Legacy two-tier column, on historical periods only.

  • traffic_charged_rialsinteger

    What the period's traffic cost.

  • cached_price_rials_per_gbinteger

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

  • proxied_price_rials_per_gbinteger

    Price per GB of proxied traffic.

  • direct_price_rials_per_gbinteger

    Price per GB of direct traffic.

  • bypass_price_rials_per_gbinteger

    Legacy two-tier price, on historical periods only.

  • traffic_by_domainarray of PeriodDomainTraffic

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

    Item fields
    • domainstring
    • cached_bytesinteger

      Bytes served from cache.

    • proxied_bytesinteger

      Bytes fetched through the edge proxy.

    • direct_bytesinteger

      Bytes sent directly to the origin path.

    • estimated_charged_rialsinteger

      Estimated cost of this traffic at current rates.

  • created_atstring (date-time)

    When the statement was closed.

  • is_estimateboolean

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

  • not_a_tax_invoiceboolean

    This is a statement, not a tax invoice.

    One of: true
  • traffic_realtimeboolean

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

json
[
  {
    "id": 0,
    "subscription_id": 0,
    "plan_id": 0,
    "plan_name": "string",
    "plan_term_id": 0,
    "billing_duration_days": 0,
    "quota_reset_days": 0,
    "period_start": "2026-01-01T00:00:00Z",
    "period_end": "2026-01-01T00:00:00Z",
    "plan_price_rials": 0,
    "traffic_cached_bytes": 0,
    "traffic_proxied_bytes": 0,
    "traffic_direct_bytes": 0,
    "traffic_bypass_bytes": 0,
    "traffic_charged_rials": 0,
    "cached_price_rials_per_gb": 0,
    "proxied_price_rials_per_gb": 0,
    "direct_price_rials_per_gb": 0,
    "bypass_price_rials_per_gb": 0,
    "traffic_by_domain": [
      {
        "domain": "string",
        "cached_bytes": 0,
        "proxied_bytes": 0,
        "direct_bytes": 0,
        "estimated_charged_rials": 0
      }
    ],
    "created_at": "2026-01-01T00:00:00Z",
    "is_estimate": true,
    "not_a_tax_invoice": true,
    "traffic_realtime": true
  }
]
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}

Example request

bash
curl -X GET "https://api.nsin.ir/wallet/period-statements" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc