Skip to content
Join our SlackContact usGet started

List Invoices

client.invoices.list(InvoiceListParams { subject_id, limit, offset } query, RequestOptionsoptions?): InvoiceListResponse { has_more, invoices }
get/invoices

List Invoices

ParametersExpand Collapse
query: InvoiceListParams { subject_id, limit, offset }
subject_id: string

The ID or external ID of the subject to list invoices for.

limit?: number
maximum100
minimum1
offset?: number
minimum0
ReturnsExpand Collapse
InvoiceListResponse { has_more, invoices }
has_more: boolean
invoices: Array<Invoice>
id: string

The ID of the invoice.

created_at: string

The date and time the invoice was created.

formatdate-time
hosted_url: string | null

The URL of the hosted invoice.

line_items: Array<LineItem>

The line items of the invoice.

amount: AmountOutput { currency_code, value }
currency_code: string

The currency code of the amount.

value: string

The value of the amount in the smallest unit of the currency.

description: string
price_in_unit_amount: AmountOutput { currency_code, value }
currency_code: string

The currency code of the amount.

value: string

The value of the amount in the smallest unit of the currency.

quantity: number
status: "draft" | "open" | "paid" | 2 more

The status of the invoice.

Accepts one of the following:
"draft"
"open"
"paid"
"uncollectible"
"void"
subject_id: string

The ID of the subject for the invoice.

total_amount: AmountOutput { currency_code, value }

The total amount of the invoice.

currency_code: string

The currency code of the amount.

value: string

The value of the amount in the smallest unit of the currency.

List Invoices
import Lark from 'lark-billing';

const client = new Lark({
  apiKey: 'My API Key',
});

const invoices = await client.invoices.list({ subject_id: 'user_1234567890' });

console.log(invoices.has_more);
{
  "has_more": false,
  "invoices": [
    {
      "id": "in_1SS1tIDHrpDCEzdlVd8FH0V4",
      "created_at": "2021-01-01T00:00:00Z",
      "hosted_url": "https://invoice.stripe.com/i/acct_6Q96h5avMho8OKe/test_9USnMMVPQmtUHVUYXV2M...",
      "line_items": [
        {
          "amount": {
            "currency_code": "USD",
            "value": "100"
          },
          "description": "Test Invoice",
          "price_in_unit_amount": {
            "currency_code": "USD",
            "value": "100"
          },
          "quantity": 1
        }
      ],
      "status": "draft",
      "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
      "total_amount": {
        "currency_code": "USD",
        "value": "100"
      }
    }
  ]
}
Returns Examples
{
  "has_more": false,
  "invoices": [
    {
      "id": "in_1SS1tIDHrpDCEzdlVd8FH0V4",
      "created_at": "2021-01-01T00:00:00Z",
      "hosted_url": "https://invoice.stripe.com/i/acct_6Q96h5avMho8OKe/test_9USnMMVPQmtUHVUYXV2M...",
      "line_items": [
        {
          "amount": {
            "currency_code": "USD",
            "value": "100"
          },
          "description": "Test Invoice",
          "price_in_unit_amount": {
            "currency_code": "USD",
            "value": "100"
          },
          "quantity": 1
        }
      ],
      "status": "draft",
      "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE",
      "total_amount": {
        "currency_code": "USD",
        "value": "100"
      }
    }
  ]
}