def sync_bank_accounts_and_cards(self, instance, *, stripe_account, api_key):
        """
        Syncs Bank Accounts and Cards for both customers and all external accounts
        """
        type = getattr(instance, "type", None)
        kwargs = {
            "id": instance.id,
            "api_key": api_key,
            "stripe_account": stripe_account,
            "stripe_version": djstripe_settings.STRIPE_API_VERSION,
        }

        if type in ("custom", "express") and isinstance(instance, models.Account):
            # fetch all Card and BankAccount objects associated with the instance
            items = models.Account.stripe_class.list_external_accounts(
                **kwargs
            ).auto_paging_iter()

            self.start_sync(items, instance, api_key=api_key)
        elif isinstance(instance, models.Customer):
            for object in ("card", "bank_account"):
                kwargs["object"] = object

                # fetch all Card and BankAccount objects associated with the instance
                items = models.Customer.stripe_class.list_sources(
                    customer=instance.id, **kwargs
                ).auto_paging_iter()

                self.start_sync(items, instance, api_key=api_key)

        Syncs Bank Accounts and Cards for both customers and all external accounts
        
djstripe/management/commands/djstripe_sync_models.py