Subscription Questions

I have a few questions about using the built-in monetization. I’d ideally like to retrieve the subscription object and be able to deterministically determine my apps usage against the subscription given that state (and some record keeping on my end).

Say my app provides 1000 queries per month to paying users. The subscription object looks like this:

app_subscription {
    plan_id
    is_trial
    renewal_date
    billing_period
    days_left
  }

Since I don’t have the start/end dates of the current period, it seems difficult to count the number of queries within the monthly period since I don’t know when in the month the subscription started.

If the subscriptions are pro-rated based on the calendar months, I can just count usage based on calendar months per subscriber, which isn’t too hard. Is this the case?

If not, I could try to listen to some of the webhook events and track subscription changes this myself, but if I miss a webhook, this will get out of sync quickly.

All this has me considering building out my monetization on an external vendor instead of with Monday, but I thought I would check in and see if there was some guidance around determining the current usage tracking interval from the subscription object.

Subscriptions are either monthly or yearly, so you can work out the start date based on the days left and the billing period.

You can then figure out when the next month ends and check a user’s usage accordingly.

Thanks, I think that makes sense. Are the monthly cycles 30 days? So I can find (30 - days left) days ago, and compute usage since that time?

Yearly is also a puzzle since the 30 day partitions won’t divide into 365 days evenly.

No, monthly subscriptions are based a specific day of the month. So subscriptions that start on the 3rd renew on the third of the next month.

As for yearly, I’d use the same policy — calculate what day of the month the subscription ends on (eg, the 28th) and then reset a user’s usage on that day every month.

As for subscriptions that start on the 31st, it’s up to you how you want to calculate it. For simplicity, you can just reset usage on the last day of the month (even if the month has 28 days).

Frankly, don’t overthink it. What matters to customers is that your policy will be consistent and transparent. As long as your policy makes reasonable sense and you let your customers know about it in your product documentation, you will be fine :slight_smile: