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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.invoice | string | Required within parent | Maximum length: 5000 |
query | object | Optional | Additional keys: not allowed |
query.ending_before | string | Optional | Maximum length: 5000 |
query.expand | array | Optional | |
query.expand[] | string | Each item | Maximum length: 5000 |
query.limit | integer | Optional | |
query.starting_after | string | Optional | Maximum length: 5000 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
data | array | Required within parent | Details about each object. |
data[] | Model | Each item | Expand Update an invoice’s line item — response body |
has_more | boolean | Required within parent | True if this list has another page of items after this one that can be fetched. |
object | string | Required within parent | String representing the object’s type. Objects of the same type share the same value. Always has the value `list`. Known values: list |
url | string | Required within parent | The URL where this list can be accessed. Maximum length: 5000 |
Referenced models: Update an invoice’s line item — response body
Schemas
Section titled “Schemas”706 more schemas are linked from the tables above, on the schema pages.
Update an invoice's line item — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Invoice 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). |
amount | JSON | Required within parent | |
amount (anyOf 1) | integer | Alternative | The amount, in cents (or local equivalent). |
amount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
currency | string | Required within parent | Three-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 |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | An arbitrary string attached to the object. Often useful for displaying to users. Maximum length: 5000 |
description (anyOf 2) | null | Alternative | |
discount_amounts | JSON | Optional | |
discount_amounts (anyOf 1) | array | Alternative | The amount of discount calculated per discount for this line item. |
discount_amounts (anyOf 1)[] | Model | Each item | Expand Void a credit note — response body — discount amounts item |
discount_amounts (anyOf 2) | null | Alternative | |
discountable | boolean | Required within parent | If true, discounts will apply to this line item. Always false for prorations. |
discounts | array | Required within parent | The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. |
discounts[] | JSON | Each item | |
discounts[] (anyOf 1) | string | Alternative | Maximum length: 5000 |
discounts[] (anyOf 2) | Model | Alternative | Expand Get Customers Customer Discount — response body |
id | string | Required within parent | Unique identifier for the object. Maximum length: 5000 |
invoice | JSON | Optional | |
invoice (anyOf 1) | string | Alternative | The ID of the invoice that contains this line item. Maximum length: 5000 |
invoice (anyOf 2) | null | Alternative | |
livemode | boolean | Required within parent | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
metadata | object | Required within parent | Set 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.* | string | Additional keys | Maximum length: 500 |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: line_item |
parent | JSON | Optional | |
parent (anyOf 1) | JSON | Alternative | The parent that generated this line item. |
parent (anyOf 1) (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
period | Model | Required within parent | Expand Create an invoice item — response body — period |
pretax_credit_amounts | JSON | Optional | |
pretax_credit_amounts (anyOf 1) | array | Alternative | Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. |
pretax_credit_amounts (anyOf 1)[] | Model | Each item | Expand Update an invoice's line item — response body — pretax credit amounts array item |
pretax_credit_amounts (anyOf 2) | null | Alternative | |
pricing | JSON | Optional | |
pricing (anyOf 1) | JSON | Alternative | The pricing information of the line item. |
pricing (anyOf 1) (anyOf 1) | Model | Alternative | Expand Update an invoice's line item — response body — pricing / The pricing information of the line item / type: price details |
pricing (anyOf 2) | null | Alternative | |
quantity | JSON | Optional | |
quantity (anyOf 1) | JSON | Alternative | |
quantity (anyOf 1) (anyOf 1) | integer | Alternative | Quantity 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
quantity (anyOf 2) | null | Alternative | |
quantity_decimal | JSON | Optional | |
quantity_decimal (anyOf 1) | string | Alternative | Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. Format: decimal |
quantity_decimal (anyOf 2) | null | Alternative | |
subscription | JSON | Optional | |
subscription (anyOf 1) | JSON | Alternative | |
subscription (anyOf 1) (anyOf 1) | string | Alternative | Maximum length: 5000 |
subscription (anyOf 1) (anyOf 2) | Model | Alternative | Expand Pause a subscription — response body |
subscription (anyOf 2) | null | Alternative | |
subtotal | JSON | Required within parent | |
subtotal (anyOf 1) | integer | Alternative | The subtotal of the line item, in cents (or local equivalent), before any discounts or taxes. |
subtotal (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
taxes | JSON | Optional | |
taxes (anyOf 1) | array | Alternative | The tax information of the line item. |
taxes (anyOf 1)[] | Model | Each item | Expand Update an invoice's line item — response body — taxes The tax information of the line item item |
taxes (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
invoice_item_details | JSON | Optional | |
invoice_item_details (anyOf 1) | JSON | Alternative | Details about the invoice item that generated this line item |
invoice_item_details (anyOf 1) (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
subscription_item_details | JSON | Optional | |
subscription_item_details (anyOf 1) | JSON | Alternative | Details about the subscription item that generated this line item |
subscription_item_details (anyOf 1) (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
type | string | Required within parent | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
deleted | boolean | Required within parent | Always true for a deleted object Known values: True |
id | string | Required within parent | Unique identifier for the object. Maximum length: 5000 |
object | string | Required within parent | String representing the object's type. Objects of the same type share the same value. Known values: customer |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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"}