Developer platform · v2

API reference

View as MarkdownAll docs

Billing API

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

PUT /console/v2/billing/currency#

Choose which currency calls spend. Refused while any call holds money; money is never converted, each currency keeps its own balance. The one exception is an untouched dollar welcome credit, which the first switch to rupees moves (the rupee welcome amount, never a conversion).

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

Request body: V2CurrencyRequest.

V2CurrencyRequest#

FieldTypeRequiredNotes
currency"USD" or "INR"yes

V2BillingSummary#

FieldTypeRequiredNotes
api_requests_per_minuteintegeryes
balance_minorstringyes
balance_nano_usdstringyes
can_switch_currencybooleanyes
currencystringnodefault "USD"
held_minorstringyes
held_nano_usdstringyes
lifetime_topup_minorstringyes
lifetime_topup_nano_usdstringyes
low_balancebooleanyes
low_balance_threshold_minorstringyes
low_balance_threshold_nano_usdstringyes
max_voice_session_secondsintegeryes
money_scaleintegernodefault 1000000000
other_currencystringyes
other_currency_balance_minorstringyes
project_iduuidyes
spendable_minorstringyes
spendable_nano_usdstringyes
topup_fee_bpsintegeryes
topup_max_minorintegeryes
topup_min_minorintegeryes
usd_statestringyes
voice_concurrencyintegeryes
voice_rateVoiceRateContractyes

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_minutestring or nullyes
rate_per_minute_minorstringyes
rate_versionstringyes
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.
409A call or a chat reply is in progress (money is held); switch after it ends.
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 PUT "https://api.developers.dvaarik.com/console/v2/billing/currency" \
  -H "Authorization: Bearer $DVAARIK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "currency": "USD"
  }'

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_minorinteger or nullno
credits_nano_usdstring or nullno
currencystringyes
fee_minorinteger or nullno
iduuidyes
issued_atdate-timeyes
numberstringyes
project_iduuid or nullyes
total_minorinteger or nullno
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_minorqueryinteger or nullno
amount_usd_centsqueryinteger or nullno

V2TopupQuote#

What a top-up credits and what the gateway charges, in the wallet's currency.

FieldTypeRequiredNotes
amount_minorintegeryes
amount_usd_centsinteger or nullno
credits_minorstringyes
credits_nano_usdstring or nullno
currencystringnodefault "USD"
fee_bpsintegeryes
fee_minorintegeryes
money_scaleintegeryes
total_minorintegeryes
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" \
  -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.
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
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_minorinteger or nullno
amount_usd_centsinteger or nullno
project_iduuid or nullno

V2TopupOrderResponse#

FieldTypeRequiredNotes
amount_minorintegeryes
amount_usd_centsinteger or nullno
credits_minorstringyes
credits_nano_usdstring or nullno
currencystringnodefault "USD"
fee_bpsintegeryes
fee_minorintegeryes
money_scaleintegeryes
order_idstringyes
project_iduuidyes
razorpay_key_idstringyes
total_minorintegeryes
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"

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_minorstring or nullno
amount_nano_usdstring or nullno
balance_after_minorstring or nullno
balance_after_nano_usdstring or nullno
created_atdate-timeyes
currencystringyes
descriptionstring or nullno
iduuidyes
labelstring or nullno
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.