def api_list(cls, api_key=djstripe_settings.STRIPE_SECRET_KEY, **kwargs):
        """
        Call the stripe API's list operation for this model.
        Note that we only iterate and sync the LineItem associated with the
        passed in Invoice.

        Upcoming invoices are virtual and are not saved and hence their
        line items are also not retrieved and synced

        :param api_key: The api key to use for this request. \
            Defaults to djstripe_settings.STRIPE_SECRET_KEY.
        :type api_key: string

        See Stripe documentation for accepted kwargs for each object.

        :returns: an iterator over all items in the query
        """
        # Update kwargs with `expand` param
        kwargs = cls.get_expand_params(api_key, **kwargs)

        # get current invoice if any
        invoice_id = kwargs.pop("id")

        # get expand parameter that needs to be passed to invoice.lines.list call
        expand_fields = kwargs.pop("expand")

        invoice = Invoice.stripe_class.retrieve(invoice_id, api_key=api_key, **kwargs)

        # iterate over all the line items on the current invoice
        return invoice.lines.list(
            api_key=api_key, expand=expand_fields, **kwargs
        ).auto_paging_iter()

        Call the stripe API's list operation for this model.
        Note that we only iterate and sync the LineItem associated with the
        passed in Invoice.

        Upcoming invoices are virtual and are not saved and hence their
        line items are also not retrieved and synced

        :param api_key: The api key to use for this request.             Defaults to djstripe_settings.STRIPE_SECRET_KEY.
        :type api_key: string

        See Stripe documentation for accepted kwargs for each object.

        :returns: an iterator over all items in the query
        
djstripe/models/billing.py