#krileon_api

1 messages Β· Page 1 of 1 (latest)

lyric glenBOT
#

πŸ‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

πŸ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1370445154061783163

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tired ether
pseudo loom
#

that's only if i have a subscription object a refund webhook doesn't have a subscription id only a charge id or payment intent id

#

basically i need to find the invoice object based off the charge id as in what invoice the charge belongs to

tired ether
#

Which Refund event are you listening to?

pseudo loom
#

charge.refunded

tired ether
#

How is the refund being initiated?

pseudo loom
#

from the stripe dashboard

#

the refund object and the charge object have no reference to their subscriptions nor do they inherit the metadata from their subscriptions it's a serious problem of disconnect going on and wasn't a problem when charge contained invoice id

#

basically there's no reverse lookup.. i would assume that'd be something that could easily be added to the search api via a query, but that's not supported either

#

i've got customers at a stand still here due to this mess because subscription future invoices don't send webhooks in the api version they were created with (we're using versioned headers) so we end up getting basil webhooks despite sending an older version.. you can see where this nightmare is beginning lol

lyric glenBOT
hollow drum
#

πŸ‘‹ Taking over this thread, catching up now

lyric glenBOT
hollow drum
#

I'm still checking how to find the subscription ID with a given Charge / Refund ID in basil

pseudo loom
#

it's not subscription that i'm needing i need to get the invoice that the charge belongs to

#

so the chain that stripe has is basically subscription -> invoice -> charge.. subscription references invoice via latest_invoice.. invoice references subscription via parent.subscription_details.subscription... but charge no longer references invoice and it doesn't reference subscription either

#

so i've no way of knowing what invoice the charge came from

#

all your webhooks, except invoice webhooks, include charge or payment intent.. with no way of doing reverse lookup there is no way to find their invoice

#

this was never a problem before since charge contained invoice, which made perfect sense as a charge can be initiated by an invoice

hollow drum
#

Totally understand that. Before basil, it's possible to find the Payment Intent ID and Invoice ID with a given Charge ID before basil. I'm still check how this can be achieved in basil

pseudo loom
#

that retrieves an invoice payment by invoice payment id so and id prefixed with inpay_

hollow drum
#

Sorry my bad

#

The Payment Intent ID can be set at payment.payment_intent field

pseudo loom
#

ooh that could work

#

insanely verbose, but this might do the trick lol

hollow drum
#

The idea is that twice a year we plan to release a new API version that contains breaking changes and in between we release an update to the latest API version that has only additive changes

pseudo loom
#

we're already following api best practices by versioning our calls.. problem is Stripe doesn't honor them for webhooks lol

#

so when we create a subscription with basil all future webhooks for that subscription should be basil, but they're not.. the'll be versioned to the webhook version

#

our issues are 100% with webhooks rest of our code is 100% functional lol

hollow drum
#

Thanks for sharing the feedback! We will forward this to the relevant team on how we can improve the development experience

pseudo loom
#

we'll look into adding support for automating webhook creation but for now they just copy our url into webhooks UI

#

i don't see a way to set the version in the update endpoint only create endpoint though so we wouldn't be able to update the version

hollow drum
#

API version can only be set at creation, but not update. This is expected

#

You'd need to create a new Webhook endpoint and delete the existing one if you would like to set to a specific version

pseudo loom
#

well just another suggestion for the team i suppose lol this would let us entirely automate it.. delete and recreate would work yeah, but updating existing would be single call

#

the api is great, but sometimes the round trips are a bit much

hollow drum
#

We hear you! Thanks for sharing the feedback and this will be shared with the product team for future consideration

pseudo loom
#

ok i can confirm the proposed solution works, thanks

hollow drum
#

No problem! Happy to help πŸ˜„

pseudo loom
#

well i don't have any further questions.. not sure if i just leave the thread to close this out, but i hope ya have a great weekend!