Developer platform · v2

API reference

View as MarkdownAll docs

Billing API

7 operations · all resources

What this covers#

A prepaid USD wallet per account. Read the balance and the rate, list transactions and invoices, and open a checkout to top up. Console door only — a project key does not move money.

Every example below runs as written once these are exported:

bash
export DVAARIK_TOKEN="<account access token>"   # console session, from POST /console/auth/login
export INVOICE_ID="<uuid>"

A <value> inside a JSON body is a value you supply. Responses are JSON; every error body is { "detail": … }. Each schema is expanded once per page, where it first appears.

Account door errors#

StatusCause
401No account session was presented, or it is invalid or expired. Refresh once, then re-authenticate.
403The account is suspended or its email is not verified.

Operations — account session#

The same resource through the console door. These are what the web console calls; both doors return the same shapes.

GET /console/v2/billing/invoices#

Receipts for paid top-ups.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleListBillingInvoices
Success200 V2InvoiceInfo[]
ParameterInTypeRequiredNotes
limitqueryintegerno
offsetqueryintegerno

V2InvoiceInfo#

FieldTypeRequiredNotes
amount_minorinteger or nullno
credits_nano_usdstring or nullno
currencystringyes
iduuidyes
issued_atdate-timeyes
numberstringyes
project_iduuid or nullyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/invoices?limit=20" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

GET /console/v2/billing/invoices/{invoice_id}.pdf#

Download one receipt as a PDF.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleDownloadBillingInvoicePdf
Success200 application/pdf
ParameterInTypeRequiredNotes
invoice_idpathuuidyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/invoices/$INVOICE_ID.pdf" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

GET /console/v2/billing/quote#

What a top-up buys, before you start it. No fee and no markup: one cent is exactly 10,000,000 nano-USD.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleGetTopupQuote
Success200 V2TopupQuote
ParameterInTypeRequiredNotes
amount_usd_centsqueryintegeryes

V2TopupQuote#

FieldTypeRequiredNotes
amount_usd_centsintegeryes
credits_nano_usdstringyes
currencystringnodefault "USD"
money_scaleintegeryes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/quote?amount_usd_cents=<amount_usd_cents>" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

GET /console/v2/billing/rate#

The connected-minute rate on its own, with its metering basis and rate version.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleGetVoiceRate
Success200 VoiceRateResponse

VoiceRateResponse#

FieldTypeRequiredNotes
voice_rateVoiceRateContractyesThe one price this product charges.

VoiceRateContract#

What one connected minute costs, in both forms the console needs.

FieldTypeRequiredNotes
currencystringnodefault "USD"
metering_basisstringnodefault "connected_minute_rounded_up"
money_scaleintegernodefault 1000000000
rate_displaystringyes
rate_nano_usd_per_minutestringyes
rate_versionstringyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/rate" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

GET /console/v2/billing/summary#

The account wallet — balance, held, spendable, lifetime top-up, low-balance flag — with the rate and this project's limits.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleGetBillingSummary
Success200 V2BillingSummary
ParameterInTypeRequiredNotes
project_idqueryuuid or nullno

V2BillingSummary#

FieldTypeRequiredNotes
api_requests_per_minuteintegeryes
balance_nano_usdstringyes
currencystringnodefault "USD"
held_nano_usdstringyes
lifetime_topup_nano_usdstringyes
low_balancebooleanyes
low_balance_threshold_nano_usdstringyes
max_voice_session_secondsintegeryes
money_scaleintegernodefault 1000000000
project_iduuidyes
spendable_nano_usdstringyes
usd_statestringyes
voice_concurrencyintegeryes
voice_rateVoiceRateContractyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/summary" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

POST /console/v2/billing/topup#

Record a top-up order and open a Razorpay USD checkout. The wallet is credited by the payment webhook, never by a successful checkout alone.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleStartTopup
Success200 V2TopupOrderResponse

Request body: V2TopupRequest.

V2TopupRequest#

FieldTypeRequiredNotes
amount_usd_centsintegeryes
project_iduuid or nullno

V2TopupOrderResponse#

FieldTypeRequiredNotes
amount_usd_centsintegeryes
credits_nano_usdstringyes
currencystringnodefault "USD"
money_scaleintegeryes
order_idstringyes
project_iduuidyes
razorpay_key_idstringyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
409The project or resource is in a state that refuses this change.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.
502The payment gateway did not create an order.
503The order could not be recorded locally, so no checkout was returned.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X POST "https://api.developers.dvaarik.com/console/v2/billing/topup" \
  -H "Authorization: Bearer $DVAARIK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usd_cents": 2500
  }'

GET /console/v2/billing/transactions#

The ledger, newest first.

DetailValue
DoorAccount session — Authorization: Bearer $DVAARIK_TOKEN
OperationconsoleListBillingTransactions
Success200 V2TransactionInfo[]
ParameterInTypeRequiredNotes
limitqueryintegerno
offsetqueryintegerno

V2TransactionInfo#

One canonical USD ledger row. A row from before the USD cutover has no USD amount and is deliberately NOT rendered as a zero: amount_nano_usd is null and the caller can tell "nothing" from "nothing yet converted". The archival paise figures stay on the legacy route.

FieldTypeRequiredNotes
amount_nano_usdstring or nullno
balance_after_nano_usdstring or nullno
created_atdate-timeyes
currencystringyes
descriptionstring or nullno
iduuidyes
money_scaleintegeryes
project_iduuid or nullyes
referencestring or nullno
typestringyes
ErrorWhen
401No account session was presented, or it is invalid or expired.
403The account is suspended or its email is not verified.
404The project or the addressed resource does not exist for this owner. A resource owned by another developer is deliberately indistinguishable from one that never existed.
422The request body or query is not valid. detail is an array of {loc, msg, type} and loc names the offending field.

Plus the account-door errors above. Full list on the errors page.

bash
curl -sS -X GET "https://api.developers.dvaarik.com/console/v2/billing/transactions?limit=20" \
  -H "Authorization: Bearer $DVAARIK_TOKEN"

Try it without a key in the browser

The playground opens a real voice session with your account session, so a project key never reaches a browser. Machine calls belong on your own server.