Skip to content
Software capabilities
Stripe

List Stripe invoice line items

Read an invoice's line items through the Stripe API and follow starting_after while has_more is true. Use the invoice object when the first page of lines is enough for a billing review.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: GET /v1/invoices/{invoice_id}/lines
  2. API: GET /v1/invoices/{invoice_id}
API

GET /v1/invoices/{invoice_id}/lines

List the line items attached to one invoice with a bounded page size.

Read source: Stripe retrieve an invoice’s line items
Requirements
A Stripe secret key with access to the invoice and an invoice ID.
Limitations
Set limit from 1 to 100. If has_more is true, request the next page with starting_after set to the last line item ID.

Example shell

curl --fail -G "https://api.stripe.com/v1/invoices/$STRIPE_INVOICE_ID/lines" -u "$STRIPE_SECRET_KEY:" --data-urlencode 'limit=100'
API

GET /v1/invoices/{invoice_id}

Retrieve the invoice with its embedded lines.data and lines.has_more fields.

Read source: Stripe invoice object reference
Requirements
A Stripe secret key and an invoice ID that the account can read.
Limitations
The embedded collection can contain only the first page. Use the dedicated lines endpoint when has_more is true.

Example shell

curl --fail "https://api.stripe.com/v1/invoices/$STRIPE_INVOICE_ID" -u "$STRIPE_SECRET_KEY:"