Allowing customers to change next subscription date

Hello,

We wish to allow the customer to change their next upcoming autoship date(s). I’m going to hire a developer for this, but wanted to clearly scope out the work.

Our site is a webflow + foxycart website, and I’m curious about the best place to put a “date picker” for modification of the next_date on existing subscriptions. I’m trying to keep things as simple and reliable as possible.

Would it be possible to modify the next_date via foxy API on the Foxycart checkout page after directing the customer to the checkout with a sub_token link? I was looking at the API documentation, and don’t see any reference to a next_date: https://api.foxycart.com/docs/reference

I know customers are sent sub_token links in the original receipt email, but how can a customer retrieve their sub_tokens at a later date? What is the best way to get customers their sub_token links for all their active subscriptions?

Please advise.

Thank you.


Concept:
image
Comments
  • FYI, I found the next_transaction_date in the API documentation.

    My other questions still remain.
  • brettbrett FoxyCart Team
    Hey @Epotratz.
    I know customers are sent sub_token links in the original receipt email, but how can a customer retrieve their sub_tokens at a later date?
    Every email receipt that's sent will include links with the sub_tokens. Check out the html subscription links: language string to see or customize that.
    What is the best way to get customers their sub_token links for all their active subscriptions?
    Currently, that's going to be via the API.

    Since you mentioned a dev (and it's worth noting we're happy to map this out to save you and your dev time), here's a possible approach:

    1. You tweak the email's language to include a link to "Change your billing/shipping date" in the email receipts Foxy sends out. (These links are sub_token URLs, with &cart=checkout&h:date_change=true params added.)

    2. The user clicks the link and lands right on the checkout. The user enters their email and password.

    3. You add a little to your checkout template to look for the date_change param, and if present, add a date picker field on the checkout and some explanatory text.

    4. When the checkout is submitted, the datepicker custom field gets sent to you in the webhook. You find that and update the subscription via the API.

    Would that make sense for you?
  • Hey @brett,

    Thanks for the response.

    What do you mean by html subscription links: language string? Is this something I find in the custom email template code.. or?

    Regarding the next transaction date update, I'll pass this info on to Jacob our developer!

    Thanks!
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    The language string @brett mentioned can be found on the "languages" section of your store's FoxyCart administration. Any customer facing language string is editable from this section.
  • Ahh, gotcha. Thanks.
  • @brett

    You made this suggestion in your previous post:
    3. You add a little to your checkout template to look for the date_change param, and if present, add a date picker field on the checkout and some explanatory text.

    4. When the checkout is submitted, the datepicker custom field gets sent to you in the webhook. You find that and update the subscription via the API.
    The idea of overlapping custom date fields over native date fields sounds scary and prone to problems, especially since this ship date is also outputting to the receipt.

    Is there anyway we could modify and update the cart_start_date on the checkout page before the transaction is submitted?


  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Unfortunately right now it's not possible to change a subscriptions configuration once it's already in the cart. A new subscription would need to be started to alter those dates within the cart, or use the API to alter them.
  • @fc_adam,

    Is there anything technically wrong with updating the "Start Date" and "Next Date" with the same date via the API?

    FYI, we are hiding the Start Date and Next Date dates from the cart and receipt, so the customer never sees them.
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    The next date will need to be a date in the future from the start date. Could you clarify what would be the use case for needing those to be the same?
  • @fc_adam,

    We allow the customer to modify their "next" shipment date. If it's a new subscription, this means we need to modify the "start date" but if they choose a date beyond the start date, then it fails because we can't post a "start date" after a "next date". So we're just looking at changing both the Start and Next Date at the same time to make this happen.

    The admin allows the Start and Next Date to be the same. We have an order in the queue for tomorrow to test the functionality.

  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    Actually I stand corrected - I think it should actually be ok. Definitely let us know how your tests go when the normal subscription processing runs tomorrow, but from looking at the code it should work fine. Sorry for the confusion.
Sign In or Register to comment.