---
title: "The subscription, what it costs, and the invoices behind it"
method: GET
path: "/api/v1/billing"
tags: ["Billing"]
---

# The subscription, what it costs, and the invoices behind it

`GET /api/v1/billing`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/billing`
- Auth: API key in cookie `better-auth.session_token`

Read straight from Stripe on every call rather than from a copy here: a plan or a status kept in our rows goes stale the moment an owner changes it in the portal, and the portal is where they are sent to change it. Card details never reach this server. `bankAccounts` is the bank-account line of the bill: how many accounts the plan carries, how many are connected, how many past the plan’s the bill counts and Stripe charges for, the price of one a month before VAT, and since when a correction is owed. Reading it puts Stripe’s count right where the two differ, and a plan that has ended, with no subscription in trial, active or past due, ends the team’s bank connections here, whichever event said so or none did. Each plan on sale carries the price of an account past its own in its own currency, and `trialOffered` says whether a plan started now begins with a free trial.

## Response `200`

What is on file.

- object
  - `ok` unknown, required
  - `data` object, required
    - `configured` boolean, required: False where no Stripe key is set, so a screen offers nothing it cannot do.
    - `sellable` object[], required
      - `plan` string, required
      - `unitAmount` integer, required: What this portfolio is charged a month on that plan, overage included.
      - `currency` string, required
      - `shape` object, required: Stripe's own tier table, so a screen can price any portfolio size without asking again.
        - `unit_amount` number, nullable, required
        - `billing_scheme` string
        - `tiers_mode` string, nullable
        - `tiers` object[], nullable
          - `up_to` number, nullable, required
          - `flat_amount` number, nullable, required
          - `unit_amount` number, nullable, required
      - `bankAccountUnitAmount` integer, nullable, required: Integer minor units of its own currency.
    - `discountPercent` integer, required: Whole percent off the list prices in `sellable`, applied by Stripe at checkout. 0 where none is on.
    - `stale` boolean, required: True where Stripe was unreachable and this is the copy we hold.
    - `trialDays` integer, required
    - `trialOffered` boolean, required: Whether a plan started now begins with `trialDays` free. Only a first plan does: none on this team, nor on any team the caller owns.
    - `offer` object, nullable, required: A longer free trial, offered to the caller by mail. Checkout applies it when one of its `plans` is started before `until`. Null where none stands or no trial is offered.
      - `plan` 'owner' | 'pro' | 'agency', required
      - `plans` string[], required: Every plan the offer may be started on; `plan` is the one it is named after.
      - `trialDays` integer, required
      - `until` string, required
    - `aiUsedPercent` integer, required: The share of this period's AI allowance already spent, as a percent. Never a token count.
    - `status` string, required: Stripe's own subscription status, or `none` before there is one.
    - `planKey` string, nullable, required
    - `plan` string, nullable, required
    - `trialEndsAt` number, nullable, required
    - `renewsAt` number, nullable, required
    - `cancelAtPeriodEnd` boolean, required
    - `units` integer, required
    - `quantity` number, nullable, required
    - `unitAmount` integer, nullable, required: Integer minor units of its own currency.
    - `chargedCents` integer, nullable, required: Integer minor units of its own currency.
    - `currency` string, nullable, required
    - `bankAccounts` object, nullable, required: The bank-account line of the bill. Null before the team has a Stripe customer.
      - `mode` 'free' | 'charged' | 'needs_plan' | 'unavailable', required: `free` on the Ponto sandbox or where billing is not set up, `charged` while a plan is in trial or active, `needs_plan` with no plan or a payment that failed, `unavailable` where the price cannot be read.
      - `included` number, nullable, required: Bank accounts the plan carries before any is charged. Null where there is no plan we sell.
      - `connected` integer, required: Bank accounts this team reads straight from a bank, a broken connection’s included.
      - `billed` integer, required: Connected accounts past `included`, which is what the bill counts.
      - `quantity` number, nullable, required: How many bank accounts the live subscription charges for. Null with no live plan. Differs from `billed` only until the next check puts it right.
      - `unitAmount` integer, nullable, required: Integer minor units of its own currency.
      - `currency` string, nullable, required
      - `pendingSince` string, nullable, required: When a change to the count last failed to reach Stripe, while it still has not.
    - `paymentMethod` object, nullable, required
      - `brand` string, required
      - `last4` string, required
      - `expMonth` number, required
      - `expYear` number, required
    - `billedTo` object, nullable, required
      - `name` string, nullable, required
      - `line1` string, nullable, required
      - `postcode` string, nullable, required
      - `city` string, nullable, required
      - `country` string, nullable, required
      - `taxId` string, nullable, required
    - `companyMatches` boolean, required: False only where the two copies disagree and putting them back in step did not work.
    - `invoices` object[], required
      - `id` string, required
      - `number` string, nullable, required
      - `issuedAt` number, required
      - `totalCents` integer, required: Integer minor units of its own currency.
      - `currency` string, required
      - `status` string, required
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
