#DevDev-webhook

1 messages · Page 1 of 1 (latest)

elder condor
#

@red bramble hi! can you share the invoice ID in_xxx that you updated?

red bramble
#

Sorry, I meant invoice item, am not getting webhook ( invoice.updated) event while updating metadata of invoice item object on stripe.

#

This is invoice item id ii_1KX1KXQ62vgqb8Is0RHMhw4w

#

Invoice Id: in_1KX1KYQ62vgqb8Isbr7OLnBL

#

@elder condor

elder condor
#

thanks, will look in sec, it just got really busy

red bramble
#

Ok, Sure

elder condor
#

but still, that generated webhook events yep

#

you use Connect so remember you need to use Connect endpoints on your platform account to receive those

elder condor
#

I also see that we did deliver your Connect endpoint with evt_1KX2OxQ62vgqb8Is79oBH8g5 which is invoice.updated

red bramble
#

I get invoice.updated event if I update any field of invoice item other than metadata.

red bramble
#

I get invoice.updated event if I update any other attribute but I am not getting webhook if I only update metadata attribute

elder condor
#

hmm ok, might just be a quirk of the API. Can you share a request ID req_xxx of you updating just the metadata and nothing else so I can verify?

red bramble
#

Okay! I will make a new request and send the request id.

#

Request id req_06xf3ltn4ntZkz

elder condor
#

that one changes multiple things, not just metadata

#

but I guess it was a no-op since you just set things to what they already were, only metadata changed

#

yeah, seems like it doesn't generate an event, interesting!

red bramble
#

Yeah

#

It only changes metadata, other things are not necessary in the request but this is how code is written.

#

I am running a job for every invoice.updated event to sync data with the Xero account.

elder condor
#

the workaround would be to set metadata on the Invoice itself instead. But yes, this is probably a quirk. I'm not convinced it should generate an event since the Invoice itself is not changing(in the other examples, by changing the item you are changing things like the overall total of the Invoice, so it fires an event). The invoiceitem.updated event should probably happen though.

#

and it does generate that invoiceitem.updated for your request (evt_1KX2syQ62vgqb8Isa7INuggU )

#

so ultimately I think you'd have to listen to that one as well.

red bramble
#

Okay! A record is generated for every invoice item in Xero so metadata has to be in invoice item itself.

#

Maybe we can listen to invoiceitem.updated as well

#

Changing the invoice item's description is also generating invoice.updated event. Maybe metadata is just an additional field so it's not firing up the event.

elder condor
#

I do think it's a bit quirky

#

I do agree it probably should generate the event, but most likely there is some logic for this that only updates the invoice when 'meaningful' changes happen, that has always been there and it would be difficult to prioritise work to look into it. So to set expectations it's likely easier to listen to the other event on your side unfortunately.

red bramble
#

Yeah! It's okay. I will also listen to invoiceitem.updated event.
Thanks, Karllekko 😄

elder condor
#

great!