- Introduction
- API Base URL
- Authentication
- Core Resources and Endpoints
- Webhook Integration
- Search Parameters
- Pagination
- Missing Endpoints and Alternatives
- Data Modeling and Relationships
- Testing with Postman
- Code Examples
- Legacy Integration
- WordPress REST API Resources
MemberPress provides a comprehensive REST API through the MemberPress Developer Tools add-on. This API allows developers to programmatically interact with MemberPress data and functionality, including members, memberships, transactions, subscriptions, and more.
All API endpoints use the base URL: /wp-json/mp/v1/
For example, if your site is at https://example.com, the API base URL would be:
https://example.com/wp-json/mp/v1/
The API supports two authentication methods:
- API Key Authentication (Recommended): Using the API key generated in the Developer Tools settings
- WordPress User Authentication: Must be logged in as a user with
remove_userscapability (typically admins)
For API key authentication, add the key to the Authorization header:
Authorization: YOUR_API_KEY
Example authentication test:
curl -X GET "https://example.com/wp-json/mp/v1/me" \
-H "Authorization: YOUR_API_KEY"- Endpoint:
/me - Method: GET
- Description: Test authentication and get basic information about the authenticated user
- Response:
{"success": true, "data": {"username": "admin"}}
- Endpoint:
/me/permissions - Method: GET
- Description: Get permissions for the authenticated user
- Response: List of permissions for the current user
- Note: This endpoint may not be available in all installations. See Missing Endpoints and Alternatives.
- Endpoint:
/members - Method: GET
- Description: List all members
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: General search termsearch[id]: Search by member IDsearch[email]: Search by emailsearch[username]: Search by usernameorderby: Field to order byorder: ASC or DESC
- Endpoint:
/members/{id} - Method: GET
- Description: Get a specific member by ID
- Endpoint:
/members - Method: POST
- Description: Create a new member
- Parameters:
email: (Required) Email addressusername: (Required) Usernamepassword: Password (auto-generated if not provided)first_name: First namelast_name: Last nameaddress1: Address line 1address2: Address line 2city: Citystate: State/provincezip: Postal codecountry: Country codephone: Phone numbersend_password_email: Boolean to send password emailtransaction: Nested transaction object to create along with member
- Endpoint:
/members/{id} - Method: PUT
- Description: Update an existing member
- Parameters: Same as Create Member (except password)
- Endpoint:
/members/{id} - Method: DELETE
- Description: Delete a member
- Endpoint:
/member_options - Method: GET
- Description: Get available options for members (roles, etc.)
- Note: This endpoint may not be available in all installations. See Missing Endpoints and Alternatives.
- Endpoint:
/memberships - Method: GET
- Description: List all memberships
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termsearch[id]: Search by membership IDsearch[title]: Search by titleorderby: Field to order byorder: ASC or DESC
- Endpoint:
/memberships/{id} - Method: GET
- Description: Get a specific membership by ID
- Endpoint:
/memberships - Method: POST
- Description: Create a new membership
- Parameters:
title: (Required) Membership nameprice: Priceperiod: Billing period numberperiod_type: Billing period unit (days, weeks, months, years)trial: Boolean for trial availabilitytrial_days: Number of trial daystrial_amount: Trial amountlimit_cycles: Boolean to limit billing cycleslimit_cycles_num: Number of cycleslimit_cycles_action: Action after cycles completeaccess_url: Custom access URLthank_you_page_enabled: Enable custom thank you pagethank_you_page_type: Thank you page typecustom_thank_you_page_id: Thank you page IDregister_price_action: Register price display optionthank_you_message: Custom thank you messagecustom_login_urls_enabled: Enable custom login URLscustom_login_urls_default: Default login URLcustom_login_urls_expires: Login URL for expired usersis_highlighted: Boolean to highlight in pricinggroup_id: Group ID if part of a group
- Endpoint:
/memberships/{id} - Method: PUT
- Description: Update an existing membership
- Parameters: Same as Create Membership
- Endpoint:
/memberships/{id} - Method: DELETE
- Description: Delete a membership
- Endpoint:
/membership_options - Method: GET
- Description: Get available options for memberships (period types, etc.)
- Note: This endpoint may not be available in all installations. See Missing Endpoints and Alternatives.
- Endpoint:
/memberships/{id}/member_options - Method: GET
- Description: Get member-related options specific to a membership
- Note: This endpoint may not be available in all installations. See Missing Endpoints and Alternatives.
- Endpoint:
/transactions - Method: GET
- Description: List all transactions
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termsearch[id]: Search by transaction IDsearch[member]: Search by member IDsearch[membership]: Search by membership IDsearch[subscription]: Search by subscription IDsearch[status]: Search by statusorderby: Field to order byorder: ASC or DESC
- Endpoint:
/transactions/{id} - Method: GET
- Description: Get a specific transaction by ID
- Endpoint:
/transactions - Method: POST
- Description: Create a new transaction
- Parameters:
member: (Required) Member IDmembership: (Required) Membership IDamount: Transaction amounttax_amount: Tax amounttax_rate: Tax ratestatus: Transaction statusgateway: Payment gatewaysubscription: Subscription ID (if part of subscription)created_at: Creation dateexpires_at: Expiration datesend_welcome_email: Boolean to send welcome email
- Endpoint:
/transactions/{id} - Method: PUT
- Description: Update an existing transaction
- Parameters: Same as Create Transaction
- Endpoint:
/transactions/{id} - Method: DELETE
- Description: Delete a transaction
- Endpoint:
/transactions/{id}/refund - Method: POST
- Description: Refund a transaction
- Endpoint:
/transactions/{id}/refund_and_cancel - Method: POST
- Description: Refund a transaction and cancel its associated subscription
- Endpoint:
/subscriptions - Method: GET
- Description: List all subscriptions
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termsearch[id]: Search by subscription IDsearch[member]: Search by member IDsearch[membership]: Search by membership IDsearch[status]: Search by statusorderby: Field to order byorder: ASC or DESC
- Endpoint:
/subscriptions/{id} - Method: GET
- Description: Get a specific subscription by ID
- Endpoint:
/subscriptions - Method: POST
- Description: Create a new subscription
- Parameters:
member: (Required) Member IDmembership: (Required) Membership IDstatus: Subscription statusperiod: Billing period numberperiod_type: Billing period unitlimit_cycles: Boolean to limit billing cycleslimit_cycles_num: Number of cyclesgateway: Payment gatewaytrial: Boolean for trialtrial_days: Trial daystrial_amount: Trial amountcreated_at: Creation date
- Endpoint:
/subscriptions/{id} - Method: PUT
- Description: Update an existing subscription
- Parameters: Same as Create Subscription
- Endpoint:
/subscriptions/{id} - Method: DELETE
- Description: Delete a subscription
- Endpoint:
/subscriptions/{id}/cancel - Method: POST
- Description: Cancel a subscription
- Endpoint:
/subscriptions/{id}/suspend - Method: POST
- Description: Suspend a subscription
- Endpoint:
/subscriptions/{id}/resume - Method: POST
- Description: Resume a suspended subscription
- Endpoint:
/groups - Method: GET
- Description: List all membership groups
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termorderby: Field to order byorder: ASC or DESC
- Endpoint:
/groups/{id} - Method: GET
- Description: Get a specific group by ID
- Endpoint:
/groups - Method: POST
- Description: Create a new group
- Parameters:
title: (Required) Group namepricing_page_disabled: Boolean to disable on pricing pagegroup_theme: Theme for group displayis_upgrade_path: Boolean for upgrade pathupgrade_path_text: Text for upgrade pathpricing_display: Display option for pricingpage_id: Page IDurl: URL for group page
- Endpoint:
/groups/{id} - Method: PUT
- Description: Update an existing group
- Parameters: Same as Create Group
- Endpoint:
/groups/{id} - Method: DELETE
- Description: Delete a group
- Endpoint:
/rules - Method: GET
- Description: List all access rules
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termorderby: Field to order byorder: ASC or DESC
- Endpoint:
/rules/{id} - Method: GET
- Description: Get a specific rule by ID
- Endpoint:
/rules - Method: POST
- Description: Create a new access rule
- Parameters:
title: (Required) Rule namerule_type: Type of rulecontent_type: Content typecontent_id: Content IDdrip_enabled: Boolean for content drippingdrip_amount: Drip amountdrip_unit: Drip unitdrip_after: Drip after eventdrip_after_fixed: Fixed date for drippingexpires_enabled: Boolean for expirationexpires_amount: Expiration amountexpires_unit: Expiration unitexpires_after: Expires after eventexpires_after_fixed: Fixed date for expirationunauth_excerpt_type: Unauthorized excerpt typeunauth_excerpt_size: Unauthorized excerpt sizeunauth_message_type: Unauthorized message typeunauth_message: Unauthorized messageunauth_login: Show login formmemberships: Array of membership IDs that can access
- Endpoint:
/rules/{id} - Method: PUT
- Description: Update an existing rule
- Parameters: Same as Create Rule
- Endpoint:
/rules/{id} - Method: DELETE
- Description: Delete a rule
- Endpoint:
/coupons - Method: GET
- Description: List all coupons
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termorderby: Field to order byorder: ASC or DESC
- Endpoint:
/coupons/{id} - Method: GET
- Description: Get a specific coupon by ID
- Endpoint:
/coupons - Method: POST
- Description: Create a new coupon
- Parameters:
code: (Required) Coupon codediscount_type: Type of discountdiscount_amount: Discount amountvalid_date: Start dateexpiration_date: Expiration dateusage_amount: Maximum usage counttrial: Boolean for trialtrial_days: Trial daysshould_apply_tax: Boolean to apply taxmemberships: Array of membership IDs
- Endpoint:
/coupons/{id} - Method: PUT
- Description: Update an existing coupon
- Parameters: Same as Create Coupon
- Endpoint:
/coupons/{id} - Method: DELETE
- Description: Delete a coupon
- Endpoint:
/reminders - Method: GET
- Description: List all reminders
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termorderby: Field to order byorder: ASC or DESC
- Endpoint:
/reminders/{id} - Method: GET
- Description: Get a specific reminder by ID
- Endpoint:
/reminders - Method: POST
- Description: Create a new reminder
- Parameters:
name: (Required) Reminder nameevent: Event to trigger remindertrigger_length: Trigger timing lengthtrigger_interval: Trigger timing intervaltrigger_timing: Before or after eventenabled: Boolean to enable/disablesubject: Email subjectbody: Email bodyuse_template: Boolean to use templatememberships: Array of membership IDs
- Endpoint:
/reminders/{id} - Method: PUT
- Description: Update an existing reminder
- Parameters: Same as Create Reminder
- Endpoint:
/reminders/{id} - Method: DELETE
- Description: Delete a reminder
- Endpoint:
/events - Method: GET
- Description: List all events
- Query Parameters:
page: Page number (default: 1)per_page: Items per page (default: 10)search: Search termsearch[event]: Search by event typeorderby: Field to order byorder: ASC or DESC
MemberPress allows you to subscribe to events via webhooks to receive notifications when certain actions occur.
- Endpoint:
/webhooks/subscribe - Method: POST
- Description: Subscribe to MemberPress events
- Parameters:
url: (Required) Callback URL for notificationsevent: (Required) Event type or "all" for all events
- Endpoint:
/webhooks/unsubscribe/{id} - Method: DELETE
- Description: Unsubscribe from webhook
The following events can be subscribed to with webhooks:
transaction-completed: When a transaction is completedtransaction-refunded: When a transaction is refundedtransaction-failed: When a transaction failstransaction-expired: When a transaction expiresrecurring-transaction-completed: When a recurring transaction is completedrecurring-transaction-failed: When a recurring transaction failssubscription-created: When a subscription is createdsubscription-paused: When a subscription is pausedsubscription-resumed: When a subscription is resumedsubscription-stopped: When a subscription is stoppedsubscription-upgraded: When a subscription is upgradedsubscription-downgraded: When a subscription is downgradedmember-signup: When a member signs upmember-account-updated: When a member account is updated
Most list endpoints support advanced search with parameters like:
search[id]=123: Search by IDsearch[email]=user@example.com: Search by emailsearch[username]=john: Search by usernamesearch[status]=active: Search by status
Examples:
# Search members by email
curl -X GET "https://example.com/wp-json/mp/v1/members?search[email]=user@example.com" \
-H "Authorization: YOUR_API_KEY"
# Search transactions by member ID
curl -X GET "https://example.com/wp-json/mp/v1/transactions?search[member]=123" \
-H "Authorization: YOUR_API_KEY"All list endpoints support pagination with:
page: Page number (default: 1)per_page: Items per page (default: 10)
Response headers include:
X-WP-Total: Total number of itemsX-WP-TotalPages: Total number of pages
Example:
# Get page 2 with 20 items per page
curl -X GET "https://example.com/wp-json/mp/v1/members?page=2&per_page=20" \
-H "Authorization: YOUR_API_KEY"Some endpoints documented may not be available in all installations:
/membership_options/member_options/me/permissions/memberships/{id}/member_options
While the dedicated options endpoint may be missing, you can extract options from existing memberships:
# Get a specific membership to see available fields/options
curl -X GET "https://example.com/wp-json/mp/v1/memberships/123" \
-H "Authorization: YOUR_API_KEY"Key option fields in the response include:
period_type: Available values include "lifetime", "days", "weeks", "months", "years"trial_once: Boolean for one-time trial optiontax_class: Available tax classespricing_display: Display optionscustom_template: Available templates
Similarly, member options can be extracted from a member object:
# Get a specific member to see available fields/options
curl -X GET "https://example.com/wp-json/mp/v1/members/123" \
-H "Authorization: YOUR_API_KEY"Key information includes:
- Address field structure
- Profile fields structure
- Transaction data structure
- Subscription data structure
While there's no direct endpoint for permissions, you can:
- Use the
/meendpoint to get your authenticated identity - Try accessing other endpoints to determine your permissions empirically
The /events endpoint also provides insights into what actions are tracked and potentially what permissions exist in the system.
The relationship between memberships and members can be explored through:
- Getting a specific membership details:
/memberships/{id} - Searching transactions for a specific membership:
/transactions?search[membership]={id} - Searching members with active memberships: Inspect the
active_membershipsarray in member responses
Understanding the relationships between resources is crucial for effectively using the API:
-
Members (WordPress users) can have:
- Multiple transactions (purchases)
- Multiple subscriptions
- Multiple active memberships
-
Memberships (products) can:
- Be purchased by multiple members
- Be associated with multiple transactions
- Be part of a group
- Have specific rules for content access
-
Transactions are always linked to:
- One member (buyer)
- One membership (product purchased)
- Optionally one subscription (if recurring)
-
Subscriptions are always linked to:
- One member (subscriber)
- One membership (subscribed product)
- Multiple transactions (recurring payments)
Postman is a popular API client that makes it easy to test, document, and share APIs. This section explains how to set up and use Postman to test the MemberPress API.
-
Install Postman:
- Download and install Postman from the official website
- Create an account or sign in if you already have one
-
Understand the Interface:
- Collections: Groups of saved requests
- Environments: Sets of variables for different environments (e.g., development, production)
- Request Builder: Where you create and configure API requests
- Response Viewer: Where you view API responses
-
Create a New Collection:
- Click "New" > "Collection"
- Name it "MemberPress API"
- Add a description like "API endpoints for MemberPress"
- Click "Create"
-
Add Folders to Organize Endpoints:
- Right-click on the collection and select "Add Folder"
- Create folders for different resource types (Members, Memberships, Transactions, etc.)
-
Set Up Authentication:
- Click on the "MemberPress API" collection
- Go to the "Authorization" tab
- Select "API Key" from the Type dropdown
- Set "Key" to "Authorization"
- Set "Value" to your MemberPress API key
- Set "Add to" to "Header"
- Click "Save"
-
Create Authorization Helper:
- Create a new request named "Verify Authentication"
- Set the method to GET
- Set the URL to
{{base_url}}/me(we'll define the base_url variable later) - Click "Save"
-
Create Member Request:
- In the "Members" folder, create a new request
- Name it "List Members"
- Set the method to GET
- Set the URL to
{{base_url}}/members - Click "Save"
-
Create Membership Request:
- In the "Memberships" folder, create a new request
- Name it "Get Specific Membership"
- Set the method to GET
- Set the URL to
{{base_url}}/memberships/{{membership_id}} - Click "Save"
-
Create a POST Request:
- In the "Members" folder, create a new request
- Name it "Create Member"
- Set the method to POST
- Set the URL to
{{base_url}}/members - Go to the "Body" tab and select "raw" and "JSON"
- Add a JSON body:
{ "email": "new_member@example.com", "username": "new_member", "password": "secure_password", "first_name": "New", "last_name": "Member" } - Click "Save"
-
Create an Environment:
- Click on the "Environments" tab in the left sidebar
- Click "Add" to create a new environment
- Name it "MemberPress Dev"
-
Add Variables:
- Add a variable named "base_url" with the value "http://localhost:10044/wp-json/mp/v1" (adjust as needed)
- Add a variable named "api_key" with your MemberPress API key
- Add variables for common IDs like "membership_id" or "member_id"
- Click "Save"
-
Use the Environment:
- Select "MemberPress Dev" from the environment dropdown in the top right
- Your requests will now use these variables
-
Create Multiple Environments:
- You can create different environments for development, staging, and production
- This allows you to easily switch between different MemberPress installations
To make it easier to get started, we've created a Postman Collection with pre-configured requests for the MemberPress API. You can import this collection to quickly begin testing the API.
-
Download the Collection:
- Download the MemberPress API Postman Collection file included in this repository
-
Import into Postman:
- In Postman, click "Import" in the top left
- Select the downloaded file
- Click "Import"
-
Configure Your Environment:
- Create a new environment as described above
- Set the "base_url" and "api_key" variables
- Start testing the API!
Below is a snippet of what the Postman Collection JSON looks like. You can use this as a reference to create your own collection:
{
"info": {
"name": "MemberPress API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Authentication",
"item": [
{
"name": "Verify Authentication",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{api_key}}",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/me",
"host": ["{{base_url}}"],
"path": ["me"]
}
}
}
]
},
{
"name": "Members",
"item": [
{
"name": "List Members",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{api_key}}",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/members",
"host": ["{{base_url}}"],
"path": ["members"]
}
}
},
{
"name": "Get Member",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{api_key}}",
"type": "text"
}
],
"url": {
"raw": "{{base_url}}/members/{{member_id}}",
"host": ["{{base_url}}"],
"path": ["members", "{{member_id}}"]
}
}
}
]
}
]
}curl -X GET "https://example.com/wp-json/mp/v1/me" \
-H "Authorization: YOUR_API_KEY"curl -X GET "https://example.com/wp-json/mp/v1/members" \
-H "Authorization: YOUR_API_KEY"curl -X POST "https://example.com/wp-json/mp/v1/members" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "new_customer@example.com",
"username": "new_customer",
"password": "securePassword123",
"first_name": "Jane",
"last_name": "Smith"
}'curl -X POST "https://example.com/wp-json/mp/v1/transactions" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"member": 123,
"membership": 456,
"amount": 25.00,
"status": "complete",
"gateway": "manual"
}'curl -X POST "https://example.com/wp-json/mp/v1/subscriptions" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"member": 123,
"membership": 456,
"status": "active",
"period": 1,
"period_type": "months",
"gateway": "manual"
}'# Search by ID
curl -X GET "https://example.com/wp-json/mp/v1/members?search[id]=123" \
-H "Authorization: YOUR_API_KEY"
# Get active subscriptions
curl -X GET "https://example.com/wp-json/mp/v1/subscriptions?search[status]=active" \
-H "Authorization: YOUR_API_KEY"
# Get transactions for a specific membership
curl -X GET "https://example.com/wp-json/mp/v1/transactions?search[membership]=456" \
-H "Authorization: YOUR_API_KEY"<?php
function makeApiRequest($endpoint, $method = 'GET', $data = null) {
$api_key = 'YOUR_API_KEY';
$base_url = 'https://example.com/wp-json/mp/v1';
$url = $base_url . $endpoint;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: $api_key"
]);
if ($method === 'POST' || $method === 'PUT') {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
if ($data) {
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: $api_key",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
}
}
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}<?php
$members = makeApiRequest('/members');
print_r($members);<?php
$data = [
"member" => 123,
"membership" => 456,
"amount" => 25.00,
"status" => "complete",
"gateway" => "manual"
];
$result = makeApiRequest('/transactions', 'POST', $data);
print_r($result);<?php
// 1. Create a member
$memberData = [
'email' => 'user@example.com',
'username' => 'newuser',
'password' => 'securePassword',
'first_name' => 'John',
'last_name' => 'Doe'
];
$member = makeApiRequest('/members', 'POST', $memberData);
$memberId = $member['id'];
// 2. Create a transaction
$transactionData = [
'member' => $memberId,
'membership' => 456, // Membership ID
'amount' => 29.99,
'status' => 'complete',
'gateway' => 'manual'
];
$transaction = makeApiRequest('/transactions', 'POST', $transactionData);
// 3. Create a subscription (if recurring)
$subscriptionData = [
'member' => $memberId,
'membership' => 456, // Membership ID
'status' => 'active',
'period' => 1,
'period_type' => 'months',
'gateway' => 'manual'
];
$subscription = makeApiRequest('/subscriptions', 'POST', $subscriptionData);fetch("https://example.com/wp-json/mp/v1/memberships", {
method: "GET",
headers: {
"Authorization": "YOUR_API_KEY"
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));const memberData = {
email: "api_user@example.com",
username: "api_user",
password: "SecurePassword123",
first_name: "API",
last_name: "User"
};
fetch("https://example.com/wp-json/mp/v1/members", {
method: "POST",
headers: {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify(memberData)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));For backward compatibility, MemberPress also provides a WordPress Ajax endpoint:
- Endpoint:
/wp-admin/admin-ajax.php?action=mepr_user - Method: GET
- Authentication: Basic Auth (username/password)
- Response Formats: JSON (default), XML (add
&fmt=xml), CSV (add&fmt=csv)
Developers can also integrate directly with MemberPress using its PHP classes:
// Get a user
$user = new MeprUser(123);
// Check if user has access to a membership
$has_access = $user->has_access_to_product(456);
// Get active subscriptions
$subscriptions = $user->active_product_subscriptions();
// Record custom event
MeprEvent::record('custom-event-name', $user);The MemberPress API is built on top of the WordPress REST API framework. Understanding the WordPress REST API can help you work more effectively with the MemberPress API. Here are some valuable resources:
- Using the REST API - A guide on getting started with the WordPress REST API
- WordPress REST API Handbook - Complete documentation of the WordPress REST API
- Key Concepts - Understanding the fundamental concepts of the REST API
- Frequently Asked Questions - Answers to common questions about the WordPress REST API
-
Authentication - The MemberPress API uses a custom authentication method, but it's built on WordPress authentication principles explained in the Authentication section of the WordPress REST API handbook.
-
Schema - WordPress REST API uses a schema for defining the structure of API responses. Understanding this will help you interpret MemberPress API responses.
-
Custom Endpoints - MemberPress defines custom endpoints using the WordPress REST API's Extending the REST API framework.
-
Parameter Handling - MemberPress follows WordPress REST API conventions for parameters, including pagination and filtering.
The MemberPress API follows these patterns from the WordPress REST API:
- URL Structure:
/wp-json/namespace/version/resource - HTTP Methods: GET for retrieval, POST for creation, PUT/PATCH for updates, DELETE for removal
- Response Format: JSON responses with consistent structures
- Error Handling: Standard HTTP status codes and error messages
Familiarity with the WordPress REST API will make working with the MemberPress API more intuitive and enable you to troubleshoot issues more effectively.