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}

Required parameters:

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

Optional parameters:

  • None.

New customer

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

Required parameters:

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

Optional parameters:

  • 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:

  • 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.