- This topic has 1 reply, 2 voices, and was last updated 8 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › eMember – using API to remove a membership level
Tagged: api, more_membership_levels, WP eMember, wp membership
Good day, I’ve poked through most of the documentation but cannot find a solution for a particular problem. We need the ability, through the api, to remove a membership level from a user. If there are no other levels to the user, then have it just deactivate the account.
From what I can see, I can add a membership level, or a user and I can de-activate a user. But no way to de-activate a level for user.
The update API allows you to update the membership level and account status of a member:
For example, you can pass the level ID using the following query parameter to update the membership level:
membership_level_id
If you are using the multiple membership levels per user feature then you can also pass the additional/secondary levels using the following parameter:
more_membership_levels
Updating the membership level has the same effect as removing the old level(s) and applying the new level(s).
The API does a particular thing only. If you need to apply your own logic then you need to do that in your own custom code.
So for example you can first query a member’s record and inspect its membership level:
Then call the update API accordingly to update the level or change the account status to “inactive”