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

Reading invoices

List your workspace's invoices, read the lines of one invoice, match it to the balance statement, and find the invoices that are still unpaid.

This guide shows how to read your workspace's invoices through the Billing API. You will list the invoices, read one invoice with its lines, and find the balance statement entry that charged it. You will also learn how an invoice becomes paid or overdue, and what to do with an overdue invoice.

Every operation on this page reads the data of the workspace named by your access token. You never pass a workspace ID, so a request can't read the invoices of another workspace.

Prerequisites

You need an access token whose workspace_id claim names the workspace. The Billing my* operations, the operations named with the prefix my such as myInvoices and myInvoice, read that claim. Without it, they refuse the request. See Authentication to learn how the API identifies the workspace.

To check that the token names a workspace and that Billing accepts it, count the workspace's invoices with this query:

query InvoiceCheck {
  billing {
    myInvoices(first: 1) {
      total {
        count
      }
    }
  }
}

Response for a workspace that has 3 invoices:

{
  "data": {
    "billing": {
      "myInvoices": {
        "total": { "count": 3 }
      }
    }
  }
}

A count of zero is a valid response: it means that Billing hasn't issued any invoice for the workspace. A PERMISSION_DENIED error instead means that the token has no workspace claim. See Error handling.

How invoices work

An invoice charges a workspace for billing periods that ended. The sections below explain what one invoice covers, how its total is charged to the balance, and how its status changes. Invoices documents every field.

What an invoice covers

A billing period is one month of a subscription. Each period starts at 00:00 UTC on the day of the month on which the subscription started. If a month has no such day, for example the 31st in September, the period starts on that month's last day. A subscription made on July 1 has periods from the 1st of each month to the 1st of the next.

Once a day, shortly after midnight UTC, Billing checks each workspace for billing periods that ended. This guide calls that check the daily pass. Each daily pass writes at most one invoice for your workspace. The invoice covers every period of every workspace subscription that ended and that no earlier invoice covered. When Navixy cancels a subscription, Billing doesn't wait for the daily pass: it invoices the subscription's last period right away, and that period ends at the cancellation.

periodStart and periodEnd span all the periods that the invoice has lines for. The start is inclusive and the end is exclusive.

What the lines are

The lines of an invoice are grouped by subscription and period. Each line description ends with the period that the line belongs to, for example , 2026-09-01 – 2026-09-30. Each period has fee lines, metric lines, and reported charge lines:

  • One fee line for each product of the plan, named Subscription: <plan> (<product code>). Its quantity is the share of the period that the subscription paid for: 1 for a full period, less for a period in which the subscription started or was cancelled. A trial is free, so only the part of the period after the trial counts.

  • One metric line for each metric of the plan, even when nothing was used. Its quantity is the usage above the included limit, combined over the period by the metric's aggregation function. Usage is charged in full during a trial too.

  • One reported charge line for each charge that a Navixy product reported for the period. A reported charge is a ready-made line with its own description, quantity, and unit price, and the invoice shows it as reported. myInvoiceLineItemSubmissions lists these charges.

amount is quantity times unitPrice, rounded half up to the minor unit. A reported charge that has its own amount keeps that amount. subtotal is the sum of the lines. Billing writes priceModify as zero, so total equals subtotal.

What happens to usage reported late

A product can report usage for a period after the daily pass that invoiced that period. Billing charges that usage in the next daily pass. When no billing period ended that day, the late usage is on an invoice of its own.

Billing prices the period's usage again, with the late usage included. When an amount changes, the invoice gets a line that starts with Correction: and names the earlier period. Its amount is the difference between the new amount and the amount already invoiced, so it's negative when the late usage lowers a charge. The invoice's periodStart is then the start of the earliest period that it corrects. A reported charge that arrives late is on the next invoice, as reported.

When the late usage changes no amount, Billing adds no line. It puts the usage on the invoice that charged its period, so the usage's invoicedAt is later than that invoice's issuedAt.

How the total is charged to the balance

Billing charges the total to your workspace's balance when it issues the invoice. The charge is an INVOICE entry on the balance statement, dated at issuedAt, with the invoice number as its description. An invoice with a total of zero adds no entry. An invoice with a total below zero, from corrections that lower an earlier charge, adds money to the balance.

How the status changes

Billing writes 3 of the 5 values of BillingInvoiceStatus: ISSUED, PAID, and OVERDUE. It never sets DRAFT or VOID.

Status
When Billing sets it

PAID

When Billing issues the invoice, if the balance after the charge is zero or more. Later, when a payment or a correction that adds money to the balance covers the invoice. An invoice with a total of zero or less is always PAID.

ISSUED

When Billing issues the invoice, if the charge leaves the balance below zero.

OVERDUE

At the first check at or after dueAt, if the invoice is still unpaid.

Billing checks the status of unpaid invoices in every daily pass, after every entry that adds money to the balance, and after it issues an invoice.

Payments aren't linked to invoices: a payment is added to the balance. Billing pays the oldest invoices first. As a result, the newest unpaid invoice becomes PAID only when the balance is zero or more. paidAt is the moment of that change. It's the moment Navixy entered the payment, not the payment's value date. A PAID invoice stays PAID.

dueAt is the end of the grace period: the time that you have to pay before the invoice becomes OVERDUE. The grace period starts at the daily pass that issued the invoice. For an invoice issued on cancellation, it starts at the cancellation.

Example scenario: An operator checks the latest invoice

TransLog GmbH runs delivery trucks out of Hamburg. Their workspace has been on the Fleet Pro plan since July 1, 2026, with a 14-day trial. The plan costs $49.00 per month, includes 10 registered devices, and charges $3.00 for each device above that. Registered assets are included in the fee. The Navixy platform reports each month's device and asset counts within about an hour after the month ends. In this example they arrive at 00:02 UTC on the first day of the next month, before the daily pass at 00:05, so each invoice charges the month that just ended. A count that arrives after the pass is charged as late usage on the next day's invoice.

On October 6, their administrator reads the workspace's invoices and checks what the latest invoice, issued on October 1, charged for. To check the latest invoice, follow these steps:

1

List the invoices

myInvoices returns your workspace's invoices, newest first by default. Ask for the number, the period, the total, and the dates that set the status.

Run this query:

Response:

The workspace has one invoice for each month since July. INV-2026-000041, for July, is $29.33. The trial made the first 2 weeks free, so the fee is $26.33, a share of 0.537351 of the $49.00 fee. The other $3.00 is for 1 device above the included 10.

The 2 older invoices were PAID when Billing issued them: paidAt equals issuedAt, because the balance covered them. INV-2026-000132 is ISSUED, because its charge left the balance below zero. It becomes OVERDUE if it's still unpaid at the first check on or after October 15, 00:05 UTC.

Request the next page with after: endCursor while hasNextPage is true. Pass the cursor back exactly as received. See Pagination for the cursor rules.

  • invoiceNumber is the number to show people and to quote to Navixy. It has the form INV-<year>-<number>. All workspaces share one sequence of numbers, so your invoice numbers aren't consecutive.

  • total is in minor units, like every amount in Billing, so $58.00 is returned as 5800.

  • issuedAt sets the place of an invoice in the list. Invoices with the same issuedAt are ordered by id, so a page stays stable across cursors.

2

Read one invoice with its lines

myInvoice returns one of your workspace's invoices by its ID, with its lines. Use the id of INV-2026-000132 from the list.

Run this query:

Response:

The invoice charges September: the $49.00 fee, and 3 devices above the included 10 at $3.00 each. In this example the Navixy platform reported 13 devices and 10 assets for September at 00:02 UTC on October 1, before the daily pass at 00:05, so both counts are on this invoice. The asset line says (Included), because the fee covers assets.

myInvoice returns null when no invoice has this ID or when the invoice belongs to another workspace. The 2 cases look the same, so an ID tells you nothing about other workspaces.

3

Render each line

Use these fields to show a line:

  • description is the text to show. It ends with the line's period: the first and the last day, in UTC. Don't parse it: read the period from periodStart and periodEnd, and the metric from metric.

  • metric is null on a fee line and on a reported charge line. Use it to tell a metric line from the others, and show metric.unit next to quantity.

  • quantity on a fee line is a share of the period, with up to 6 decimal places, not a count. Show it as a fraction or a percentage. On a metric line, it's the usage above the included limit, in metric.unit.

  • unitPrice and amount are in minor units, in the invoice currency. A correction line has a negative amount when late usage lowers a charge.

  • subscriptionId is the subscription that the line charges for, the id that mySubscriptions returns. planId is the plan of that subscription. When the subscription is on a branch, planId is the base plan's ID, and the branch set the fee and the prices.

With TIERED pricing, a metric has one line for each tier that the usage reached. When pricingModel is SUBSCRIPTION, the metric line's description carries (Included) after the metric name, its quantity is all the usage, and its unit price is zero. Older invoices show (included) in lowercase, because a line's description is stored when the invoice is issued. The Plans reference defines each pricing model.

4

Find the charge on the balance statement

The invoice total is an INVOICE entry on the statement. Read the entries since the invoice was issued with myBalanceEntries:

Response:

The entry has the date of issuedAt, the total as a negative amount, and the invoice number. Use the number to link the statement line to the invoice. The balance after the charge is -$33.33. TransLog paid $100.00 in July and received a $9.00 credit in September, and the 3 invoices charged $142.33 in all.

To have INV-2026-000132 marked PAID, the workspace has to pay at least $33.33. Navixy enters the payment from the bank transfer, and the invoice becomes PAID at that moment. Reading balance and statement shows such a payment on the statement.

Finding unpaid invoices

An unpaid invoice is ISSUED or OVERDUE. The status filter takes one value, so request each status under its own alias in one query. See Aliases to learn how aliases work. Run this query:

Response, on October 6:

INV-2026-000132 is unpaid, and no invoice of TransLog is overdue. If INV-2026-000132 is still unpaid at the first check on or after October 15, 00:05 UTC, it moves from the issued list to the overdue list.

How to handle an overdue invoice

Read the balance with myBalance. A negative amount is what the workspace owes, and it can be more than one invoice. Pay Navixy at least that amount: when the balance is zero or more, every unpaid invoice becomes PAID. A smaller payment covers the oldest invoices first. See Reading balance and statement to follow the payment on the statement.

Billing doesn't block a workspace with an overdue invoice. Whether the workspace keeps working is decided outside Billing.

Listing invoices by issue date

To show the invoices issued in a period, filter by issuedFrom and issuedTo. Both are inclusive and apply to issuedAt. To list the oldest invoice first, set orderBy to { field: ISSUED_AT, direction: ASC }. ISSUED_AT is the only sort field. Run this query:

Response:

The response has INV-2026-000041 and INV-2026-000087, oldest first. INV-2026-000132 isn't in it, because Billing issued it on October 1. The filter fields combine with AND, so add status to narrow the list further.

Error handling

The Billing operations return errors in the shared format. See Error handling for the response structure and the general codes.

Code
When it occurs
Resolution

PERMISSION_DENIED

The token has no workspace_id claim, or the claim isn't a workspace ID.

Request a token issued for the workspace.

VALIDATION_ERROR

The id of myInvoice isn't an invoice ID.

Read field and detail. Take the ID from myInvoices.

VALIDATION_ERROR

first is above 100.

Send first of 100 or less.

VALIDATION_ERROR

after or before isn't a valid cursor.

Start the list again without a cursor.

An invoice that doesn't exist and an invoice of another workspace return no error. myInvoice returns null for both:

How to handle a null invoice

Read myInvoices again and take the id from it. A token for another workspace lists other invoices, so check that the token names the workspace that the invoice belongs to.

How to handle a missing workspace claim

A request without a workspace claim returns PERMISSION_DENIED on every Billing field that it selects. Request a token issued for the workspace whose invoices you read. See Billing errors for the error response.

See also

Last updated

Was this helpful?