Update Customer Username
This API endpoint allows updating the username of an existing customer by providing a valid email.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the username will be updated, and a message will confirm that verification is required. To complete the process, you need to verify the new username using the Confirm Customer Username Change endpoint.
  • If the request is unauthorized or invalid, the system will respond with an error message.
Request Body Parameters
  • email string
    The email address to be associated with the customer's username. Example: 'pinghome@gmail.com'
JavaScript
Response codes
const axios = require('axios');

const url = "https://customer-cmd.api.pinghome.io/v1/customer/username";
const data = {
    "email": "pinghome@gmail.com"
};

axios.put(url, data, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).