The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

How to gather active sub_tokens for customers?

Hey guys,

Earlier this year, we built some custom code that checked the Foxy API for "active" subscriptions for a customer, so we could tag our currently subscribed customers in our email marketing platform. (See discussion here.)

Now, we want to gather all active sub_token_url's for a customer.

But our sub_token_url is modified by our SSO auto-login setup. So instead of the regular sub_token_url which looks like this:
... we've modified it so customers can automatically login, so now it looks like this:


1) To gather all the active sub_tokens for a customer, would we be filtering subscriptions in the Foxy API based on the customer (id ?) and grabbing all sub_token_url's for active subscriptions? (Can we get the sub_token alone from the Foxy API ?)

2) And then for our custom SSO auto-login URL, I assume we can just transform the sub_token by prepending it with ?

Thanks in advance.
  • fc_adamfc_adam FoxyCart Team

    That's exactly right. You'd loop through the returned subscriptions from the API to get the sub_token attribute for each one, and then you can modify it within your script to be formatted however you need.
Sign In or Register to comment.