Create a General Discount
This API handles creating a wholesale general discount for specific role.
Method
Endpoint
POST
/wp-json/wholesale/v1/general-discount
Status: 200 OK
Create a general discount for specific wholesale role.
The response will list down all general discount currently set.
POST: /wp-json/wholesale/v1/general-discount/
JSON Body:
{
"wholesale_role": "wholesale_customer",
"wholesale_discount": "10"
}
Response:
{
"message": "Successfully created new general discount.",
"data": {
"Wholesale_bronze": 12,
"wholesale_customer": 10
}
}Status: 400 Bad Request
The wholesale discount is already created. To fix this either perform update to update the discount or delete the discount then re-add new. See their respective sections.
Status: 400 Bad Request
Non existing wholesale role.
Last updated
Was this helpful?