- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Restrict Content Pro - REST API
This plugin provides a REST API for Restrict Content Pro. It is dependent upon the WordPress REST API and does not function without it.
Endpoint:
The RCP REST API is available at /wp-json/rcp/.
If the default wp-json endpoint has been changed, the rcp endpoint will respect that change, so adjust accordingly.
Versioning:
Each distinct version of the REST API is accessible via the rcp endpoint. Versions may be deprecated at anytime but at no time will breaking changes be implementing without incrementing the version number. Past versions are expected to be kept available for at least six months beyond the release of the proceeding version.
- /wp-json/rcp/{version}/{route}
Example:
- /wp-json/rcp/v1/{route}
Authentication
The RCP REST API requires authenticating with a WordPress user account that has the necessary capabilities in order to view, modify, and delete information via the REST API.
Please see the WordPress REST API Authentication documentation to instructions on how to authenticate with the API.
Routes
There are four routes provided with this API:
Members:
GET/wp-json/rcp/{version}/members/GET/wp-json/rcp/{version}/members/{member_id}POST/wp-json/rcp/{version}/members/newPOST/wp-json/rcp/{version}/members/update/{member_id}DELETE/wp-json/rcp/{version}/members/
Each of the three HTTP methods support additional arguments that can be passed in with the body of the request.
GET /wp-json/rcp/{version}/members/:
Required parameters:
None.
Optional parameters:
status- Retrieve only members with the specified status-
active,pending,cancelled,expired
subscription- The subscription level ID from which to retrieve membersrecurring- Whether to include recurring or non-recurring members only-
1,0
number- The total of members to retrieve per pageoffset- The number of members to skip (for pagination purposes)orderby- The field on which to order the members returned-
- Any field allowed to be passed to get_users()
order- The direction which to sort members-
ASC,DESC
s- Search value, such as the name, email, or user log in of the member
GET /wp-json/rcp/{version}/members/{member_id}:
Required parameters:
id- The member ID to retrieve. Can be passed in the URL or as part of the body.
Optional parameters:
None.
POST /wp-json/rcp/{version}/members/new:
Required parameters:
login- The log in name to assign to the newly created member account
Optional parameters:
status- The subscription status to assign to the memberexpiration- The expiration date to assign to the membersubscription- The subscription level ID to assign to the memberprofile_id- The payment profile ID of the memberrecurring- Boolean flag that indicates if the subscription is recurring or one-time only-
1or0
- Any parameter supported by wp_insert_user()
POST /wp-json/rcp/{version}/members/update/{member_id}:
Required parameters:
id- The member ID to update. Can be passed in the URL or as part of the body.
Optional parameters:
status- The subscription status to assign to the memberexpiration- The expiration date to assign to the membersubscription- The subscription level ID to assign to the memberprofile_id- The payment profile ID of the memberrecurring- Boolean flag that indicates if the subscription is recurring or one-time only-
1or0
- Any parameter supported by wp_insert_user()
DELETE /wp-json/rcp/{version}/members/delete:
Required parameters:
id- The ID of the member account to delete
Optional parameters:
None.
Payments:
GET/wp-json/rcp/{version}/payments/GET/wp-json/rcp/{version}/payments/{payment_id}POST/wp-json/rcp/{version}/payments/newPOST/wp-json/rcp/{version}/payments/update/{payment_id}DELETE/wp-json/rcp/{version}/payments/
Each of the three HTTP methods support additional arguments that can be passed in with the body of the request.
POST /wp-json/rcp/{version}/payments/new:
Required parameters:
user_id- The member account ID the payment belongs toamount- The total amount of the paymentsubscription- The name of the subscription level the payment was recorded for
Optional parameters:
status- The status of the payment-
completeorrefunded
subscription_key- The subscription key of the level the payment was recorded fortransaction_id- The transaction ID from the merchant processor of the paymentdate- The date the payment was processedpayment_type- A descriptor of the payment type-
- Example:
Credit Card,PayPal, orCredit Card One Time
- Example:
POST /wp-json/rcp/{version}/payments/update/{payment_id}:
id- The payment ID to update. Can be passed in the URL or as part of the body.
Optional parameters:
amount- The total amount of the paymentuser_id- The member account ID the payment belongs tostatus- The status of the payment-
completeorrefunded
subscription- The name of the subscription level the payment was recorded forsubscription_key- The subscription key of the level the payment was recorded fortransaction_id- The transaction ID from the merchant processor of the paymentdate- The date the payment was processedpayment_type- A descriptor of the payment type-
- Example:
Credit Card,PayPal, orCredit Card One Time
- Example:
DELETE /wp-json/rcp/{version}/payments/delete:
Required parameters:
id- The ID of the payment record to delete
Optional parameters:
None.
Earnings:
GET/wp-json/rcp/{version}/earnings/
Levels:
GET/wp-json/rcp/{version}/levels/GET/wp-json/rcp/{version}/levels/{level_id}POST/wp-json/rcp/{version}/levels/newPOST/wp-json/rcp/{version}/levels/update/{level_id}DELETE/wp-json/rcp/{version}/levels/
Each of the three HTTP methods support additional arguments that can be passed in with the body of the request.
GET /wp-json/rcp/{version}/levels/:
Required parameters:
None.
Optional parameters:
status- Default isall. Set toactiveorinactiveto only retrieve those levels.limit- Number of levels to return in the results. Default isnullto retrieve all levels.orderby- Database column name used to order the results. Default islist_order.
GET /wp-json/rcp/{version}/levels/{level_id}:
Required parameters:
id- The ID of the membership level to retrieve. Can be passed in the URL or as part of the body.
Optional parameters:
None.
POST /wp-json/rcp/{version}/levels/new:
Required parameters:
name- The name of the membership level.
Optional parameters:
description- Description of the level.duration- Integer length of the level or "unlimited".duration_unit- Duration unit, such as "day", "month", or "year".trial_duration- Integer length of the integrated free trial, or0for none.trial_duration_unit- Trial duration unit, such as "day", "month", or "year".price- Integer or float price for the level.0for free.fee- Integer or float signup fee.list_order- Integer. Determines where in the registration list the level appears. Lower numbers appear first.level- Integer. Associated access level (1-10).status-activeorinactive.role- Associated user role granted to members of this level.
POST /wp-json/rcp/{version}/levels/update/{level_id}:
id- The membership level ID to update. Can be passed in the URL or as part of the body.
Optional parameters:
name- Name of the level.description- Description of the level.duration- Integer length of the level or "unlimited".duration_unit- Duration unit, such as "day", "month", or "year".trial_duration- Integer length of the integrated free trial, or0for none.trial_duration_unit- Trial duration unit, such as "day", "month", or "year".price- Integer or float price for the level.0for free.fee- Integer or float signup fee.list_order- Integer. Determines where in the registration list the level appears. Lower numbers appear first.level- Integer. Associated access level (1-10).status-activeorinactive.role- Associated user role granted to members of this level.
DELETE /wp-json/rcp/{version}/levels/delete:
Required parameters:
id- The ID of the membership level to delete.
Optional parameters:
None.