Subscription questions

Hey guys

I'm just getting started with subscriptions (finally!) and have a few questions I'm finding from the api.

My subscriptions are monthly recurring, no end date. We have two 'levels' of membership: basic & gold.

- How can I tell when a customer's card is about to expire from the api?
- How can I see the subscription description via the api - so that I can tell which subscription level is active (I've tried setting this in the description and as an option and can't find it in the data)?
- How do I prevent someone who already has an account from placing an order for a second subscription using the same email address?

Thanks
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    - How can I tell when a customer's card is about to expire from the api?
    You would use the subscription datafeed for that: http://wiki.foxycart.com/static/redirect/subscription_datafeed. Unlike the transaction datafeed, the sub datafeed is sent every day as needed, and contains information about subscriptions with past due amounts, subscriptions that are about to end and payment methods that are about to expire.
    - How can I see the subscription description via the api - so that I can tell which subscription level is active (I've tried setting this in the description and as an option and can't find it in the data)?
    If you fetch the subscription with the API, you can check the "transaction template" which will contain an XML representation of the subscription cart. If you edit a subscription in your store's administration, and click the "advanced edit" button, you'll see what that content looks like.
    - How do I prevent someone who already has an account from placing an order for a second subscription using the same email address?
    Good question. Will you require people be signed in on your site before they go to checkout? If so - you could use the SSO endpoint to do a check before the customer reaches the checkout to see if they already have a subscription present.

    If not, you would have to add a check using javascript to the checkout. After the customer enters their email address you would send off an AJAX request to your side to see if that email already has a subscription purchased. That endpoint would need to be secured behind an SSL to allow communication with the secure checkout.
  • Thanks @fc_adam

    I'll get to work on those. I'd already pieced some of it together.

    It looks like if I retrieve the customer data it includes the expiry date on the credit card as well. My understanding is that FC only stores 1 cc, so would that also be an accurate way of looking up the expiring soon? ( I want it so that when customers login, I can show a link to update the card if it's expiring soon.)

    We're not requiring people to sign in before they check out, so we'll have to implement the AJAX request you suggested.

    One more question:

    I'm looking how to manage upgrades / downgrades in packages. I thought the best way to handle that would be modifying the existing subscription rather than delete and add a new subscription. Can the code, price & description be updated in the `transaction_template` field?

    Thanks
  • fc_adamfc_adam FoxyCart Team
    It looks like if I retrieve the customer data it includes the expiry date on the credit card as well. My understanding is that FC only stores 1 cc, so would that also be an accurate way of looking up the expiring soon? ( I want it so that when customers login, I can show a link to update the card if it's expiring soon.)
    You could check the entered expiry on the checkout and display an alert if it's about to expire. The subscription datafeed approach would be a more robust solution though as it wouldn't rely on customers logging in - it will alert users with existing subscriptions that have no need to hit your checkout.
    Can the code, price & description be updated in the `transaction_template` field?
    Yes it can - you can modify the transaction_template as much as you need.
  • Cool. Thanks @fc_adam
    The subscription datafeed approach would be a more robust solution though as it wouldn't rely on customers logging in - it will alert users with existing subscriptions that have no need to hit your checkout.
    Yeah, I'm actually planning to use both: I can use the datafeed to send an email reminder, but once they login, it will also be front and center for those that don't check email as often. (this client has an online service, so users should be logging in regularly anyhow.)

    Cheers!
Sign In or Register to comment.