#simeng

1 messages · Page 1 of 1 (latest)

urban folioBOT
dense trout
#

It throws an error when I try to report usage after the invoice was created. Sth like the time stamp must after current subscription cycle start time

quick compass
#

After the invoice is created, the usage of the past cycle can't be updated

#

From https://stripe.com/docs/billing/subscriptions/usage-based#report:

If aggregate_usage is set to sum on the price, your integration is allowed to write events occurring in the last 5 minutes of the previous period at any time in the current period (to accommodate clock drift). Events written this way are billed in the current period. For all other aggregate_usage values, the timestamp has to be within the billing period.

Learn how to charge customers based on how much they use your product or service.

dense trout
#

In that case is there any out of box event that I could use to trigger the report? We don’t have a clock event so far

#

Or can we directly update the product qty on a draft status invoice?

quick compass
#

In that case is there any out of box event that I could use to trigger the report? We don’t have a clock event so far
There is no event to inform about the end of a cycle. Your system should monitor the billing cycle end timestamp and submit final report accordingly

Or can we directly update the product qty on a draft status invoice?
Since the price is set to usage-billing, it can be only perform with usage report

urban folioBOT
dense trout
#

thx

#

one more question. If a user canceled the subscription through customer portal in the middle of the cycle. How we gonna report the latest usage?

sacred arch
#

The Usage should be accumulated until the timing of cancel from Customer Portal. Any time after that I don't think it will count

dense trout
#

Yes, I mean when should I trigger that usage report? If a user click on the cancel button through the portal the invoice will be instantly created right?

#

When should I report the up to date usage?

sacred arch
#

Usage Report API calls should be sent before that timing already, no?

#

ie. if your customer cancel on July 19, you probably have sent the report usage on July 14 or July 15

#

Or do you mean you are actually accumulate the usage and only send it at the end-ish of the period

dense trout
#

Yes we need to accumulate the usage at the end of the period. It was based on user DAU. it may change in every secs.

sacred arch
#

You can customize whether the subscription cancels immediately or at the end of the period by updating your portal configuration through the API or the Dashboard.

  1. https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_cancel-mode
  2. https://dashboard.stripe.com/test/settings/billing/portal
dense trout
#

😂 well per our product design. We do need it to be canceled immediately but also send the latest usage report.