This API handles updating a wholesale general discount for specific role.
Postman
Update a wholesale discount for a specific wholesale role:
PUT: /wp-json/wholesale/v1/general-discount/{wholesale_role_key}
JSON Body:
{
"wholesale_discount": "30"
}
Status: 200 OK
Update the general discount of a specific wholesale role.
PUT: /wp-json/wholesale/v1/general-discount/{wholesale_role_key}
JSON Body:
{
"wholesale_discount": "30"
}
Response:
{
"message": "Successfully updated general discount.",
"data": {
"wholesale_customer": 30,
"wholesale_bronze": 20
}
}
Status: 400 Bad Request
The general discount for specific wholesale role is not yet created. Cannot update if the wholesale discount does not exist.
PUT: /wp-json/wholesale/v1/general-discount/{wholesale_role_key}
JSON Body:
{
"wholesale_discount": "30"
}
Response:
{
"code": "wholesale_rest_general_discount_cannot_update",
"message": "The wholesale role does not exist.",
"data": {
"status": 400
}
}
Status: 400 Bad Request
The wholesale role does not exist.
PUT: /wp-json/wholesale/v1/general-discount/{wholesale_role_key_invalid}
JSON Body:
{
"wholesale_discount": "30"
}
Response:
{
"code": "wholesale_rest_general_discount_cannot_update",
"message": "The wholesale role does not exist.",
"data": {
"status": 400
}
}