#dizerss-dev_webhooks

1 messages ยท Page 1 of 1 (latest)

hearty hornetBOT
#

๐Ÿ‘‹ 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/1262211454522753078

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

hollow wyvern
#

hi

rich mantle
#

I have attempted meter events recording via cron jobs but some numbers are left with the way.
Which events do you use?

#

Could you share an example what you have done, so that I can take a look how your integration works?

hollow wyvern
#

I am using checkout.session.completed , customer.subscription.updated , payment_intent.payment_failed , customer.subscription.deleted as of now

#

before that, are you familiar with meter events ?

rich mantle
#

Yes, I'm familiar with meter events

hollow wyvern
#

cool

#

I have a subscription using the new meter.

#

we have a flat price and in the subscription I we give 50 messages with the plan but any more are going to be charged via meter events

#

I'll try to find a sub Id which has this on the dashboard....

#

but just to be clear..... the usage for my messages I want to record goes through meter events to the meter attached to the subscription...... the meter event call is being done via cron jobs right now.

#

which are run every day.

#

but messages are missed because of time variations of cron jobs running and the actual subscriptions being on different times.

rich mantle
#

but messages are missed because of time variations of cron jobs running and the actual subscriptions being on different times.
Could you share an example subscription (sub_xxx) with this issue, and the expected and actual behaviours?

hollow wyvern
#

ohh sorry If I am not clear english is not my first language

#

I am not having an issue. I just want to do things via a webhook event

#

but I am having trouble finding the right event for this.

#

mtr_test_61Qc0jwdbUaVeWly241Hn5Ll2SPft3Ka

#

this is one of the meters. I just want there to be an event from which I can record the usage from the webhook function to the meter instead of using cron jobs to record usage.

#

I hope that makes sense.

#

if not I'll try to be more brief.

hollow wyvern
rich mantle
#

Webhook event is sent from Stripe to your server to be informed on the payments and changes on your account. It's not meant for you to submit the meter events.

Submitting record usage can only be done via meter events API

hollow wyvern
#

understood but the call to that api I wish to be from a webhook event.

#

so if there is an event which can be catched to before the subscription charges the customer.

#

something like this :

rich mantle
#

Am I right to understand you would like to be informed by an event that the current cycle ends, so that you can submit the usage records before the invoice is finalised and charged to customer?

hollow wyvern
#

event ("stripe event before user is charged"):

      • fetch sub data
      • fetch meter data
      • call the meter events api and send usage.

Then in stripe that usage is recorded into that sub and charged to the user.

hollow wyvern
#

I am just trying to find such an event I can catch on my side to call the meter events api to record usage..... you explained it perfectly

rich mantle
hollow wyvern
#

Amazing. I'll check that. Thank you so much โค๏ธ

rich mantle
#

No problem! Happy to help ๐Ÿ˜„

hollow wyvern
#

Take care bye

hearty hornetBOT