Skip to content
Join our SlackContact usGet started

List Invoices

client.Invoices.List(ctx, query) (*InvoiceListResponse, error)
get/invoices

List Invoices

ParametersExpand Collapse
query InvoiceListParams
SubjectID param.Field[string]

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

Limit param.Field[int64]optional
maximum100
minimum1
Offset param.Field[int64]optional
minimum0
ReturnsExpand Collapse
type InvoiceListResponse struct{…}
HasMore bool
Invoices []InvoiceListResponseInvoice
ID string

The ID of the invoice.

CreatedAt Time

The date and time the invoice was created.

formatdate-time
HostedURL string

The URL of the hosted invoice.

LineItems []InvoiceListResponseInvoiceLineItem

The line items of the invoice.

CurrencyCode string

The currency code of the amount.

Value string

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

Description string
PriceInUnitAmount AmountOutput
CurrencyCode string

The currency code of the amount.

Value string

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

Quantity int64
Status string

The status of the invoice.

Accepts one of the following:
const InvoiceListResponseInvoiceStatusDraft InvoiceListResponseInvoiceStatus = "draft"
const InvoiceListResponseInvoiceStatusOpen InvoiceListResponseInvoiceStatus = "open"
const InvoiceListResponseInvoiceStatusPaid InvoiceListResponseInvoiceStatus = "paid"
const InvoiceListResponseInvoiceStatusUncollectible InvoiceListResponseInvoiceStatus = "uncollectible"
const InvoiceListResponseInvoiceStatusVoid InvoiceListResponseInvoiceStatus = "void"
SubjectID string

The ID of the subject for the invoice.

TotalAmount AmountOutput

The total amount of the invoice.

CurrencyCode string

The currency code of the amount.

Value string

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

List Invoices
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := lark.NewClient(
    option.WithAPIKey("My API Key"),
  )
  invoices, err := client.Invoices.List(context.TODO(), lark.InvoiceListParams{
    SubjectID: "user_1234567890",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", invoices.HasMore)
}
{
  "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"
      }
    }
  ]
}