Sample - Stripe API
GET/v1/checkout/sessions/{session}/line_items

List Checkout Session line items

Lists the line items associated with a Checkout Session. Use session to identify the session and cursor parameters to retrieve the complete paginated collection beyond the items included on the session object. Use expand when you need selected fields expanded.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

5 parameters
sessionstringrequired
The identifier of the Checkout Session whose line items to retrieve. Maximum 5,000 characters.
ending_beforestringoptional
Cursor identifying the line item before which to return results.
expandarray<string>optional
Fields to expand in the response. Each field name can be up to 5,000 characters.
limitintegeroptional
Maximum number of line items to return. Must be between 1 and 100. Defaults to 10 when omitted.
starting_afterstringoptional
Cursor identifying the line item after which to return results.

2 status codes
200Returns a paginated list of line items containing item amounts, currency, quantity, discounts, taxes, pricing details, and metadata, together with `has_more` and the list URL.
dataarray<LineItem>required
Details about each object.
has_morebooleanrequired
True if this list has another page of items after this one that can be fetched.
objectstringrequired
String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
Allowed:list
urlstringrequired
The URL where this list can be accessed.
defaultReturned when the line-item request cannot be processed because the session, cursor, or pagination value is invalid.
errorobjectrequired

Error handling

session must identify the Checkout Session whose line items you want to retrieve. limit must be an integer between 1 and 100 and defaults to 10 when omitted. starting_after and ending_before must identify valid list positions when supplied.