REST API - Customers Route

The customers route allows you to interact with the Restrict Content Pro customers database to retrieve customers, add new ones, update existing customers, and delete customers.

Note: This endpoint is only available if you have Restrict Content Pro version 3.0 or higher installed.

Get customers

GET /wp-json/rcp/{version}/customers/

Required parameters:

  • None.

Optional parameters:

  • user_id (int) - A user ID number to filter by.
  • email_verification (string) - An email verification status to filter by.
    • verified, pending, none
  • count (bool) - Whether to return a count of customers (true) or an array of customer objects (false). Default is false.
  • number (int) - Maximum number of results.
  • offset (int) - Number of customers to offset the query. Default is 0.
  • search (string) - Search term(s) to retrieve matching customers for.

Get specific customer

GET /wp-json/rcp/{version}/customers/{customer_id}

One of the following parameters is required:

  • id - The customer ID to retrieve. Can be passed in the URL or as part of the body.
  • user_email - The email address of the customer to retrieve.
  • user_login - The username of the customer to retrieve.

Note: The user_email and user_login parameters require version 1.2 or higher.


New customer

POST /wp-json/rcp/{version}/customers/new

Required parameters:

  • user_id (int) - The ID of the associated user account.

Optional parameters:

  • has_trialed (int) - Whether or not the customer has used a free trial. Set to 0 if the customer has never used a trial, or 1 if they have. Default 0.
  • date_registered (string) - Date the customer was registered in MySQL format. Defaults to today.
  • email_verification (string) - Email verification status.
    • verified, pending, none
  • last_login (string) - Date the customer last logged in, in MySQL format.

Update customer

POST /wp-json/rcp/{version}/customers/update/{customer_id}

Required parameters:

  • id (int) - The ID of the customer to update. Can be passed in the URL or as part of the body.

Optional parameters:

  • has_trialed (int) - Whether or not the customer has used a free trial. Set to 0 if the customer has never used a trial, or 1 if they have.
  • user_id (int) - The ID of the associated user account.
  • date_registered (string) - Date the customer was registered in MySQL format. Defaults to today.
  • email_verification (string) - Email verification status.
    • verified, pending, none
  • last_login (string) - Date the customer last logged in, in MySQL format.

Delete customer

DELETE /wp-json/rcp/{version}/customers/delete

Required parameters:

  • id (int) - The ID of the customer to delete

Optional parameters:

  • None.
Have more questions? Submit a request