How can I tell if a Subscription (or Tracked Item) is "paid" for (subscription still valid)
I've looked all through the API. I must be missing it.
USE CASE
I wantt to look up a Code (customer's ID) and see if a certain plan (or Tracked Item) is currently "paid" (i.e., still active), or expired (cancelled and beyond the last payment period).
It looks like maybe I'd use either:
- The hook: subscription[plan][items][][quantityIncluded]
Or - retrieve the customer info and parse through it an look for :
OR, IS IT SOMETHING ELSE?
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Marcela Poffald on 02 Jul, 2018 03:01 PM
Hi Clay,
You should be able to get the information you need from the result of a
customers/get
call, which returns all of a customer's invoice history and subscription details. For example, have a look at this sample response.You can see that this customer's subscription is active, because there is no
canceledDateTime
(canceled customers will have a timestamp forcanceledDateTime
).As for the tracked items, all invoice details for a customer are shown in the response as well, and tracked items are shown under
charges
, as a charge with atype
of "item". In the above example, we can see that this customer had 0PROJECTS
and 3USERS
on their last invoice:Hope this helps! Let me know if you have any other questions.
Marcela
2 Posted by Clay Nichols on 02 Jul, 2018 03:52 PM
If someone were Cancelled but they are within the period they paid for, then they are "still on a valid subscription", correct (*detailed use case below, FYI) ?
The only way I see to check whether they are "canceled bu paid up for now" is :
Check
1. do they have a Cancelled Date?
2. If so, was it more than a month ago?
(So we'd have to assume everyone is a month long payment cycle. I think everyone is)
They cancel on the 5th.
We check their status on the 10th and it shows "cancelled" but their subscription is still valid until the next 1st, correct?
3 Posted by Clay Nichols on 02 Jul, 2018 03:54 PM
I suppose we could also look at this customer meta data to figure how how long they are paid up through, right?
months
1
or is there an easier way?
4 Posted by Marcela Poffald on 02 Jul, 2018 04:56 PM
Hi Clay,
I think you're on the right track here:
When a customer is canceled in Cheddar, all that means to Cheddar is that we won't bill them anymore. Your application can use the data Cheddar provides to regulate access to your product in whatever way you need. You could use the data Cheddar sends in response to the
customers/get
call (such ascanceledDateTime
,cancelReason
, and invoice history), your own custom metadata, and/or thesubscriptionCanceled
hook, and then build logic into your application that will extend their access for however long you'd like.Does that make sense? Let me know if you have any followup questions!
Marcela
5 Posted by Marcela Poffald on 11 Jul, 2018 03:22 PM
Hi Clay,
We haven't heard from you in a while on this issue, so I'm going to go ahead and close this discussion. Feel free to reply and reopen it if you have any other questions!
Marcela
Marcela Poffald closed this discussion on 11 Jul, 2018 03:22 PM.