Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
ReferenceBeta

Invoices

The invoices of the caller's workspace: what each one charges for each billing period, its lines, its status, and the queries that read them.

Queries

myInvoice

One of the caller's own workspace's invoices; null when it does not exist or belongs to another workspace.

myInvoice(id: ID!): BillingWorkspaceInvoice

Arguments

Name
Type
Description

id

ID!

The ID of the invoice to retrieve.

Output types:

BillingWorkspaceInvoice

One of the caller's own workspace's invoices: its charge for every complete billing period of its subscriptions that no invoice covered yet, as of one pass. periodStart and periodEnd span the periods covered. The total is posted to the balance as the INVOICE entry on its statement.

status is PAID at issue when the balance covers the total, and ISSUED when the invoice opens a debt. Payments are not tied to invoices and settle the oldest invoices first; the payment that covers an invoice marks it PAID and sets paidAt. Once the grace period has passed (dueAt), the daily pass marks an unpaid one OVERDUE.

Field
Type
Description

id

ID!

workspaceId

ID!

The workspace being charged: the one the token names.

invoiceNumber

String!

The number shown to people, unique across all invoices of the platform.

periodStart

First instant of the earliest billing period covered.

periodEnd

End of the latest billing period covered, exclusive.

subtotal

Sum of the line items, before adjustments.

priceModify

Signed adjustment applied to the subtotal — a discount is negative.

total

What the customer owes: subtotal plus priceModify.

status

Current lifecycle status.

issuedAt

When the invoice was issued. Its place in a list is this, not createdAt.

dueAt

When payment is due.

paidAt

When it was paid; null while it is not.

lineItems

The lines, in display order: per covered period, the period fees, then every metric of the plan, then the line-item submissions.

createdAt

updatedAt


myInvoices

The caller's own workspace's invoices, newest issue date first.

The workspace is not an argument. It is the one the caller's token names; a token carrying no workspace claim is refused.

Arguments

Name
Type
Description

filter

BillingWorkspaceInvoiceFilter

Filtering options for the returned invoices.

first

Int

The first n elements from the paginated list.

after

String

The elements that come after the specified cursor.

last

Int

The last n elements from the paginated list.

before

String

The elements that come before the specified cursor.

orderBy

BillingInvoiceOrder

The ordering options for the returned invoices.

Input types:

BillingWorkspaceInvoiceFilter

Filtering options for the caller's own invoices. Fields combine with AND.

Field
Type
Description

status

Keep only invoices in this status.

issuedFrom

Keep only invoices issued at or after this instant.

issuedTo

Keep only invoices issued at or before this instant.

BillingInvoiceOrder

Ordering options for invoices.

Field
Type
Description

field

The field to order by.

direction

The direction to order.

Output types:

BillingWorkspaceInvoiceConnection

A page of the caller's own workspace's invoices.

Implements: Connection

Field
Type
Description

edges

A list of edges.

nodes

A list of nodes in the connection (without edge metadata).

pageInfo

Information about the current page.

total

The total count of items matching the filter.


Objects

BillingWorkspaceInvoice

One of the caller's own workspace's invoices: its charge for every complete billing period of its subscriptions that no invoice covered yet, as of one pass. periodStart and periodEnd span the periods covered. The total is posted to the balance as the INVOICE entry on its statement.

status is PAID at issue when the balance covers the total, and ISSUED when the invoice opens a debt. Payments are not tied to invoices and settle the oldest invoices first; the payment that covers an invoice marks it PAID and sets paidAt. Once the grace period has passed (dueAt), the daily pass marks an unpaid one OVERDUE.

Field
Type
Description

id

ID!

workspaceId

ID!

The workspace being charged: the one the token names.

invoiceNumber

String!

The number shown to people, unique across all invoices of the platform.

periodStart

First instant of the earliest billing period covered.

periodEnd

End of the latest billing period covered, exclusive.

subtotal

Sum of the line items, before adjustments.

priceModify

Signed adjustment applied to the subtotal — a discount is negative.

total

What the customer owes: subtotal plus priceModify.

status

Current lifecycle status.

issuedAt

When the invoice was issued. Its place in a list is this, not createdAt.

dueAt

When payment is due.

paidAt

When it was paid; null while it is not.

lineItems

The lines, in display order: per covered period, the period fees, then every metric of the plan, then the line-item submissions.

createdAt

updatedAt


BillingWorkspaceInvoiceLineItem

One line of a workspace's invoice: a period fee, a metric's priced usage, or a line-item submission passed through. amount is quantity × unitPrice rounded half up to the minor unit, except on a line-item submission that carried its own amount.

Field
Type
Description

id

ID!

description

String!

What the line charges for, ending with the billing period it belongs to, as , 2026-01-15 – 2026-02-14.

quantity

Float!

Units charged: the share of the month on a period-fee line, the aggregated usage over the included limit on a metric line, the quantity as submitted on a line-item line. metric.unit names the unit.

unitPrice

Price of one unit in the invoice's currency.

amount

The line's total.

productDomain

The product the line belongs to.

metric

The metric the line prices; null on a period-fee line and on a line-item submission's line.

subscriptionId

ID

The subscription the line charges for, as in mySubscriptions.

planId

ID

The plan that priced the line; the subscription's branch, when it has one, overrode this plan's fee and prices.

periodStart

First instant of the billing period the line belongs to.

periodEnd

End of that billing period, exclusive.

createdAt


Inputs

BillingInvoiceOrder

Ordering options for invoices.

Field
Type
Description

field

The field to order by.

direction

The direction to order.


BillingWorkspaceInvoiceFilter

Filtering options for the caller's own invoices. Fields combine with AND.

Field
Type
Description

status

Keep only invoices in this status.

issuedFrom

Keep only invoices issued at or after this instant.

issuedTo

Keep only invoices issued at or before this instant.


Enums

BillingInvoiceStatus

Lifecycle of an invoice. Billing writes ISSUED, PAID and OVERDUE; DRAFT and VOID are reserved and never set.

Value
Description

DRAFT

Assembled but not yet issued to the customer.

ISSUED

Issued and outstanding.

PAID

Settled.

OVERDUE

Issued, past its due date, still outstanding.

VOID

Cancelled without being paid.


BillingInvoiceOrderField

Fields available for ordering invoices.

Value
Description

ISSUED_AT

Order by the day the invoice was issued.


Pagination types

BillingWorkspaceInvoiceConnection

A page of the caller's own workspace's invoices.

Implements: Connection

Field
Type
Description

edges

A list of edges.

nodes

A list of nodes in the connection (without edge metadata).

pageInfo

Information about the current page.

total

The total count of items matching the filter.


BillingWorkspaceInvoiceEdge

An edge in the BillingWorkspaceInvoice connection.

Implements: Edge

Field
Type
Description

cursor

String!

An opaque cursor for this edge.

node

The invoice at the end of the edge.


See also

Last updated

Was this helpful?