Apply Discount Voucher
This API endpoint allows applying a voucher code for a customer. The request body must contain the voucher code.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will apply the voucher and return a confirmation message.
  • If the request is unauthorized or invalid, the system will respond with an error message.
Request Body Parameters
  • code string
    The voucher code to be applied. Example: 'AAACCCBBDD-CSSSS1'
JavaScript
Response codes
const axios = require('axios');

const url = "https://customer-cmd.api.pinghome.io/v1/customer/applied-voucher";
const data = {
  "code": "AAACCCBBDD-CSSSS1"
};

axios.post(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).