dj-stripe automatically syncs your Stripe Data to your local database as pre-implemented Django Models allowing you to use the Django ORM, in your code, to work with the data making it easier and faster.
I have updated the Price of a Subscription using a SubscriptionSchedule. The SubscriptionSchedule worked fine and now the price is updated. However after the change, the invoice events failed in my backend due to "Invalid subscription_item id: si_LgHurTfBkdLkwd".
The subscription item existed in the database before the phase change. My gut feeling is that dj-stripe has removed it when the event customer.subscription.updated was received. This event changed the items in the subscription (there I could still see the subscriptionitem id in the previous_attributes field).
Not sure if it matters, but both prices (previous and new) depend on customer usage and have two tiers: free up to 1000 and paid from 1000 onwards.
After chatting to Stripe dev support, it looks like the invoice was created because of the schedule phase change, and an hour later it was finalized. Because the phase change got rid of that subscription item, it wasn't accessible when trying to access it via the API. They confirmed this is something that has to be fixed in dj-stripe.
Describe the bug
I have updated the Price of a Subscription using a SubscriptionSchedule. The SubscriptionSchedule worked fine and now the price is updated. However after the change, the invoice events failed in my backend due to "Invalid subscription_item id: si_LgHurTfBkdLkwd".
The subscription item existed in the database before the phase change. My gut feeling is that dj-stripe has removed it when the event
customer.subscription.updated
was received. This event changed the items in the subscription (there I could still see the subscriptionitem id in theprevious_attributes
field).Not sure if it matters, but both prices (previous and new) depend on customer usage and have two tiers: free up to 1000 and paid from 1000 onwards.
After chatting to Stripe dev support, it looks like the invoice was created because of the schedule phase change, and an hour later it was finalized. Because the phase change got rid of that subscription item, it wasn't accessible when trying to access it via the API. They confirmed this is something that has to be fixed in dj-stripe.
Failing events:
Traceback: Sentry
To Reproduce
Software versions