How to add or remove multiple free plans in a single REST API call? Answered

Post author
Joseph Lewis

Hi everyone, does anyone know if there is a way to add or remove multiple free plans through a single REST API call?

Basically we want to update the user's plan when a custom field called "Revenue" is between certain values. E.g. Bronze Plan is added when revenue is between 10,000 and 20,000, change to silver when revenue is between 20,000 and 30,0000.
 
Thanks!

Comments

6 comments

  • Comment author
    A J

    I believe the easiest way would be to utilize Plan Logic to add and remove all / specific free plans based on a condition in case it helps your use-case.

    Hmm are you planning to add multiple plans if the revenue reaches between 10K to 20K or is it just one plan that you want to add, and by doing so you might want to remove the other existing free plans this user is associated with?

    0
  • Comment author
    Joseph Lewis

    That's right, so they will only ever have one plan at a time. When they go above 20k, they would change from Bronze to Gold

    0
  • Comment author
    A J

    Okay so you can use the Plan Logic that I linked earlier for this. So I am not sure of the setup yet, i.e. if you have an automation to check the custom field periodically etc., but you can assign a free plan via code / automation and just have a rule in Memberstack dashboard, that whenever Bronze plan is added to the member, remove all free plans and so on for each plan that you want to have this connection for. Does this work for your use-case?

    0
  • Comment author
    Joseph Lewis

    We're giving that a go now thanks for your help!

    0
  • Comment author
    Raquel Lopez

    Just to expand on this a little bit. You can add or remove plans via API as long as they are FREE. https://developers.memberstack.com/docs/admin-package/admin-package-rest#remove-free-plan-from-a-member

    You can create a logic with a Webhook (member update) to track any modifications made to that field and execute the action when it satisfies the conditional. Plan logic allows you to cancel paid plans, but nothing allows you to add paid plans automatically. The user must always accept any change made to its billing agreement.

    0
  • Comment author
    Joseph Lewis

    Thank you for this, we are only using free plans so that helps

    0

Please sign in to leave a comment.