code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  invoice = stripe.Invoice.upcoming(
    customer='cus_8TEMHVY5moxIPI',
  )
  invoice.lines.list(limit=5)
  '''Response {
    "object": "list",
    "url": "/v1/invoices/upcoming/lines",
    "has_more": false,
    "data": [
      {
        "id": "il_tmp_1LSdra2eZvKYlo2COW02i0Bc",
        "object": "line_item",
        "amount": 300,
        "amount_excluding_tax": 300,
        "currency": "usd",
        "description": "My First Invoice Item (created for API docs)",
        "discount_amounts": [],
        "discountable": true,
        "discounts": [],
        "invoice_item": "ii_1LSdra2eZvKYlo2COW02i0Bc",
        "livemode": false,
        "metadata": {},
        "period": {
          "end": 1659518858,
          "start": 1659518858
        },
        "price": {
          "id": "price_1LScCX2eZvKYlo2C1Z9zPyXF",
          "object": "price",
          "active": true,
          "billing_scheme": "per_unit",
          "created": 1659512469,
          "currency": "usd",
          "custom_unit_amount": null,
          "livemode": false,
          "lookup_key": null,
          "metadata": {},
          "nickname": null,
          "product": "prod_MAy8UvSA0uRRju",
          "recurring": null,
          "tax_behavior": "unspecified",
          "tiers_mode": null,
          "transform_quantity": null,
          "type": "one_time",
          "unit_amount": 300,
          "unit_amount_decimal": "300"
        },
        "proration": false,
        "proration_details": {
          "credited_items": null
        },
        "quantity": 1,
        "subscription": null,
        "tax_amounts": [],
        "tax_rates": [],
        "type": "invoiceitem",
        "unit_amount_excluding_tax": "300"
      },
      {...},
      {...}
    ]
  }'''
nl: Retrieve an upcoming invoice's line itemsWhen retrieving an upcoming invoice, you’ll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.Parameters customer Required if subscription unset The identifier of the customer whose upcoming invoice you’d like to retrieve. subscription optional The identifier of the subscription for which you’d like to retrieve the upcoming invoice. If not provided, but a subscription_items is provided, you will preview creating a subscription with those items. If neither subscription nor subscription_items is provided, you will retrieve the next upcoming invoice from among the customer’s subscriptions.More parametersExpand all  customer_details Required if subscription and customer unset   automatic_tax optional dictionary   coupon optional   currency optional   discounts optional array of hashes   ending_before optional   invoice_items optional array of hashes   limit optional   schedule optional   starting_after optional   subscription_billing_cycle_anchor optional   subscription_cancel_at optional   subscription_cancel_at_period_end optional   subscription_cancel_now optional   subscription_default_tax_rates optional   subscription_items optional array of hashes   subscription_proration_behavior optional   subscription_proration_date optional   subscription_start_date optional   subscription_trial_end optional   subscription_trial_from_plan optional ReturnsReturns a list of line_item objects