#diplodocus-invoice-trial

1 messages · Page 1 of 1 (latest)

arctic lotus
#

@untold crane there isn't a firm way to filter that I know of unfortunately. Definitely avoid string match (because localization...)
What I usually recommend, though not great, is to look at the line items' amount compared to the quantity/price

#

like if you have a line for the subscription item for a $100 Price but the quantity is 1 and amount is $0 you know it was a trial 😦

untold crane
#

Problem is, we have a free tier so some $0 invoices are not trials

#

The free tier is not a trial but rather for certain categories of business

arctic lotus
#

I don't think there's a better way

#

let me ask my team in case I missed something obvious

untold crane
#

Looks like I could check if period_end and period_start are before the subscriptions trial_end

arctic lotus
#

that wouldn't work for multiple trials

#

which can happen on subs for many reasons (people do trials to pause subscriptions for example)

untold crane
#

I noticed a trial invoice has period_start and period_end as the same value. Would that be true of all trial invoices?

arctic lotus
#

nope

#

The period of the invoice is MIN(line item on invoice creation, subscription creation)

#

If you create a customer today, then create an invoice item today adn tomorrow create a subscription the period would be period_start: invoice item creation, period end: subscription creation

arctic lotus
#

@untold crane are you mostly unblocked?

untold crane
#

Yeah, since all of our subscriptions are one year, I think I can check for the difference between period_start and period_end being exactly one year

#

Our trials are just for adjusting the billing anchor, so they should all be under a year

arctic lotus
#

yeah but then any kind of billing cycle change, pause for personal reasons, etc. will be miscounted

#

but I don't think there's a better way than that and slowly analyzing edge-cases and taking them into account

untold crane
#

Agreed. Thanks for your help.