(cls, api_key=djstripe_settings.STRIPE_SECRET_KEY, **kwargs)
return usage_stripe_data
Call the stripe API's create operation for this model.

        :param api_key: The api key to use for this request. \
            Defaults to djstripe_settings.STRIPE_SECRET_KEY.
        :type api_key: string
Call the stripe API's create operation for this model.
Call the stripe API s create operation for this model .
def _api_create(cls, api_key=djstripe_settings.STRIPE_SECRET_KEY, **kwargs):
        """
        Call the stripe API's create operation for this model.

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

        if not kwargs.get("id"):
            raise KeyError("SubscriptionItem Object ID is missing")

        try:
            SubscriptionItem.objects.get(id=kwargs["id"])
        except SubscriptionItem.DoesNotExist:
            raise

        usage_stripe_data = stripe.SubscriptionItem.create_usage_record(
            api_key=api_key, **kwargs
        )

        # ! Hack: there is no way to retrieve a UsageRecord object from Stripe,
        # ! which is why we create and sync it right here
        cls.sync_from_stripe_data(usage_stripe_data)

        return usage_stripe_data
def _api_create ( cls , api_key = djstripe_settings . STRIPE_SECRET_KEY , * * kwargs ) : if not kwargs . get ( "id" ) : raise KeyError ( "SubscriptionItem Object ID is missing" ) try : SubscriptionItem . objects . get ( id = kwargs [ "id" ] ) except SubscriptionItem . DoesNotExist : raise usage_stripe_data = stripe . SubscriptionItem . create_usage_record ( api_key = api_key , * * kwargs ) # ! Hack: there is no way to retrieve a UsageRecord object from Stripe, # ! which is why we create and sync it right here cls . sync_from_stripe_data ( usage_stripe_data ) return usage_stripe_data