#trimetilo

1 messages · Page 1 of 1 (latest)

misty shellBOT
graceful jasper
#

Can you share the subscription schedule ID that you're working with here?

visual jay
#

sub_sched_1ObltTB2v5yxQy40yr5Z8xgB

graceful jasper
#

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".

visual jay
#

evt_1OhB4BB2v5yxQy40cWuXi5gL
evt_1OhB4CB2v5yxQy40tmbS02p2
evt_1OhB4CB2v5yxQy40ba4ooyZh
evt_1OhB4CB2v5yxQy40DKzzsTzB

misty shellBOT
hazy lily
#

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?

visual jay
#

Yes, I guess so. I am using dj-stripe for Python/Django

hazy lily
#

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

visual jay
#

Yes, looks like the subscriptionitem belongs to the previous subscription

hazy lily
#

I'm not finding much at the moment, will consult my colleagues on this

hazy lily
#

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

visual jay
#

so is it a bug in stripe?

#

or how could i handle it?

hazy lily
#

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?

visual jay
hazy lily
#

Do you know why your server is retrieving the subscription items like this? Looks like we may need a workaround to get this info

visual jay
#

Not sure, this is how dj-stripe works

hazy lily
#

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

visual jay
#

Ok, will open an issue to dj-stripe. Thanks for your help!