[Membership 2] Where is the data saved

I want to develop a plugin which utilized the Membership 2 API. But I can’t seem to find where the data of Membership 2 plugin is stored. I checked the database of MySQL for tables for Membership 2 but couldn’t find one. Please advice.

  • Nahid
    • Tech Support

    Hey there Rushabh !

    Hope you are having a great day!

    Nahid here, following up from our last Live Chat session. Responding here to state that we have heard back from our developers and they have confirmed that Membership 2 doesn’t use a custom database table. It utilizes the default WordPress {prefix}_posts, {prefix}_postmeta and {prefix}_options tables.

    Hope this helps. Please let us know if you need any further assistance regarding this. Thanks!

    Kind regards,

    Nahid

  • Rushabh
    • New Recruit

    Nahid Thanks for your answer, I also wanted to know if there is anyway I can call an external API once a membership is purchased with the ‘amount’ as payload?

    Alternatively is there any way I can get the amount paid by the user through an API?

    I am using membership 2 pro plugin.

  • Dimitris
    • Support Star

    Hello there Rushabh,

    hope you’re doing well today! :slight_smile:

    After enabling the

    Membership 2 -> Add-ons -> Rest API

    then the Rest API docs are listed in

    Membership 2 -> Help -> Rest API

    After doing that, the closest endpoint that you could use, should be:

    5. Check is member is subscribed to membership /wp-json/membership2/v1/member/subscription [GET]

    Parameters

    – membership_id : The membership id (required)

    – user_id : The user id (required)

    Response is a Subscription object

    If you need additional information from the database, then I’m afraid that you should build your own custom queries for these.

    Warm regards,

    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.