How can I retrieve all active and archived plans from Memberstack's DOM endpoint without pagination support?

Post author
Muhammad Shahshan

Hi everyone,

I’m fetching plans using the DOM package, but my Memberstack app has around 45 plans while I’m only receiving 31. I tried using pagination, but it doesn’t seem to exist in this endpoint. 

Just to add i am trying to fetch all plans Including archive and active

Comments

5 comments

  • Comment author
    A J

    Hey Muhammad Shahshan,

    I just tested having 40+ plans in personal workspace and when I use the getPlans(), I receive all of them in one go.

    Can you share the site / page where you are implementing this use-case? It will help in testing out the issue.

    0
  • Comment author
    Tyler Bell

    I believe that function only returns active plans

    It doesn't return plans that are unavailable to add to a member

    0
  • Comment author
    Muhammad Shahshan

    Tyler Bell A J yup that's the case, it only give active plans, so there is no way to get archive plans all together ?

    0
  • Comment author
    A J

    Hey Muhammad Shahshan,

    Currently, I believe you can use the window.$memberstackDom.getPlan({ planId: "REPLACE-WITH-ARCHIVED-PLAN-ID" });. That will retrieve that specific plan even if it is archived. You can create a simple script to loop through the plan IDs and retrieve the info accordingly.

    Another way to do it would be to have a CMS in Webflow for this purpose which stores the relevant plan information that you want to store and you can show the collection list on the page accordingly. Alternatively, you can store the relevant information in Memberstack's Data Tables, while it is in Beta currently, it might be worth exploring to see if it fits for your project requirements.

    Hope this gives you some idea.

    0
  • Comment author
    Muhammad Shahshan

    Thanks, will look into it

    0

Please sign in to leave a comment.