Balances
Reference for the workspace balance: the one balance in USD, the statement entries that moved it, and the myBalance and myBalanceEntries queries.
The prepaid balance the caller's workspace holds, the statement of postings that moved it, and the queries that read them.
Queries
myBalance
The caller's own workspace's balance. Opened at zero if nothing has opened it yet.
myBalance: BillingBalance!Output types:
myBalanceEntries
The movements of the caller's own workspace's balance, newest first, as a statement.
balanceAfter is a property of the journal, not of this ordering: an entry carries the same running total whichever direction you read in. Reversing the direction reverses the order lines arrive in and nothing else.
myBalanceEntries(
filter: BillingBalanceEntryFilter
first: Int
after: String
last: Int
before: String
orderBy: BillingBalanceEntryOrder = { field: CREATED_AT, direction: DESC }
): BillingBalanceEntryConnection!Arguments
filter
BillingBalanceEntryFilter
Filtering options for the returned entries.
orderBy
BillingBalanceEntryOrder
The ordering options for the returned entries.
Input types:
Output types:
Objects
BillingBalance
The prepaid balance a workspace holds. A workspace holds exactly one, in USD.
amount is signed: negative means the workspace owes. It is a running total kept in step with the workspace's posting journal, and the journal — the balance's statement entries — stays the source of truth for how the total was reached.
Implements: Node
id
ID!
A globally unique identifier. This ID is opaque and should not be parsed by clients.
workspaceId
ID!
The workspace this balance belongs to.
createdAt
When the balance was opened: on the workspace's creation, its first read, or its first posting, whichever came first.
BillingBalanceEntry
One movement of a workspace's balance, as a line on a statement.
Not stored as such: an entry is a posting together with the document that justifies it, and balanceAfter is derived at read time rather than stored against the posting. A payment whose valueDate falls before existing entries therefore shifts every line after it, the way a statement should, instead of leaving a stale snapshot behind.
An entry is identified but not addressable — there is no node(id:) lookup for one, because a line only means anything within the statement that produced it.
id
ID!
The identifier of the posting behind this entry.
balanceAfter
The balance total immediately after this entry. Independent of the ordering you requested.
description
String
What the justifying document has to say for itself: a correction's reason, an invoice's number, a payment's note. Null whenever that document has nothing to say, which is routine for a TOP_UP -- the line is labelled by its type, so there is nothing the accountant has to type. Not a ready-to-display label. The label belongs to type and needs translating; this is the operator's or the document's own words and does not.
authoredBy
ID!
The actor on whose authority the posting was made — the staff member behind a correction, the accountant who entered a top-up, or the service account behind a charge. Never absent: every posting is attributable. An id, not a name: billing does not hold actors, so rendering a person needs a second lookup.
Inputs
BillingBalanceEntryFilter
Filtering options for balance entries.
Narrowing a statement to a period does not restart its running totals: balanceAfter still accumulates over the whole journal, so the first line of a period carries the balance carried into that period rather than the period's own subtotal.
Only time is filterable, and that is a constraint rather than an oversight — a statement window has to stay a contiguous run of the journal for its running totals to mean anything. Dropping, say, every charge and keeping the corrections would leave each surviving line with a total that no sequence of shown lines adds up to.
BillingBalanceEntryOrder
Ordering options for balance entries.
Enums
BillingBalanceEntryType
What moved a balance.
INVOICE
A charge issued against the balance.
CORRECTION
A staff-authored correction, in either direction.
TOP_UP
Money the customer sent, credited to the balance. Distinct from a correction on purpose: one is cash taken in, the other is revenue given away, and a statement that called both a correction would make the two impossible to tell apart.
BillingBalanceEntryOrderField
Fields available for ordering balance entries.
CREATED_AT
Order by the time the posting happened.
Pagination types
BillingBalanceEntryConnection
A page of balance entries.
Implements: Connection
BillingBalanceEntryEdge
An edge in the BillingBalanceEntry connection.
Implements: Edge
cursor
String!
A cursor for use in pagination.
See also
Last updated
Was this helpful?