Retrieve an invoice
One invoice with its lines.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
id*stringThe invoice's id.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"The invoice.
application/json- response
- response
- …
object*"invoice""invoice"id*stringnumber*|The invoice number. null until it's finalized.
kind*stringperiod: a billing month. plan_change: a change of plan. one_off: a single charge. final: the last invoice of an account. threshold: usage charged early, taken off the month's invoice.
"period""plan_change""one_off""final""threshold"status*stringopen: not paid yet. paid: settled. void: canceled. uncollectible: written off.
"open""paid""void""uncollectible"currency*"usd"Always usd.
"usd"period*What period it covers.
subtotal*integerAn amount in cents (USD).
discount*integerAn amount in cents (USD).
credit*integerAn amount in cents (USD).
tax*integerAn amount in cents (USD).
total*integerAn amount in cents (USD).
amount_paid*integerAn amount in cents (USD).
amount_due*integerAn amount in cents (USD).
collection_method*stringcharge_automatically: charged to the payment method. send_invoice: paid by due_at.
"charge_automatically""send_invoice"due_at*|When payment is due. null: not set.
date-timefinalized_at*|When it was finalized. null: not yet.
date-timepaid_at*|When it was paid. null: not paid.
date-timevoided_at*|When it was voided. null: it wasn't.
date-timehosted_url*|A page to view (and pay) the invoice.
pdf_url*|The invoice as a PDF. null: not available.
lines*array<>import { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.billing.invoices.get("inv_01k7c8m4q2f3e9v6t5r1n0p8yz");{ "object": "invoice", "id": "inv_01k7c8m4q2f3e9v6t5r1n0p8yz", "number": "COSS-000042", "kind": "period", "status": "paid", "currency": "usd", "period": { "start": "2026-10-01T00:00:00.000Z", "end": "2026-11-01T00:00:00.000Z" }, "subtotal": 7300, "discount": 0, "credit": 2500, "tax": 0, "total": 4800, "amount_paid": 4800, "amount_due": 0, "collection_method": "charge_automatically", "due_at": "2026-11-01T00:20:00.000Z", "finalized_at": "2026-11-01T00:20:00.000Z", "paid_at": "2026-11-01T00:21:00.000Z", "voided_at": null, "hosted_url": "https://invoice.stripe.com/i/acct_123/test_YWNjdF8x", "pdf_url": "https://pay.stripe.com/invoice/acct_123/test_YWNjdF8x/pdf", "lines": [ { "object": "invoice_line", "id": "invl_01k7c8m4q2f3e9v6t5r1n0p8yz", "kind": "usage", "description": "Email: 120,000 recipients", "meter": "email.recipients", "dimension": null, "quantity": 120000, "included_quantity": 0, "unit_price": "0.0004", "amount": 4800, "period": { "start": "2026-10-01T00:00:00.000Z", "end": "2026-11-01T00:00:00.000Z" } } ]}