Skip to content

Stripe: Retrieve an invoice's line items

Stripe invoices.getInvoicesInvoiceLines: arguments, response, policy and SDK examples.

← Invoices operations · Get started

Operation stripe.getinvoicesinvoicelines

Provider route: GET /v1/invoices/{invoice}/lines. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["invoices"]["getInvoicesInvoiceLines"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.invoices.getInvoicesInvoiceLines(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.invoices.get_invoices_invoice_lines(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.invoicestringRequired within parentMaximum length: 5000
queryobjectOptionalAdditional keys: not allowed
query.ending_beforestringOptionalMaximum length: 5000
query.expandarrayOptional
query.expand[]stringEach itemMaximum length: 5000
query.limitintegerOptional
query.starting_afterstringOptionalMaximum length: 5000

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$objectRoot
dataarrayRequired within parentDetails about each object.
data[]ModelEach itemExpand Update an invoice’s line item — response body
has_morebooleanRequired within parentTrue if this list has another page of items after this one that can be fetched.
objectstringRequired within parentString representing the object’s type. Objects of the same type share the same value. Always has the value `list`.
Known values: list
urlstringRequired within parentThe URL where this list can be accessed.
Maximum length: 5000

Referenced models: Update an invoice’s line item — response body

706 more schemas are linked from the tables above, on the schema pages.

Update an invoice's line item — response body
FieldTypePresenceDescription and constraints
$objectRootInvoice Line Items represent the individual lines within an [invoice](https://docs.stripe.com/api/invoices) and only exist within the context of an invoice.

Each line item is backed by either an [invoice item](https://docs.stripe.com/api/invoiceitems) or a [subscription item](https://docs.stripe.com/api/subscription_items).
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeThe amount, in cents (or local equivalent).
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
Format: currency
descriptionJSONOptional
description (anyOf 1)stringAlternativeAn arbitrary string attached to the object. Often useful for displaying to users.
Maximum length: 5000
description (anyOf 2)nullAlternative
discount_amountsJSONOptional
discount_amounts (anyOf 1)arrayAlternativeThe amount of discount calculated per discount for this line item.
discount_amounts (anyOf 1)[]ModelEach itemExpand Void a credit note — response body — discount amounts item
discount_amounts (anyOf 2)nullAlternative
discountablebooleanRequired within parentIf true, discounts will apply to this line item. Always false for prorations.
discountsarrayRequired within parentThe discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
discounts[]JSONEach item
discounts[] (anyOf 1)stringAlternativeMaximum length: 5000
discounts[] (anyOf 2)ModelAlternativeExpand Get Customers Customer Discount — response body
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
invoiceJSONOptional
invoice (anyOf 1)stringAlternativeThe ID of the invoice that contains this line item.
Maximum length: 5000
invoice (anyOf 2)nullAlternative
livemodebooleanRequired within parentIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadataobjectRequired within parentSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
Additional keys: see wildcard field
metadata.*stringAdditional keysMaximum length: 500
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: line_item
parentJSONOptional
parent (anyOf 1)JSONAlternativeThe parent that generated this line item.
parent (anyOf 1) (anyOf 1)ModelAlternativeExpand Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details
parent (anyOf 2)nullAlternative
periodModelRequired within parentExpand Create an invoice item — response body — period
pretax_credit_amountsJSONOptional
pretax_credit_amounts (anyOf 1)arrayAlternativeContains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
pretax_credit_amounts (anyOf 1)[]ModelEach itemExpand Update an invoice's line item — response body — pretax credit amounts array item
pretax_credit_amounts (anyOf 2)nullAlternative
pricingJSONOptional
pricing (anyOf 1)JSONAlternativeThe pricing information of the line item.
pricing (anyOf 1) (anyOf 1)ModelAlternativeExpand Update an invoice's line item — response body — pricing / The pricing information of the line item / type: price details
pricing (anyOf 2)nullAlternative
quantityJSONOptional
quantity (anyOf 1)JSONAlternative
quantity (anyOf 1) (anyOf 1)integerAlternativeQuantity of units for the invoice line item in integer format, with any decimal precision truncated. For the line item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the line item is a proration or subscription, the quantity of the subscription that the proration was computed for.
quantity (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
quantity (anyOf 2)nullAlternative
quantity_decimalJSONOptional
quantity_decimal (anyOf 1)stringAlternativeNon-negative decimal with at most 12 decimal places. The quantity of units for the line item.
Format: decimal
quantity_decimal (anyOf 2)nullAlternative
subscriptionJSONOptional
subscription (anyOf 1)JSONAlternative
subscription (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
subscription (anyOf 1) (anyOf 2)ModelAlternativeExpand Pause a subscription — response body
subscription (anyOf 2)nullAlternative
subtotalJSONRequired within parent
subtotal (anyOf 1)integerAlternativeThe subtotal of the line item, in cents (or local equivalent), before any discounts or taxes.
subtotal (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
taxesJSONOptional
taxes (anyOf 1)arrayAlternativeThe tax information of the line item.
taxes (anyOf 1)[]ModelEach itemExpand Update an invoice's line item — response body — taxes The tax information of the line item item
taxes (anyOf 2)nullAlternative

Referenced models: Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details, Update an invoice's line item — response body — pricing / The pricing information of the line item / type: price details, Update an invoice's line item — response body — taxes The tax information of the line item item, Get Customers Customer Discount — response body, Void a credit note — response body — discount amounts item, Create an invoice item — response body — period, Update an invoice's line item — response body — pretax credit amounts array item, Pause a subscription — response body

Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details
FieldTypePresenceDescription and constraints
$objectRoot
invoice_item_detailsJSONOptional
invoice_item_details (anyOf 1)JSONAlternativeDetails about the invoice item that generated this line item
invoice_item_details (anyOf 1) (anyOf 1)ModelAlternativeExpand Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details invoice item details value invoice item, proration, proration details, subscription
invoice_item_details (anyOf 2)nullAlternative
subscription_item_detailsJSONOptional
subscription_item_details (anyOf 1)JSONAlternativeDetails about the subscription item that generated this line item
subscription_item_details (anyOf 1) (anyOf 1)ModelAlternativeExpand Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details subscription item details value invoice item, proration, proration details, subscription, subscription item
subscription_item_details (anyOf 2)nullAlternative
typestringRequired within parentThe type of parent that generated this line item
Known values: invoice_item_details, subscription_item_details

Referenced models: Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details invoice item details value invoice item, proration, proration details, subscription, Update an invoice's line item — response body — parent / The parent that generated this line item / type: invoice item details, subscription item details subscription item details value invoice item, proration, proration details, subscription, subscription item

Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer

SDK function policy ID: stripe.getinvoicesinvoicelines. Catalog operation: GetInvoicesInvoiceLines. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.