#afonsolfm

1 messages · Page 1 of 1 (latest)

hushed kilnBOT
floral nymph
#

Hello

#

I'm not exactly sure what you mean by "paid until"?

robust chasm
#

I am looking at latest_invoice.period_end is that what I want?

#

Well I have a SaaS, and I want to make sure user can only use the product if he has paid full amount until that point

floral nymph
#

Ah

robust chasm
#

I want to extract a date from the subscription

floral nymph
#

Really you just want to look at the status of the Subscription

robust chasm
#

Yes, it's past_due

floral nymph
#

If it is active then the Subscription has been paid

robust chasm
#

Yeah, isnt there a date I can refer to though?

floral nymph
#

Otherwise, it is not currently paid and you should not provision access

#

You can look at the last paid Invoice and the period_end on that Invoice if you want. Or the first unpaid Invoice and the period_start

robust chasm
#

is that always accurate though?

floral nymph
#

Otherwise yeah you can look at the Subscription's current_period_start

robust chasm
#

in which scenarios does that break?

floral nymph
#

That all depends on your integration and what you are doing

#

The easiest thing to do here is to track the Subscription. So when it moves to past_due you look at current_period_start

#

That is the timestamp at which it no longer was paid (active)

robust chasm
#

Ok thanks, I've just withdrawn access if it's not active.

floral nymph
#

👍