After a customer has cancelled subscription, why I can still query him from API and the isAvtive status for the plan is active?

bo.xu's Avatar

bo.xu

09 Feb, 2012 05:21 PM

Also For hosted page solution, I setup Customer create/Update/cancel Return URLs, but how do I know which customer? It would be very nice if the the request sent form CG can contain customer code.
Anyways,right now I rely on client side cookie on our site to determine which user in our system and use the id which is the custom code in cg's system. But I found that even after a customer has cancelled subscription, why I can still query him from API and the isAvtive status for the plan is active. So what is the reliable way to query customer's existence and status from API? Thank you.

  1. Support Staff 1 Posted by Marc Guyer on 10 Feb, 2012 02:09 PM

    Marc Guyer's Avatar

    Hi Bo -- The isActive node you're referring to is a child of the plan node. Therefore, it means that the plan is active, not the subscription. A subscription is in good standing if it does not have a canceledDatetime.

  2. 2 Posted by bo.xu on 10 Feb, 2012 02:25 PM

    bo.xu's Avatar

    Ok thanks for the clarification . Oh what is your recommended way to query a user exist or not from API?

  3. 3 Posted by bo.xu on 10 Feb, 2012 02:29 PM

    bo.xu's Avatar

    I know there is cancelation event hook. Would that be the preferred way to tell a user has been canceled programmatically? Thanks.

  4. Support Staff 4 Posted by Marc Guyer on 10 Feb, 2012 02:39 PM

    Marc Guyer's Avatar

    Oh what is your recommended way to query a user exist or not from API?

    If you call the customers/get method and receive a 404 response code, the customer does not exist.

    Would that be the preferred way to tell a user has been canceled programmatically? Thanks.

    Well, there's the cancel event hook to receive push information about a cancellation. Also, the customers/get API response contains all the information about a customer. If the latest subscription record is canceled, then, well, there you go.

  5. 5 Posted by bo.xu on 13 Feb, 2012 06:57 PM

    bo.xu's Avatar

    Thanks for answers. But I do have a follow-up question. A customer can have multiple subscriptions, is that true? if so is each subscription associated with one and only one product or what is it associated with? and how do I determine which product/plan has been cancelled? Thanks a million.

  6. 6 Posted by bo.xu on 13 Feb, 2012 09:21 PM

    bo.xu's Avatar

    oh, ok. product code is part of the path. so every thing is for the product. So the real question is now that
    1. will a customer have multiple "in good standing" subscriptions? It looks to me the list of subscriptions is more like a history list. So in that sense only latest subscription matters in terms of whether it is active or not and what plan is subscribed?

    1. a subscription will never contain more than one plans, right?
  7. Support Staff 7 Posted by Marc Guyer on 14 Feb, 2012 01:51 PM

    Marc Guyer's Avatar

    will a customer have multiple "in good standing" subscriptions? It looks to me the list of subscriptions is more like a history list. So in that sense only latest subscription matters in terms of whether it is active or not and what plan is subscribed?

    You've got it! Multiple subscriptions means history. Only one is active at a time (the latest one).

    a subscription will never contain more than one plans, right?

    Correct.

  8. 8 Posted by bo.xu on 14 Feb, 2012 02:59 PM

    bo.xu's Avatar

    > ==================================================
    > From: Marc Guyer
    > Subject: After a customer has cancelled subscription, why I can still query him from API and the isAvtive status for the plan is active?
    >
    >> will a customer have multiple "in good standing" subscriptions? It looks to me the list of subscriptions is more like a history list. So in that sense only latest subscription matters in terms of whether it is active or not and what plan is subscribed?
    >
    > You've got it! Multiple subscriptions means history. Only one is active at a time (the latest one).
    >

    Perfect. Will the latest subscription always be the first in the subscriptions element of response? just trying to simply coding, I could always check the created time stamp if that is not always true.

    >> a subscription will never contain more than one plans, right?
    >
    > Correct.
    >
    > View this Discussion online: http://support.cheddargetter.com/discussions/problems/1149-after-a-customer-has-cancelled-subscription-why-i-can-still-query-him-from-api-and-the-isavtive-status-for-the-plan-is-active
    > --

  9. Support Staff 9 Posted by Marc Guyer on 14 Feb, 2012 06:00 PM

    Marc Guyer's Avatar

    Perfect. Will the latest subscription always be the first in the subscriptions element of response? just trying to simply coding, I could always check the created time stamp if that is not always true.

    Yes, the latest will always be first.

  10. Marc Guyer closed this discussion on 17 Feb, 2012 01:30 PM.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM