API reference
Billing
How these fit together: the Billing guide.
Get balance
get
Retrieves the prepaid balance, this period’s included minutes and the plan enrolment.
The wallet’s availableMinor in minor units of currency, the low-balance threshold, this billing period’s included minutes (total, used, remaining) and the plan enrolment (subscription: status, plan, period dates, trial end). Read as the rows stand — a read never enrols the organization or rolls a period over, so a period that has just ended shows until the platform rolls it. An organization never billed reads zero, with subscription: null. billing says who pays its charges: when its integration does (payer: integration), this wallet is not spent and the monthly cap and this month’s spend are there.
Access: an organization key with the billing:read scope.
Response 200PublicBalance
availableMinorintegerRequiredPrepaid credit in minor units of
currency(paise for INR). May be negative: a call admitted on one minute of credit runs to its end, and the next dial is refused.billingPublicOrganizationBillingWho pays the organization’s charges. While its integration pays (
payer: integration) this wallet is not spent — the figures above stay as they were — and the monthly cap and this month’s spend are here.3 fields of
billingpayerstringRequiredorganization: its own wallet.integration: the wallet of the billing organization the platform set for the integration that provisioned it — each charge debits that wallet, attributed to this organization, and its own wallet is not spent.One of
organizationintegrationspendPublicSpend | nullRequiredWhile the integration pays: what this month has taken from it so far; null otherwise.
3 fields of
spendamountMinorintegerRequiredNet: charges less what was credited back (a refunded message, a re-rated call), as posted this month.
periodEndstring (date-time)RequiredExclusive.
periodStartstring (date-time)RequiredThe month’s start (UTC).
spendCapPublicSpendCap | nullRequiredWhile the integration pays: the monthly cap on what it pays (dials, sends and numbers past it are refused
402 BILLING_SPEND_CAP_REACHED); null for none.2 fields of
spendCapamountMinorintegerRequiredThe most its usage and fees may take, net, from the paying account in a month (minor units of the currency).
at least 1
periodstringRequiredA UTC calendar month.
One of
month
currencystringRequiredincludedMinutesPublicIncludedMinutes | nullRequiredThis period’s included call minutes (spent before per-minute rates apply); null without a subscription.
3 fields of
includedMinutesremainingintegerRequiredtotalintegerRequiredMinutes in this period’s bundle, as snapshotted when the period started.
usedintegerRequired
lowBalanceThresholdMinorinteger | nullRequiredBelow this the console warns the organization’s administrators. Null before the wallet exists.
objectstringRequiredOne of
balancesubscriptionPublicBillingSubscription | nullRequiredNull for an organization not enrolled on a plan yet.
6 fields of
subscriptioncancelAtPeriodEndbooleanRequiredcurrentPeriodEndstring (date-time)RequiredThe next renewal: the plan’s fee is debited then.
currentPeriodStartstring (date-time)RequiredplanPublicBillingPlanRefRequired2 fields of
plancodestringRequirednamestringRequired
statusstringRequiredpast_due: the plan’s fee could not be covered — dialling and sending are refused until a top-up settles it;suspended: held by the platform;canceled: cancelled at a period end.One of
trialingactivepast_duesuspendedcanceledtrialEndsAtstring (date-time) | nullRequired
updatedAtstring (date-time) | nullRequiredWhen the balance last moved; null before the wallet exists.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/balance' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"availableMinor": 482500,
"billing": {
"payer": "organization",
"spend": {
"amountMinor": 182350,
"periodEnd": "2026-11-05T10:00:00.000Z",
"periodStart": "2026-11-05T10:00:00.000Z"
},
"spendCap": {
"amountMinor": 500000,
"period": "month"
}
},
"currency": "INR",
"includedMinutes": {
"remaining": 1,
"total": 1,
"used": 1
},
"lowBalanceThresholdMinor": 1,
"object": "balance",
"subscription": {
"cancelAtPeriodEnd": true,
"currentPeriodEnd": "2026-11-05T10:00:00.000Z",
"currentPeriodStart": "2026-11-05T10:00:00.000Z",
"plan": {
"code": "GROWTH",
"name": "Growth"
},
"status": "trialing",
"trialEndsAt": "2026-11-05T10:00:00.000Z"
},
"updatedAt": "2026-11-05T10:00:00.000Z"
}Update balance
patch
Sets the low-balance threshold (balance.low fires when spend crosses it).
Settings only: credit moves through top-ups (POST /v1/balance/top-ups), which a person pays at the payment gateway. Zero turns the warning (and the event) off.
Access: an organization key with the billing:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
lowBalanceThresholdMinorintegerRequiredThe balance (minor units) below which
balance.lowfires and the console warns administrators. Zero turns the warning off.0–100000000
Response 200PublicBalance
availableMinorintegerRequiredPrepaid credit in minor units of
currency(paise for INR). May be negative: a call admitted on one minute of credit runs to its end, and the next dial is refused.billingPublicOrganizationBillingWho pays the organization’s charges. While its integration pays (
payer: integration) this wallet is not spent — the figures above stay as they were — and the monthly cap and this month’s spend are here.3 fields of
billingpayerstringRequiredorganization: its own wallet.integration: the wallet of the billing organization the platform set for the integration that provisioned it — each charge debits that wallet, attributed to this organization, and its own wallet is not spent.One of
organizationintegrationspendPublicSpend | nullRequiredWhile the integration pays: what this month has taken from it so far; null otherwise.
3 fields of
spendamountMinorintegerRequiredNet: charges less what was credited back (a refunded message, a re-rated call), as posted this month.
periodEndstring (date-time)RequiredExclusive.
periodStartstring (date-time)RequiredThe month’s start (UTC).
spendCapPublicSpendCap | nullRequiredWhile the integration pays: the monthly cap on what it pays (dials, sends and numbers past it are refused
402 BILLING_SPEND_CAP_REACHED); null for none.2 fields of
spendCapamountMinorintegerRequiredThe most its usage and fees may take, net, from the paying account in a month (minor units of the currency).
at least 1
periodstringRequiredA UTC calendar month.
One of
month
currencystringRequiredincludedMinutesPublicIncludedMinutes | nullRequiredThis period’s included call minutes (spent before per-minute rates apply); null without a subscription.
3 fields of
includedMinutesremainingintegerRequiredtotalintegerRequiredMinutes in this period’s bundle, as snapshotted when the period started.
usedintegerRequired
lowBalanceThresholdMinorinteger | nullRequiredBelow this the console warns the organization’s administrators. Null before the wallet exists.
objectstringRequiredOne of
balancesubscriptionPublicBillingSubscription | nullRequiredNull for an organization not enrolled on a plan yet.
6 fields of
subscriptioncancelAtPeriodEndbooleanRequiredcurrentPeriodEndstring (date-time)RequiredThe next renewal: the plan’s fee is debited then.
currentPeriodStartstring (date-time)RequiredplanPublicBillingPlanRefRequired2 fields of
plancodestringRequirednamestringRequired
statusstringRequiredpast_due: the plan’s fee could not be covered — dialling and sending are refused until a top-up settles it;suspended: held by the platform;canceled: cancelled at a period end.One of
trialingactivepast_duesuspendedcanceledtrialEndsAtstring (date-time) | nullRequired
updatedAtstring (date-time) | nullRequiredWhen the balance last moved; null before the wallet exists.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED — a test key cannot change the live wallet’s threshold. IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X PATCH 'https://api.trovacast.com/v1/balance' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"lowBalanceThresholdMinor": 50000
}'{
"availableMinor": 482500,
"billing": {
"payer": "organization",
"spend": {
"amountMinor": 182350,
"periodEnd": "2026-11-05T10:00:00.000Z",
"periodStart": "2026-11-05T10:00:00.000Z"
},
"spendCap": {
"amountMinor": 500000,
"period": "month"
}
},
"currency": "INR",
"includedMinutes": {
"remaining": 1,
"total": 1,
"used": 1
},
"lowBalanceThresholdMinor": 1,
"object": "balance",
"subscription": {
"cancelAtPeriodEnd": true,
"currentPeriodEnd": "2026-11-05T10:00:00.000Z",
"currentPeriodStart": "2026-11-05T10:00:00.000Z",
"plan": {
"code": "GROWTH",
"name": "Growth"
},
"status": "trialing",
"trialEndsAt": "2026-11-05T10:00:00.000Z"
},
"updatedAt": "2026-11-05T10:00:00.000Z"
}Create top up
post
Starts a credit top-up: returns a checkout for a person to pay, with the tax on it itemised.
The wallet is credited when the payment gateway reports the payment (its webhook, or a later GET /v1/balance/top-ups/{topUpId}), never by this call. amountMinor is the credit; where tax applies (GST for an organization in India) it is charged on top — taxMinor, with totalMinor what the payer pays — and never becomes balance. The gateway follows your organization’s country, and checkout says how to open it without naming one: redirect is a hosted page at url (also checkoutUrl), embedded opens on your own page from scriptUrl with options. The checkout is returned once and stops accepting payment at expiresAt.
Access: an organization key with the billing:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.
Headers
Idempotency-KeystringMakes the request safe to retry: a repeat with the same key and the same body returns the stored success (with
Idempotent-Replayed: true) instead of running again; a 4xx stores nothing. A 5xx is stored and replayed to every retry with the same key (Idempotent-Replayed: true): the first attempt may have taken effect, so check before retrying with a new key — except the errors that provably changed nothing (503 MESSAGING_TRANSPORT,503 WHATSAPP_CONNECT_UNAVAILABLE; see https://trovacast.com/developers/idempotency), which store nothing, so a retry with the same key runs again. 1–255 visible ASCII characters; kept for 24 hours.
Request body
amountMinorintegerRequiredCredit to buy, in minor units of your plan’s currency (paise for INR). At least the plan’s minimum top-up (
BILLING_TOP_UP_BELOW_MINIMUM), at most the online limit (BILLING_TOP_UP_ABOVE_MAXIMUM). Tax, where it applies, is charged on top of it (taxMinorin the answer) and is not credit; a top-up that carries tax must be a whole amount — a multiple of 100, no paise (BILLING_TOP_UP_NOT_WHOLE_UNIT).1–50000000
cancelUrlstring (uri)Where the payer lands if they abandon the checkout (https). Default: the console’s billing page.
successUrlstring (uri)Where the payer lands after paying (https). Default: the console’s billing page.
Response 201PublicTopUp
Its fields are listed under Get top up.
Errors
400BILLING_TOP_UP_BELOW_MINIMUM (minimumTopUpMinorsays the plan’s minimum); BILLING_TOP_UP_ABOVE_MAXIMUM (maximumTopUpMinor); BILLING_TOP_UP_NOT_WHOLE_UNIT — a top-up that carries tax is not a multiple ofwholeUnitMinor; VALIDATION_FAILED — a return URL is not https.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.409BILLING_PAYMENTS_UNAVAILABLE — online payments are not configured on this deployment; BILLING_PAID_BY_INTEGRATION — the organization’s charges are paid by its integration’s billing organization, which takes the credit instead. IDEMPOTENCY_KEY_IN_FLIGHT — the first request with this Idempotency-Key is still running (retry afterRetry-After); or CONFLICT.422TEST_MODE_UNSUPPORTED — a test key cannot buy credit. IDEMPOTENCY_KEY_REUSED — this Idempotency-Key was used for a different request.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault. With an Idempotency-Key, every retry with that key replays this answer (Idempotent-Replayed: true).
curl -X POST 'https://api.trovacast.com/v1/balance/top-ups' \
-H "Authorization: Bearer $TROVACAST_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d '{
"amountMinor": 100000,
"cancelUrl": "https://app.example.com/billing",
"successUrl": "https://app.example.com/billing/thanks"
}'{
"amountMinor": 100000,
"checkout": {
"constructorName": "Razorpay",
"kind": "redirect",
"options": {},
"scriptUrl": "https://example.com/trovacast/webhook",
"url": "https://example.com/trovacast/webhook"
},
"checkoutUrl": "https://example.com/trovacast/webhook",
"createdAt": "2026-11-05T10:00:00.000Z",
"currency": "INR",
"expiresAt": "2026-11-05T10:00:00.000Z",
"id": "ID",
"invoiceNumber": "TC/26-27/000123",
"object": "top_up",
"status": "pending",
"taxMinor": 18000,
"taxRateBps": 1800,
"totalMinor": 118000
}Get top up
get
Retrieves a top-up; a pending one is checked with the payment gateway (and credited if paid).
The top-up’s status (pending, succeeded, failed, expired or refunded), credit, tax, total and expiresAt; the checkout is never returned again (checkoutUrl and checkout are null). A pending top-up is checked with the payment gateway on each read: a paid one is credited to the wallet then — once, whichever of this read and the gateway’s webhook comes first — and an expired checkout reads expired. invoiceNumber is set once a taxed top-up has succeeded.
Access: an organization key with the billing:manage scope. Live keys only: a test key is refused with 422 TEST_MODE_UNSUPPORTED.
Path parameters
topUpIdstringRequired
Response 200PublicTopUp
Show the 13 fieldsHide the fields
amountMinorintegerRequiredThe credit bought, in minor units: exactly what the balance rises by when the top-up succeeds.
checkoutPublicTopUpCheckout | nullRequiredHow to open the checkout. Returned by the create call only (null on a read).
5 fields of
checkoutconstructorNamestring | nullRequiredThe global the script defines, to construct with
options(embedded); null otherwise.kindstringRequiredredirect: send the payer tourl, a hosted page that returns them to yoursuccessUrlorcancelUrl.embedded: the checkout opens on your own page — loadscriptUrl, constructwindow[constructorName]withoptionsand callopen().One of
redirectembeddedoptionsobject | nullRequiredWhat to construct the checkout with (
embedded): the gateway’s public key id, the order and the amount it is fixed at. Nothing in it is a secret, and the amount cannot be changed from the page. Null otherwise.scriptUrlstring (uri) | nullRequiredThe gateway’s checkout script to load on your page (
embedded); null otherwise.urlstring (uri) | nullRequiredThe hosted checkout page (
redirect); null otherwise.
checkoutUrlstring (uri) | nullRequiredThe hosted checkout to send the payer to, when the checkout is a hosted page (
checkout.kindisredirect); null when it opens on your own page (embedded). Returned by the create call only (null on a read): a lost link is a new top-up — the abandoned one expires.createdAtstring (date-time)RequiredcurrencystringRequiredexpiresAtstring (date-time)RequiredWhen the checkout stops accepting payment.
idstring (uuid)RequiredinvoiceNumberstring | nullRequiredThe number of the tax invoice issued when a taxed top-up succeeded; null before that and for a top-up that is not taxed (
GET /v1/balance/top-ups/{topUpId}/invoicethen answers a plain receipt).objectstringRequiredOne of
top_upstatusstringRequiredpendinguntil the payer pays;succeededonce the gateway reports the payment and the wallet is credited.One of
pendingsucceededfailedexpiredrefundedtaxMinorintegerRequiredTax charged on top of the credit, in minor units — GST for an organization in India;
0when the top-up is not taxed. It is paid with the credit and never becomes balance.taxRateBpsinteger | nullRequiredThe rate
taxMinorwas charged at, in basis points (1800is 18%); null when the top-up is not taxed.totalMinorintegerRequiredWhat the payer is charged:
amountMinorplustaxMinor, in minor units.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such top-up.422TEST_MODE_UNSUPPORTED — a test key cannot read top-ups.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/balance/top-ups/TOP_UP_ID' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"amountMinor": 100000,
"checkout": {
"constructorName": "Razorpay",
"kind": "redirect",
"options": {},
"scriptUrl": "https://example.com/trovacast/webhook",
"url": "https://example.com/trovacast/webhook"
},
"checkoutUrl": "https://example.com/trovacast/webhook",
"createdAt": "2026-11-05T10:00:00.000Z",
"currency": "INR",
"expiresAt": "2026-11-05T10:00:00.000Z",
"id": "ID",
"invoiceNumber": "TC/26-27/000123",
"object": "top_up",
"status": "pending",
"taxMinor": 18000,
"taxRateBps": 1800,
"totalMinor": 118000
}Get top up invoice
get
Retrieves a paid top-up’s tax invoice (or its receipt, when it carried no tax), as JSON or a PDF.
For a top-up that was taxed, the GST tax invoice issued when it succeeded: its number (consecutive within the Indian financial year), the credit as the taxable value, the tax by head — CGST and SGST halves when the place of supply is the supplier’s state, IGST otherwise — and the total, with a credit note for each refund. For a top-up that carried no tax (type: receipt), the same figures without a number or tax. The document names the business as it stood when it was issued; a later change to your business details never changes it. As a PDF: add .pdf (/v1/balance/top-ups/{topUpId}/invoice.pdf) or send Accept: application/pdf.
Access: an organization key with the billing:read scope.
Path parameters
topUpIdstringRequired
Response 200PublicTopUpInvoice
The invoice as JSON — or as a one-page A4 PDF with .pdf on the path or Accept: application/pdf (Content-Type: application/pdf).
Show the 11 fieldsHide the fields
amountMinorintegerRequiredThe credit bought (the taxable value), in minor units.
creditNotesPublicTopUpCreditNote[]RequiredOne credit note per refund of a taxed top-up, oldest first; empty when nothing was refunded.
6 fields of
creditNotesamountMinorintegerRequiredThe credit this refund returned, in minor units.
idstring (uuid)RequiredissuedAtstring (date-time)RequirednumberstringRequiredtaxMinorintegerRequiredThe tax refunded with it, in minor units.
totalMinorintegerRequired
currencystringRequiredissuedAtstring (date-time)RequiredWhen the invoice was issued (the receipt: when it was paid).
numberstring | nullRequiredThe tax invoice’s number, consecutive within the Indian financial year (April to March); null for a receipt.
objectstringRequiredOne of
top_up_invoicetaxPublicTopUpInvoiceTax | nullRequiredThe tax by head; null for a receipt.
5 fields of
taxcgstMinorintegerRequiredCentral GST, in minor units: half the tax when the place of supply is the supplier’s own state, else
0.igstMinorintegerRequiredIntegrated GST, in minor units: the whole tax when the place of supply is another state, else
0.placeOfSupplystringRequiredThe GST state code of the place of supply: the state of your GSTIN or verified address, else the supplier’s.
rateBpsintegerRequiredThe GST rate in basis points (
1800is 18%).sgstMinorintegerRequiredState GST, in minor units: the other half when the place of supply is the supplier’s own state, else
0.
taxMinorintegerRequiredtopUpIdstring (uuid)RequiredtotalMinorintegerRequiredtypestringRequiredtax_invoice: a numbered GST invoice, issued when a taxed top-up succeeded.receipt: the top-up carried no tax, so there is no tax invoice — a plain receipt of the payment.One of
tax_invoicereceipt
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — no such top-up.409BILLING_INVOICE_UNAVAILABLE — the top-up has not been paid, so it has no invoice yet.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/balance/top-ups/TOP_UP_ID/invoice' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"amountMinor": 100000,
"creditNotes": [
{
"amountMinor": 50000,
"id": "ID",
"issuedAt": "2026-11-05T10:00:00.000Z",
"number": "CN/26-27/000004",
"taxMinor": 9000,
"totalMinor": 59000
}
],
"currency": "INR",
"issuedAt": "2026-11-05T10:00:00.000Z",
"number": "TC/26-27/000123",
"object": "top_up_invoice",
"tax": {
"cgstMinor": 9000,
"igstMinor": 0,
"placeOfSupply": "27",
"rateBps": 1800,
"sgstMinor": 9000
},
"taxMinor": 18000,
"topUpId": "TOP_UP_ID",
"totalMinor": 118000,
"type": "tax_invoice"
}List invoices
get
Lists monthly statements of the prepaid ledger, newest first (the running month is open).
One statement per UTC calendar month, from the first month the ledger has an entry: 12 a page by default (at most 24), and nextCursor passed as before reads older months. Each is computed from the prepaid ledger as it stands and always balances (opening plus its lines is closing); the running month moves until it ends. paidFor breaks down what the wallet paid for other organizations (an integration’s organizations billed to it), by organization. A month’s CSV is at GET /v1/invoices/{period}/csv.
Access: an organization key with the billing:read scope.
Query parameters
limitintegerbeforestringMonths strictly before this one (
YYYY-MM): anextCursor.
Response 200PublicInvoicePage
dataPublicInvoice[]RequiredIts fields are listed under Get invoice
nextCursorstring | nullRequiredPass as
beforefor the next (older) page; null on the last page.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/invoices' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"data": [
{
"closingBalanceMinor": 83125,
"creditsMinor": 210000,
"currency": "INR",
"debitsMinor": 176875,
"id": "2026-10",
"lines": [
{
"amountMinor": -45500,
"count": 1820,
"description": "SMS usage",
"kind": "top_up"
}
],
"object": "invoice",
"openingBalanceMinor": 50000,
"paidFor": [
{
"amountMinor": -45500,
"count": 1,
"externalReference": "biz_8c1f",
"organizationId": "ORGANIZATION_ID"
}
],
"period": "2026-10",
"periodEnd": "2026-11-05T10:00:00.000Z",
"periodStart": "2026-11-05T10:00:00.000Z",
"status": "open"
}
],
"nextCursor": "2026-05"
}Get invoice
get
Retrieves one month’s statement (YYYY-MM): opening and closing balance, credits, usage by channel, number and plan fees.
A UTC calendar month computed from the prepaid ledger: the opening balance (every entry before the month), credits, usage by channel, number and plan fees, and the closing balance — opening plus the lines always equals closing. The running month is open and changes until it ends; a past month before any activity reads zero. The same statement as CSV is at GET /v1/invoices/{period}/csv.
Access: an organization key with the billing:read scope.
Path parameters
periodstringRequired
Response 200PublicInvoice
The statement as JSON — or as a PDF with .pdf on the period (/v1/invoices/2026-10.pdf) or Accept: application/pdf — one A4 page, Content-Type: application/pdf.
Show the 13 fieldsHide the fields
closingBalanceMinorintegerRequiredAlways
openingBalanceMinor+ the sum oflines.creditsMinorintegerRequiredThe positive lines.
currencystringRequireddebitsMinorintegerRequiredThe negative lines, as a positive number.
idstringRequiredThe month,
YYYY-MM.linesPublicInvoiceLine[]Required4 fields of
linesamountMinorintegerRequiredSigned minor units of
currency: credits positive, spend negative.countintegerRequiredLedger entries folded into the line.
descriptionstringRequiredkindstringRequiredCredits by kind (
top_up,trial_credit,adjustment,refund,plan_fee_credit), usage by channel (voice,sms,whatsapp,email; re-rating adjustments fold into their channel;messagingis usage whose message was since erased), fees (plan_fee,number_setup,number_rental), and credit moved between a parent organization and its subaccounts (transfer_in,transfer_out).One of
top_uptrial_creditadjustmentrefundplan_feeplan_fee_creditvoicesmswhatsappemailmessagingnumber_setupnumber_rentaltransfer_intransfer_out
objectstringRequiredOne of
invoiceopeningBalanceMinorintegerRequiredpaidForPublicInvoicePaidFor[]RequiredP4: the part of
linesthis wallet paid for other organizations — an integration’s organizations billed to it — by organization, the largest spend first. Empty when the wallet paid for its own organization only.4 fields of
paidForamountMinorintegerRequiredSigned minor units: its charges (negative) net of what was credited back.
countintegerRequiredLedger entries attributed to it.
externalReferencestring | nullRequiredThe integration’s own reference for the organization; null once it is erased.
organizationIdstring (uuid)Required
periodstringRequiredThe UTC calendar month.
periodEndstring (date-time)RequiredExclusive: the first instant of the next month.
periodStartstring (date-time)RequiredstatusstringRequiredopenwhile the month runs;closedonce it has ended.One of
openclosed
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.404NOT_FOUND — not aYYYY-MMmonth, or one in the future.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/invoices/PERIOD' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"closingBalanceMinor": 83125,
"creditsMinor": 210000,
"currency": "INR",
"debitsMinor": 176875,
"id": "2026-10",
"lines": [
{
"amountMinor": -45500,
"count": 1820,
"description": "SMS usage",
"kind": "top_up"
}
],
"object": "invoice",
"openingBalanceMinor": 50000,
"paidFor": [
{
"amountMinor": -45500,
"count": 1,
"externalReference": "biz_8c1f",
"organizationId": "ORGANIZATION_ID"
}
],
"period": "2026-10",
"periodEnd": "2026-11-05T10:00:00.000Z",
"periodStart": "2026-11-05T10:00:00.000Z",
"status": "open"
}Get pricing
get
Retrieves the plan’s prices: the per-minute cells (by channel, call type and destination) and the per-message cells.
The rate card of the organization’s plan: per-minute voice rates by direction, carrier, call type and destination, and per-message rates by channel, category and country (an SMS is priced per segment). A null destination is the every-destination rate; otherwise the longest match prices a call (+447 beats GB beats +44), and a destination or SMS country no rate covers is not offered. An organization on no plan reads plan: null with empty lists.
Access: an organization key with the billing:read scope.
Response 200PublicPricing
messagesPublicMessageRate[]RequiredThe plan’s per-message cells. A combination absent here is not offered (
BILLING_RATE_UNAVAILABLE).5 fields of
messagescategorystringRequiredOne of
marketingutilityauthenticationserviceemailchannelstringRequiredOne of
whatsappemailsmscountrystring | nullRequiredSMS: the destination country this price is for — a country with no cell is not offered. Null on other channels.
ratePerMessageMinorintegerRequiredMinor units per unit. 0 is a real, free price.
unitstringRequiredSMS is priced per segment; everything else per message.
One of
segmentmessage
objectstringRequiredOne of
pricingplanPublicPricingPlan | nullRequiredNull for an organization not enrolled on a plan yet.
7 fields of
plancodestringRequiredcurrencystringRequiredincludedMinutesintegerRequiredCall minutes in each period’s bundle.
minimumTopUpMinorintegerRequiredThe smallest top-up accepted, minor units.
monthlyFeeMinorintegerRequiredMinor units, debited at each period start.
namestringRequiredtrialDaysintegerRequired
voicePublicVoiceRate[]RequiredThe plan’s per-minute cells. A combination absent here is not offered on the plan: such a dial is refused (
BILLING_RATE_UNAVAILABLE).5 fields of
voicecallTypestringRequiredHow the call is run: by a person (
manual), by an AI agent (full_ai), or both (hybrid).One of
manualfull_aihybriddestinationstring | nullRequiredNull: every destination. Otherwise an ISO country (
GB) or an E.164 prefix of up to six digits (+447). The longest match prices a call (+447beatsGBbeats+44); a number no cell covers is not offered.directionstringRequiredOne of
outboundinboundproviderstringRequiredThe channel (carrier) the call goes over — as
provideron a call. Only the channels this deployment runs, by their public names; a telecaller’s own handset is never priced here.One of
airtelexotelplivotelnyxtwilioratePerMinuteMinorintegerRequiredMinor units per billed minute.
Errors
400VALIDATION_FAILED — the request is malformed.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING or API_KEY_KIND_MISMATCH — the key may not call this endpoint.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/pricing' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"messages": [
{
"category": "marketing",
"channel": "whatsapp",
"country": "IN",
"ratePerMessageMinor": 1,
"unit": "segment"
}
],
"object": "pricing",
"plan": {
"code": "GROWTH",
"currency": "INR",
"includedMinutes": 1,
"minimumTopUpMinor": 1,
"monthlyFeeMinor": 1,
"name": "Growth",
"trialDays": 1
},
"voice": [
{
"callType": "manual",
"destination": "+447",
"direction": "outbound",
"provider": "airtel",
"ratePerMinuteMinor": 1
}
]
}List usage
get
Lists spend per UTC day, channel and destination over a window of at most 90 days.
One row per UTC day, channel (voice, sms, whatsapp, email, numbers, plan) and destination, oldest day first, over [from, to) — by default the last 30 UTC days, today included; filter by channel, and (a parent’s key, with subaccounts:read too) read one of your subaccounts’ spend with subaccountId — the answer names it. Each row counts the rated items, the billed and included units (minutes, SMS segments, messages or fees) and the amount charged; numbers carries number setup and rental fees, plan the plan fee net of any credit back. Refunded and unrated messages are not spend, and test-mode traffic is never rated, so it never appears. With breakdown=organization the rows cover everything your wallet paid for in the window — your own usage and that of every organization billed to it (an integration’s organizations, when yours is the integration’s billing organization) — each naming its organizationId.
Access: an organization key with the billing:read scope.
Query parameters
fromstring (date-time)Inclusive start (an ISO 8601 date — midnight UTC — or date-time). Default: the start of the UTC day 29 days before
to(30 daily buckets).tostring (date-time)Exclusive end. Default: now. At most 90 days after
from.channelstringOnly this channel’s rows.
One of
voicesmswhatsappemailnumbersplansubaccountIdstring (uuid)A parent’s key reads one of its subaccounts’ spend instead of its own (also needs
subaccounts:read). Another organization’s id, or one that is not your subaccount, is404.breakdownstringP4: break the rows down by organization — your own usage and that of every organization your wallet paid for in the window (an integration’s organizations billed to it), each row naming its
organizationId. Not withsubaccountId.One of
organization
Response 200PublicUsage
breakdownstringP4:
organizationwhen the rows are broken down by organization.One of
organizationdataPublicUsageRow[]RequiredOne row per UTC day × channel × destination × currency with any usage, oldest day first. Days with none are absent.
10 fields of
dataamountMinorintegerRequiredSpent, in minor units of
currency. A credit back (a plan change) is negative.billedUnitsintegerRequiredMinutes billed (whole minutes, one minimum once answered), SMS segments, messages, or fees.
channelstringRequirednumbers: number setup fees and monthly rentals;plan: the plan’s monthly fee (net of the credit back a plan change gives).One of
voicesmswhatsappemailnumbersplancountintegerRequiredVoice: calls rated (answered or not). Messages: messages charged. Numbers and plan: ledger entries.
currencystringRequireddatestringRequiredThe UTC day.
destinationstring | nullRequiredVoice: the rate cell’s destination that priced the calls — an ISO country or a
+prefix of up to six digits; SMS: the destination country. Null when the every-destination cell priced it, on WhatsApp, email, numbers and the plan, and for a message erased since.includedUnitsintegerRequiredVoice minutes the plan’s included bundle covered (not charged); 0 on every other channel.
organizationIdstring (uuid)P4: whose spend the row is — only when the read is broken down by organization (
breakdown=organization).unitstringRequiredOne of
minutesegmentmessagefee
fromstring (date-time)RequiredInclusive.
objectstringRequiredOne of
usageorganizationIdstring (uuid)P4: the organization whose spend this is, on an integration’s read of one of its organizations.
subaccountIdstring (uuid) | nullRequiredThe subaccount whose spend this is (
subaccountIdwas asked); null for your own.tostring (date-time)RequiredExclusive.
Errors
400VALIDATION_FAILED —from/tois not an ISO 8601 date or date-time,tois not afterfrom, the window spans more than 90 days,subaccountIdis not a UUID, orbreakdownis asked withsubaccountId.401API_KEY_INVALID — missing, unknown, revoked or expired key.403API_KEY_SCOPE_MISSING —subaccountIdneedssubaccounts:readas well.404NOT_FOUND —subaccountIdis not one of your organization’s subaccounts.429RATE_LIMITED — retry afterRetry-Afterseconds.500INTERNAL_ERROR — our fault; retry with backoff (with the same Idempotency-Key on a write).
curl 'https://api.trovacast.com/v1/usage?from=2026-10-01&to=2026-11-01&channel=voice' \
-H "Authorization: Bearer $TROVACAST_API_KEY"{
"breakdown": "organization",
"data": [
{
"amountMinor": 1,
"billedUnits": 1,
"channel": "voice",
"count": 1,
"currency": "INR",
"date": "2026-11-04",
"destination": "GB",
"includedUnits": 1,
"organizationId": "ORGANIZATION_ID",
"unit": "minute"
}
],
"from": "2026-11-05T10:00:00.000Z",
"object": "usage",
"organizationId": "ORGANIZATION_ID",
"subaccountId": "SUBACCOUNT_ID",
"to": "2026-11-05T10:00:00.000Z"
}