#trimetilo
1 messages · Page 1 of 1 (latest)
Can you share the subscription schedule ID that you're working with here?
sub_sched_1ObltTB2v5yxQy40yr5Z8xgB
Can you also share the event where you received the error
the invoice events failed in my backend due to "Invalid subscription_item id: si_LgHurTfBkdLkwd".
evt_1OhB4BB2v5yxQy40cWuXi5gL
evt_1OhB4CB2v5yxQy40tmbS02p2
evt_1OhB4CB2v5yxQy40ba4ooyZh
evt_1OhB4CB2v5yxQy40DKzzsTzB
Thank you, it actually looks like those events don't contain that error, which makes sense as that error looks more like an API error that you would get if trying to access si_LgHurTfBkdLkwd from the wrong account. Are you making an API request when you get these events that is getting an error?
Yes, I guess so. I am using dj-stripe for Python/Django
It looks like this isn't a connect scenario so I am unsure of what the mixup may be
Do you have multiple accounts? Usually this happens because the key for the wrong account is used when trying to make the API request
Ah, it looks like these events may have been delayed in some way. It looks like that subscription item existed before the subscription cycled but these events were not sent until after. Looking in to this
Yes, looks like the subscriptionitem belongs to the previous subscription
I'm not finding much at the moment, will consult my colleagues on this
Ah so it looks like this 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
It depends on the call that your integration was making when it got this error. Unfortunately I am not seeing it in your logs. Can you see what code your webhook endpoint runs when it gets this kind of event?
I am not sure but here is the traceback in sentry. Hopefully that helps
https://libreborme.sentry.io/share/issue/40740656fb5f42ddbe7ae8e75de5bceb/
Request req_shT3oP3N8mkjNp: Invalid subscription_item id: si_LgHurTfBkdLkwd InvalidRequestError stripe/api_requestor.py handle_error_response /stripe/webhook/
Ah these are get requests https://dashboard.stripe.com/logs/req_shT3oP3N8mkjNp
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Do you know why your server is retrieving the subscription items like this? Looks like we may need a workaround to get this info
Not sure, this is how dj-stripe works
Ah I missed that you are using something prebuilt
You will want to talk to the dj-stripe devs and make sure to understand what your code is doing
We can help if you are writing to the Stripe API yourself but if this is a dj-stripe issue they will know more about what you can do here
Ok, will open an issue to dj-stripe. Thanks for your help!