In order to ‘Register User’ or ‘Retrieve Password’, the authentication for a user with ‘Administrator’ role is required. While this is a delibrately done for security reasons, such implementation makes it very hard for Front End applications to implement a simple ‘Register’ or ‘Sign Up’ function.
The simple solution is use this wp-rest-user plugin. This plugin full fill such requirement by extending the existing WordPress REST API endpoints.
USAGE
Send a POST request to /wp-json/wp/v2/users/register
, including a JSON body with three keys: username, email and password.
Send a POST request to /wp-json/wp/v2/users/lostpassword
, including a JSON body with three keys: user_login.
You can use postman to as bellow picture

Or even ajax request, please see the code bellow
<script>
function addUserData(){
$.ajax( {
url: 'http://localhost/lapaktrip/wp-json/wp/v2/users/register',
method: 'POST',
contentType: "application/json; charset=utf-8",
dataType: "json",
data:JSON.stringify({
'username' : 'testmember',
'email' : '[email protected]',
'password' : '123456'
})
} ).done( function ( response ) {
console.log( response );
} )
}
</script>
<button onclick="addUserData()">Start Sending</button>
Hope this answer can help many people out there. Happy Codding.