#eczo_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1346442025859416116
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Example Scenario
Our customer is billed based on credits used during service usage.
In this case, the customer used 5000 credits โ recorded as two meter events under SAAS and VOICE categories, both linked to the price-product in their subscription.
The customer then canceled their subscription right after usage, but the 5000 credits were not aggregated into the final invoice.
The last invoice only billed 20000 credits instead of the expected 25000 credits.
Here are the details:
Customer ID: cus_RphCXYp7m7Lf7l
Subscription ID: sub_1Qw2y8HJgsdx4qPxdM8rZw2X
Last Invoice ID: in_1QyspIHJgsdx4qPxSQSfXh6x
{
"identifier": "47c1c904-a283-4c47-ad78-27a5a20b6032",
"timestamp": 1741084505,
"event_name": "mtr_test_61QXhvkxEqmAWDPPA41HJgsdx4qPxXa4",
"payload": {
"credits": "5000",
"stripe_customer_id": "cus_RphCXYp7m7Lf7l"
}
}
{
"identifier": "7648e255-382d-4838-8632-e1caf95b6665",
"timestamp": 1741084505,
"event_name": "mtr_test_61QXiNFZ5w8QsoA6m41HJgsdx4qPxILI",
"payload": {
"credits": "5000",
"stripe_customer_id": "cus_RphCXYp7m7Lf7l"
}
}
Could you please advise on how to ensure that all meter events are consistently aggregated into the final invoice โ even if the subscription is canceled immediately after usage?
Looking forward to your support.
hi there!
๐
While meter events are registered in real-time, their aggregation into the upcoming invoice is not instantaneous. It requires couple of minutes to be aggregated
You should update your integration and not cancel the subscipriotn immediately, after an usage record was sent. Set a grace period and schedule the Subscription for deletion after couple of minutes to be safe
What maximum minutes should we set as a grace period?
We can put this restriction from our side in any manual steps, but what in case of automatic billing from Stripe?
There will be a discrepancy in service usage in a particular billing period.
I think 5minutes is enough
We can put this restriction from our side in any manual steps, but what in case of automatic billing from Stripe?
What you mean here sorry, could you please share more details ?