Skip to main content
GET
Billing transactions
Your billing history as a statement: every change to the credit balance in a window, newest first, and the balance at each end of it. It is the same history Settings → Billing → Transaction History shows in the dashboard.
  • Top-ups, credits from Yappr, refunds, adjustments and phone numbers come back one row each.
  • A starting balance — credits Yappr put on the account with no transaction behind them — comes back as one starting_balance row, so every credit in the balance has a line.
  • Usage comes back as one row per day per product — voice_call for calls, eval_run for Agent Eval runs — with count saying how many charges the row folds. A busy day is one line, not hundreds. A call that cost nothing is not a charge, so a day’s count can be lower than the calls Call Logs lists for it.
  • summary is the window’s statement, and it always adds up: opening_balance_cents + credits_in_cents - credits_out_cents = closing_balance_cents.
  • A top-up carries payment: what the card was charged, VAT included, the VAT, and the invoice number when there is an invoice — what you need to match it to a card statement or an invoice.
  • What the card was charged is summary.card_charges_cents: the window’s top-ups and phone-number charges, before VAT, each part on its own field.
  • Each of your numbers is in phone_number_rent, saying whether Yappr charges its monthly rent and when it next renews — so a window with no phone_number row says why.
  • One row can be read on its own with GET /billing/transactions/{id}, and the whole window as a file with format=csv.

Row types

Usage and starting_balance rows have no id: a usage row folds a day of charges, and a starting balance has no transaction behind it. description is null on usage and starting_balance rows — the dashboard and the file name them from their type (see As a file); on every other row it is the description the billing system wrote for it, such as Credits top-up or Auto top-up. affects_balance is on every row: false for a phone number and for a row whose status is not completed or in_progress (a top-up whose payment failed, say).

What the card was charged

summary.card_charges_cents is everything charged to the card in the window, before VAT: card_top_ups_cents (the credits the window’s paid top-ups bought — every one, even when has_more cut rows from the list) plus card_phone_numbers_cents (numbers’ first charges and monthly renewals, which are paid by card and never move the balance). The VAT on a top-up is in its payment. Until 1 October 2026 card_charges_cents counted the phone numbers only; that figure is now card_phone_numbers_cents.

Phone numbers and their rent

phone_number_rent lists every number the workspace has now, with whether Yappr charges its monthly rent — the same rent and next_renewal_at GET /phone-numbers returns: A number whose rent is charged has a phone_number row for each renewal; a number that is included has none in the last 40 days. If the rent cannot be read the statement answers 500 rather than calling a number included.

Matching a top-up to your card statement or invoice

amount_cents on a top-up is the credits it put in, before VAT. Its payment says what was actually paid: A field the payment record does not hold is null: older top-ups may lack the VAT or the total, and for those the row’s date and amount_cents are what there is to match. The payment processor’s own ids are never returned — they are on nothing you hold. payment is null on every row that is not a top-up.

One row

GET /billing/transactions/{id} reads one row by its id — the same shape as in the list, with timezone. Usage and starting_balance rows have no id: a day folds many charges, and one call’s cost is on GET /calls/{id}. A call’s id is not a transaction id; asked for one, the answer says so.

As a file

format=csv answers the window as the file Export CSV gives in the dashboard, under the same name — transactions-<first day>_<last day>-<day read>.csv, the window’s days on the statement’s clock and the day it was read (the dashboard’s All time is transactions-all-time-<day read>.csv). Accept: text/csv with no format does the same. The file is a byte-order mark, then a header line, the opening balance, every row oldest first with the balance it left, the closing balance, and when it was read; every line, the last one included, ends with a newline. The balances are in Balance after (credits) and Balance after (USD) — never in Amount (USD) — so a sum of Amount (USD) is the window’s movement. The file holds up to 1,000 rows (limit can lower that, and a higher one is refused). A window with more is cut to its newest rows: the file then opens with Balance before the first row listed rather than the window’s opening balance, dated at that first listed row rather than at the window’s start, so every balance follows from the line above it; the line after the opening balance says the file was cut, and its name ends in -partial (transactions-2026-07-01_2026-09-30-2026-09-30-partial.csv).
Saved as transactions-2026-07-01_2026-09-30-2026-09-30.csv:
ID is the row’s id in the JSON, so two same-day top-ups of the same amount can each be joined to their payment. A usage row has no id, so its ID is its day key — <date>:<product>, such as 2026-09-23:voice_call — which is not a transaction id; a starting balance’s is empty. Credits is empty on a row that did not move the balance (a phone number, paid by card). A top-up’s line carries its payment: Card charged (USD) (VAT included), VAT (USD) (empty when not recorded), Paid via (Checkout, Automatic top-up or Saved card) and Invoice number. Calls on a day of calls is that day’s GET /calls/export, from its first to its last moment on the statement’s clock. It is an API link: opening it needs your key in the Authorization header, as every API call does, so a browser opening it bare is answered 401 MISSING_KEY. The dashboard’s Export CSV links each day to that day in the dashboard’s Call Logs instead, which the reader opens signed in. The file names each row in words rather than codes:

The starting balance

The ledger does not say when a starting balance was set, so its row is dated when the workspace’s credit account was opened (or at its first transaction, if that is earlier). Before that date the balance is 0: a window that ends before it opens and closes at 0 with no rows, and a window that holds it counts it in credits_in_cents. All time therefore opens at 0, and the starting balance is its first line. A workspace whose transactions explain its whole balance has no such row.

Today’s row

Usage for today — the current day on the statement’s clock — comes back with status: "in_progress": the day is still running, so its amount_cents and count can still grow. Every earlier day is completed. as_of says when the statement was read.

From a row to its charges

A usage row is a day on the statement’s clock, range.timezone. To read that day’s calls one by one with GET /calls, or export them with GET /calls/export, send the day’s first and last moment with that clock’s offset on the day. For a row dated 2026-09-12 in an Asia/Jerusalem workspace that is from=2026-09-12T00:00:00%2B03:00&to=2026-09-12T23:59:59.999999%2B03:00. Those endpoints read a date on its own as a UTC day, so from=2026-09-12&to=2026-09-12 there would be 3 hours off the row. A statement read with timezone=UTC has UTC days, and plain dates line up with it. The calls still do not add up to the row one for one. The list holds every call that started that day, free ones included (cost_status: "not_charged"), while count counts charges only. A call is charged when it ends, so a call that runs past midnight is on the next day’s row. Agent Eval charges are on GET /agent-eval/runs.

Signs

Amounts are signed for you, the account holder: positive put credits in, negative took them out. GET /billing/consumption reports the other way round — a charge is a positive total_amount_cents there — because it adds up spending rather than a balance. Both are in cents, before VAT.

Days on your clock

Days are the workspace’s own — the clock set with timezone on PUT /call-windows, the one the dashboard’s Transaction History and GET /billing/consumption read by default. A workspace that has not set a clock reads UTC. A charge at 22:30 UTC on 30 September is 1 October in an Asia/Jerusalem workspace, and its usage row is dated 2026-10-01. A date-only from or to is a whole day on that clock; a value with a time in it means that moment, whatever the zone. Pass timezone to read the statement on another clock — timezone=UTC gives UTC days. It is an IANA name (Asia/Jerusalem, Europe/London, UTC); an offset such as +03:00 or a name the API does not know is refused with 400 TRANSACTIONS_QUERY_INVALID. range in the response is the window that was read — its first and last moment as instants, and timezone, the clock its days are on — whatever form from and to were sent in. A window that starts or ends inside a day gives that day’s usage row only the charges inside the window: from=2026-09-12T12:00:00Z makes the 12th’s row the afternoon’s charges, still dated 2026-09-12. Send dates to read whole days.

Reconciling a month

closing_balance_cents is worked back from the balance now, so the closing balance of a window that runs to now is the balance GET /billing returns, and last month’s closing balance is this month’s opening one. With the same from, to and timezone — or none, since both follow the workspace’s clock — credits_out_cents for a month is its usage, the voice_call and eval_run totals GET /billing/consumption reports for it, plus any refunded top-up, negative adjustment or negative starting balance that took credits out.

Parameters

to defaults to now and from to 30 days before to — so ?to=2026-07-31 alone reads July 1 through July 31 — and a date-only to covers that whole day on the statement’s clock. With both left out the window is the 30 × 24 hours before now, which is not the dashboard’s Last 30 days (30 whole days on the workspace’s clock, today included): to read the same days, send from as the date 29 days before today. With to left out, a from after now is refused. limit caps the rows (default 100, at most 500; a higher one is refused with 400 TRANSACTIONS_QUERY_INVALID, naming the file) — never the summary, which always covers the whole window — and has_more says the list was cut short. Rows come newest first and usage is a row per day per product, so over a long window the default 100 rows can end months before its older top-ups: when has_more: true, those rows are not in this page, though summary still counts them. Follow next_cursor to read them (see Reading every row), or ask for the file (up to 1,000 rows). cursor is the next_cursor of the page before; it pages the JSON list only, and with format=csv it is refused. format is json (the default) or csv. Anything other than from, to, limit, timezone, format and cursor is refused with 400 TRANSACTIONS_QUERY_INVALID, by name. A key limited to some agents is refused with 403 API_KEY_AGENT_SCOPED: the balance is the whole workspace’s.

Reading every row

A page holds at most limit rows. When has_more is true, next_cursor reads the rest: send it as cursor with the same from, to, timezone and limit as the page that gave it, and repeat until next_cursor is null. Every row comes back once, in order — a day whose rows are split across two pages loses none of them — and every page carries the whole window’s summary, so the rows of all the pages add up to it.
The cursor keeps the window the first page read, so a window that runs to now ends where it did on the first page. It is opaque and signed with the query it was cut for: one sent with another from, to, timezone or limit, from another workspace, or edited, is refused with 400 TRANSACTIONS_CURSOR_INVALID — read the first page again and follow its next_cursor. Stepping the window back by date (to set to the day before the last date returned) drops the rest of a day that the limit split, so do not page that way.

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Query Parameters

from
string<date-time>

Start of the window. Defaults to 30 days before to (30 × 24 hours before now when to is left out as well — not the dashboard's "Last 30 days", which is 30 whole days on the workspace's clock). A date-only value starts at that day's first moment on the statement's clock. With to left out, a from after now is 400. A window that starts or ends inside a day gives that day's usage row only the charges inside the window; send dates to read whole days.

to
string<date-time>

End of the window, inclusive. Defaults to now. A date-only value covers that whole day on the statement's clock, up to its last moment.

timezone
string

The clock days and date-only windows are read on, as an IANA name. Defaults to the workspace's clock, like GET /billing/consumption; timezone=UTC reads UTC days. An offset such as +03:00, or a name the API does not know, is 400 TRANSACTIONS_QUERY_INVALID. The response names the clock used in range.timezone.

Example:

"Asia/Jerusalem"

limit
integer
default:100

Most rows to return, newest first. A bigger number is 400 TRANSACTIONS_QUERY_INVALID. summary always covers the whole window; has_more says the list was cut short — over a long window the default can end before its older top-ups, so follow next_cursor to read them, or ask for the file. Not a whole number, or 0, is 400. With format=csv the default and the maximum are 1,000, as in the dashboard's file; above that is 400 too.

Required range: 1 <= x <= 500
cursor
string

The next_cursor of the page before. Send it with the same from, to, timezone and limit as that page: every row of the window comes back once, in order, even when a page ends inside a day, and every page carries the whole window's summary. A cursor sent with other parameters, from another workspace, edited or built by hand is 400 TRANSACTIONS_CURSOR_INVALID. It pages the JSON list; with format=csv it is 400 TRANSACTIONS_QUERY_INVALID.

format
enum<string>
default:json

csv answers the statement as a file, the dashboard's Export CSV (so does Accept: text/csv with no format). Anything else is 400 TRANSACTIONS_QUERY_INVALID.

Available options:
json,
csv

Response

The window's rows and its statement — or, with format=csv, the same statement as a file

A byte-order mark, then one quoted line each, every line ending with a newline: Date,Description,Type,Status,Amount (USD),Credits,Balance after (credits),ID,Balance after (USD),Card charged (USD),VAT (USD),Paid via,Invoice number,Calls; the opening balance (in the two balance columns, never in Amount, so a sum of Amount is the window's movement); when the window holds more rows than the file, a line saying so - and the first line is then the balance before the first row listed, dated at that row, so the balances chain; every row oldest first with the balance after it (Credits empty where the row did not move the balance; ID the row's id, or a usage row's day key <date>:<product>; a top-up's payment in the four payment columns; a day of calls' GET /calls/export link in Calls); the closing balance; Figures as of YYYY-MM-DD HH:MM <clock>. Served as an attachment named transactions-<first day>_<last day>-<day read>.csv (…-partial.csv when cut), the name the dashboard's Export CSV gives the same window.