Back

MemberPress API Essential Guide

Aug 14, 20246 minute read

What type of API does MemberPress provide?

Type of API

  • MemberPress provides a REST API

Key Features

  • The REST API is part of the MemberPress Developer Tools add-on
  • It offers full REST API capabilities
  • The API allows listing, creating, updating, and deleting objects like Members, Events, Transactions, Rules, and more

Authentication

  • The API can be accessed using an API Key
  • Basic Authentication is also supported, but API Key is the preferred and more secure method

Availability

  • The Developer Tools add-on is only included with MemberPress Plus and Pro Editions

Best Practices

  • The API documentation recommends using the API Key for authentication rather than Basic Auth for security reasons
  • Starting from version 1.2.14, the password argument for member create and update was removed due to security concerns

Does the MemberPress API have webhooks?

Yes, the official MemberPress API does have webhooks. Here are the key points about MemberPress webhooks:

Webhook Support

  • MemberPress Developer Tools allow you to configure webhooks to send POST requests to any URL you specify for numerous events that occur in MemberPress.

  • You can configure multiple webhook URLs as needed.

Supported Webhook Events

MemberPress supports a wide range of webhook events, including:

  • Member events:

    • Member Added
    • Member Signup Completed
    • Member Account Info Updated
    • Member Deleted
    • Member Logged In
  • Subscription events:

    • Subscription Created
    • Subscription Paused
    • Subscription Resumed
    • Subscription Stopped
    • Subscription Upgraded
    • Subscription Downgraded
    • Subscription Expired
  • Transaction events:

    • Transaction Completed
    • Transaction Refunded
    • Transaction Failed
    • Transaction Expired
    • Recurring Transaction Completed
    • Recurring Transaction Failed
    • Recurring Transaction Expired
    • Non-Recurring Transaction Completed
    • Non-Recurring Transaction Expired
  • Reminder events:

    • After Member Registers
    • After Signup Abandoned
    • Before Subscription Expires
    • After Subscription Expires
    • Before Subscription Renews
    • After Credit Card Expires
    • Before Credit Card Expires

Webhook Configuration

  • Webhooks can be configured in the MemberPress Developer Tools section of the WordPress admin panel.

  • You can view example POST requests for each event and send test POST requests to your configured webhook URLs.

Webhook Authentication

  • Since version 1.2.5, MemberPress Developer Tools introduced a Webhook Key setting for authentication.

  • The Webhook Key can be found in the MemberPress menu > Developers > Webhook tab.

  • You can use this key to authenticate webhook POST requests by checking for the memberpress-webhook-key in the HTTP headers.

Additional Notes

  • The MemberPress Developer Tools add-on is only included with the MemberPress Plus and Pro Editions.

  • Webhook events are sent using WordPress cron, so proper configuration of WP Cron is important for reliable webhook delivery.

In summary, MemberPress offers a comprehensive webhook system that allows you to subscribe to a wide variety of events related to members, subscriptions, transactions, and reminders. This enables developers to create powerful integrations and automate workflows based on actions occurring within MemberPress.

Rate Limits and other limitations

Based on the search results provided, there is no specific information about the API rate limits for the MemberPress API. The search results primarily contain information about MemberPress API usage and documentation, but do not mention any specific rate limits.

Here are the key points to consider:

  1. The search results do not provide any explicit information about MemberPress API rate limits.

  2. The MemberPress Developer Tools addon extends MemberPress to include a full REST API and webhook event capability [2].

  3. The documentation for the webhook events and REST API URLs can be found in the plugin's interface, which provides dynamic results to work from and the ability to test webhooks directly from your site [2].

  4. Authentication for the MemberPress API is done using an API key, which should be included in the HTTP request header as "MEMBERPRESS-API-KEY" [2].

  5. While there are no specific rate limits mentioned for MemberPress, it's common for APIs to have some form of rate limiting to prevent abuse and ensure fair usage.

Best Practices

Even though specific rate limits are not mentioned, it's generally a good idea to:

  1. Implement proper error handling in your code to deal with potential rate limiting or other API errors.

  2. Use the API responsibly and avoid making an excessive number of requests in a short period.

  3. Consider implementing caching mechanisms on your end to reduce the number of API calls you need to make.

  4. Check the MemberPress documentation or contact their support for the most up-to-date information on any potential rate limits.

Summary

While the search results do not provide specific information about MemberPress API rate limits, it's important to use the API responsibly and be prepared to handle any potential rate limiting that may be in place. For the most accurate and up-to-date information on rate limits, it would be best to consult the official MemberPress documentation or contact their support team directly.

Latest API Version

Based on the search results provided, here are the key points regarding the most recent version of the MemberPress API:

Current Version

The most recent version of the MemberPress Developer Tools Add-on, which includes the API, is 1.2.18, released on 01/16/2024 [1].

Key Features

  1. The MemberPress Developer Tools Add-on extends MemberPress to include a full REST API and full Webhook event capability [3].

  2. It provides dynamic, in-plugin configuration and documentation for both the REST API and webhook events [5].

  3. The REST API allows developers to list, create, update, and delete various objects such as Members, Events, Transactions, Rules, and more [5].

Recent Changes

Some notable recent changes and features include:

  1. Addition of a webhook authentication key in version 1.2.5 [3].

  2. Removal of the password argument for member create and update in version 1.2.14 due to security concerns [3].

  3. Addition of new hooks and filters for developers to customize functionality [1].

  4. Improvements in PHP 8.2/8.3 compatibility [2].

Best Practices

  1. Use the API Key provided by MemberPress Developer Tools for authentication instead of Basic Authentication for better security [3].

  2. Utilize the dynamic documentation provided in the plugin interface for up-to-date information on webhook events and REST API URLs [3].

  3. When working with webhooks, use the Webhook Key setting for authentication of webhook POST requests [3].

Summary

The MemberPress API, part of the Developer Tools Add-on, is regularly updated with new features and security improvements. The most recent version (1.2.18) focuses on enhancing developer capabilities, improving security, and ensuring compatibility with newer PHP versions. Developers should refer to the in-plugin documentation for the most current and detailed information on using the API and webhooks.

How to get a MemberPress developer account and API Keys?

To get a developer account for MemberPress to create an API integration, you need to follow these steps:

  1. Ensure you have a MemberPress Plus or Pro plan The MemberPress Developer Tools add-on, which provides API access, is only available on the Plus and Pro plans. If you're on the Basic plan, you'll need to upgrade to gain access.

  2. Install and activate the MemberPress Developer Tools add-on

  • Log in to your WordPress dashboard
  • Go to MemberPress > Add-ons
  • Scroll down to find the MemberPress Developer Tools add-on
  • Click "Install Add-on" and then activate it
  1. Access the Developer Tools Once installed and activated, you'll see a new "Developer" option in the MemberPress menu.

  2. Get your API Key

  • Go to MemberPress > Developer > REST API
  • You'll find your API Key on this page
  1. Use the API Key for integrations When setting up integrations or making API calls, you'll need to use this API Key for authentication. For example, when connecting to services like Zapier or Make (formerly Integromat), you'll need to provide your API Key and website URL.

What can you do with the MemberPress API?

Based on the search results provided, here's a list of data models you can interact with using the MemberPress API, along with what is possible for each:

Members

  • List members
  • Create new members
  • Update existing members
  • Delete members
  • Retrieve member account information
  • Update member account information

Subscriptions

  • Create subscriptions
  • Pause subscriptions
  • Resume subscriptions
  • Stop subscriptions
  • Upgrade subscriptions
  • Downgrade subscriptions
  • Check subscription expiration

Transactions

  • List transactions
  • Create transactions
  • Update transactions
  • Delete transactions
  • Mark transactions as completed
  • Refund transactions
  • Handle failed transactions
  • Handle expired transactions

Rules

  • List rules
  • Create rules
  • Update rules
  • Delete rules

Memberships

  • List memberships
  • Create memberships
  • Update memberships
  • Delete memberships
  • Retrieve thank you page type and ID

Events

  • Retrieve event data
  • Send test POST requests for events

Custom Fields

  • Update custom fields for members

User Meta

  • Add and update user meta information

Courses (if using MemberPress Courses)

  • Interact with course-related events and data

Key Points to Consider:

  • The API allows for full CRUD (Create, Read, Update, Delete) operations on most data models.
  • Webhook events are available for many actions, allowing for real-time integrations.
  • The API documentation is dynamically generated within the plugin interface, providing up-to-date information.
  • Some operations, like updating member passwords, have been removed for security reasons in recent versions.
  • The API can be used for advanced integrations with custom code and services like Zapier.

Best Practices:

  • Use the provided webhook key for authentication when setting up webhook integrations.
  • Refer to the in-plugin documentation for the most current and accurate API information.
  • Be aware of security considerations, such as not exposing sensitive data through the API.
  • Utilize the available filters and hooks for customizing API behavior when needed.