Skip to content
cloudhostDocs
API reference

Billing

Plans, the rial wallet, top-ups, usage, invoices and tax details. Amounts in rials.

GET/v1/pricing

The public price list#

Plans, per-meter rials and the limits the platform enforces, from the dated price book. Cache-Control: public, max-age=300, with an ETag (If-None-Match gives 304). CORS: Access-Control-Allow-Origin * for GET. Pro is per developer seat (owner, admin, developer) per month, each seat's fee back as usage credit; a seat added mid-month pays the days left.

Credential
None

Response

200Pricing

  • effective_fromstring (date)required
  • currencystringrequired

    one of IRR

  • vat_percentnumber
  • grace_hoursnumber
  • plansPublicPlan[]required
  • metersobject[]required

Errors

StatusDescription
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/pricing"
GET/v1/billing

Plan, state and wallet#

Credential
An API key or a dashboard session
Roles
Any role

Response

200Billing

  • planstringrequired

    one of hobby, pro

  • statestringrequired
  • grace_untilstring (date-time) | null
  • currencystringrequired

    one of IRR

  • balanceintegerrequired

    rials (1 toman = 10 rials)

  • periodstringrequired

    a Jalali month, YYYY-MM, e.g. 1405-08

    pattern ^\d{4}-\d{2}$

  • usage_this_periodinteger

    rials (1 toman = 10 rials)

  • seatsinteger

    members that take a developer seat (owner, admin, developer)

  • seatobject
  • usage_creditobject | null

    Pro: the month's seats' credit

  • spendobject | null
  • burn_per_dayinteger

    rials (1 toman = 10 rials)

  • days_leftinteger | null
  • plansobject
  • payment_methodsobject[]

    the ways a top-up can be paid

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/prices

The price book#

Credential
An API key or a dashboard session
Roles
Any role

Response

200Prices

  • toman_per_usdnumber
  • vat_percentnumber
  • pricesPrice[]required

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/prices" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/usage

Usage and cost per meter for a month#

Database compute is sold by the compute-hour.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • periodstringquery

    Jalali month; default this month

    pattern ^\d{4}-\d{2}$

Response

200BillingUsage

  • periodstringrequired

    a Jalali month, YYYY-MM, e.g. 1405-08

    pattern ^\d{4}-\d{2}$

  • metersMeterUsage[]required
  • notestring

Errors

StatusDescription
400Bad request: bad_period
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/usage/history

Usage over time, for charts#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • granularitystringquery

    day (default): each day of a month up to today; month: each of the last months

    one of day, month

  • periodstringquery

    day: the Jalali month, default this one

    pattern ^\d{4}-\d{2}$

  • monthsintegerquery

    month: how many, 1-24, default 12

    1–24

  • meterstringquery

    meters to keep (comma list)

Response

200UsageHistory

  • granularitystringrequired

    one of day, month

  • periodstring

    a Jalali month, YYYY-MM, e.g. 1405-08

    pattern ^\d{4}-\d{2}$

  • metersobject[]required
  • pointsobject[]required

Errors

StatusDescription
400Bad request: bad_param, bad_period
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/usage/history" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/transactions

The wallet ledger (newest 200)#

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

  • transactionsTransaction[]required
    • idintegerrequired
    • amountintegerrequired

      rials (1 toman = 10 rials)

    • kindstringrequired

      one of topup, usage, plan_fee, vat, credit, refund, adjustment

    • refstring | null
    • memostring | null
    • created_atstring (date-time)
    • balanceinteger

      rials (1 toman = 10 rials)

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/transactions" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/payments

Top-up payments (newest 100)#

Masked card numbers are the payer's: billing roles only.

Credential
An API key or a dashboard session
Roles
owner, admin, billing

Response

200object

  • paymentsPayment[]required
    • idstring (uuid)required
    • methodstring

      the payment method's label

    • amountintegerrequired

      rials (1 toman = 10 rials)

    • statusstringrequired

      one of created, paid, failed

    • ref_idstring | null
    • card_panstring | null

      masked

    • errorstring | null

      one of cancelled, the payment was not completed

    • created_atstring (date-time)
    • verified_atstring (date-time) | null

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/payments" \
  -H "Authorization: Bearer $KEY"
POST/v1/billing/topups

Start a top-up#

Returns a payment page; the wallet is credited when the provider confirms.

Credential
An API key or a dashboard session
Roles
owner, admin, billing

Request bodyapplication/json

  • amountintegerrequired

    rials

    100000–2000000000

  • methodstring

    the id of one of payment_methods in GET /v1/billing; default the first

Response

200TopupCreated

  • paymentstring (uuid)required
  • amountinteger

    rials (1 toman = 10 rials)

  • methodstring
  • method_labelstring
  • pay_urlstringrequired

Errors

StatusDescription
400Bad request: bad_amount, bad_payment_method, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
500internal: an unexpected failure
502Upstream failure: psp

Example

curl -X POST "https://api.ibel.ai/v1/billing/topups" \
  -H "Authorization: Bearer $KEY" \
  -d '{"amount":100000}'
GET/v1/billing/callback/{method}

Payment page redirect (not for API clients)#

Verifies the payment, credits the wallet and redirects to the dashboard.

Credential
None

Parameters

  • methodstringpathrequired

    the payment method's id

  • Authoritystringquery

    the payment's reference

Response

302Redirect to the dashboard's billing page with ?payment=paid|failed&id=<payment>

Errors

StatusDescription
500internal: an unexpected failure

Example

Request
curl "https://api.ibel.ai/v1/billing/callback/card"
PUT/v1/billing/spend

Set the Pro spend budget#

Credential
An API key or a dashboard session
Roles
owner, admin, billing
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Request bodyapplication/json

  • limitinteger | null

    at least 0

  • pauseboolean

Response

200Spend

  • limitinteger | null

    at least 0

  • pauseboolean

Errors

StatusDescription
400Bad request: bad_limit, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/billing/spend" \
  -H "Authorization: Bearer $KEY" \
  -d '{"limit":0,"pause":true}'
POST/v1/billing/plan

Change plan#

Pro: the month's fee for every seat, plus VAT, now. Hobby: one seat at most; no refund.

Credential
An API key or a dashboard session
Roles
owner, admin, billing
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Request bodyapplication/json

  • planstringrequired

    one of pro, hobby

Response

200object

  • planstringrequired

Errors

StatusDescription
400Bad request: bad_plan, bad_json
401unauthorized: missing, invalid, expired or revoked credential
402Payment required: insufficient_balance
403Not allowed: forbidden, step_up_required
409Conflict: seat_limit
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/billing/plan" \
  -H "Authorization: Bearer $KEY" \
  -d '{"plan":"pro"}'
GET/v1/billing/tax-details

The buyer's tax details#

Credential
An API key or a dashboard session
Roles
owner, admin, billing

Response

200object

  • tax_detailsTaxDetails | nullrequired
    • buyer_typestringrequired

      one of person, company

    • legal_namestringrequired

      up to 200 characters

    • national_idstringrequired
    • economic_codestring | null
    • postal_codestring | null

      pattern ^\d{10}$

    • addressstring | null

      up to 500 characters

    • updated_atstring (date-time)

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/tax-details" \
  -H "Authorization: Bearer $KEY"
PUT/v1/billing/tax-details

Set the buyer's tax details#

Credential
An API key or a dashboard session
Roles
owner, admin, billing
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Request bodyapplication/json

  • buyer_typestringrequired

    one of person, company

  • legal_namestringrequired

    up to 200 characters

  • national_idstringrequired
  • economic_codestring | null
  • postal_codestring | null

    pattern ^\d{10}$

  • addressstring | null

    up to 500 characters

  • updated_atstring (date-time)

Response

200object

  • savedboolean

Errors

StatusDescription
400Bad request: bad_type, bad_name, bad_national_id, bad_economic_code, bad_postal_code, bad_json
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
500internal: an unexpected failure

Example

curl -X PUT "https://api.ibel.ai/v1/billing/tax-details" \
  -H "Authorization: Bearer $KEY" \
  -d '{"buyer_type":"person","legal_name":"…","national_id":"…"}'
GET/v1/billing/invoices

Issued invoices#

Credential
An API key or a dashboard session
Roles
Any role

Response

200object

  • invoicesInvoiceSummary[]required
    • numberstringrequired

      pattern ^\d{4}-\d{6}$

    • periodstringrequired

      a Jalali month, YYYY-MM, e.g. 1405-08

      pattern ^\d{4}-\d{2}$

    • issued_atstring (date-time)
    • netinteger

      rials (1 toman = 10 rials)

    • vatinteger

      rials (1 toman = 10 rials)

    • totalintegerrequired

      rials (1 toman = 10 rials)

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/invoices" \
  -H "Authorization: Bearer $KEY"
GET/v1/billing/invoices/{number}

An invoice, or preview for this month so far#

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • numberstringpathrequired

    invoice number, e.g. 1405-000001, or preview

  • periodstringquery

    preview only: Jalali month

    pattern ^\d{4}-\d{2}$

Response

200Invoice

  • numberstring | nullrequired
  • draftbooleanrequired
  • periodstringrequired

    a Jalali month, YYYY-MM, e.g. 1405-08

    pattern ^\d{4}-\d{2}$

  • issued_atstring (date-time) | null
  • linesInvoiceLine[]required
  • netintegerrequired

    rials (1 toman = 10 rials)

  • vatintegerrequired

    rials (1 toman = 10 rials)

  • totalintegerrequired

    rials (1 toman = 10 rials)

  • statementobject
  • buyerobject | null

    tax details as at issue; for viewer and developer roles only buyer_type and legal_name

  • sellerobject

Errors

StatusDescription
400Bad request: bad_period
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/billing/invoices/1405-000001" \
  -H "Authorization: Bearer $KEY"