This API handles fetching wholesale category discounts.
Postman
List all wholesale role discounts from a specific category:
GET: /wp-json/wholesale/v1/category-discount/{category_id}
Status: 200 OK
List all wholesale role discounts from a specific category.
GET: /wp-json/wholesale/v1/category-discount/{category_id}
Response:
{
"id": 15,
"name": "Uncategorized",
"wholesale_discounts": {
"wholesale_customer_wholesale_discount": 123,
"WholesaleBronze_wholesale_discount": 0
}
}
Status: 400 Bad Request
The category id does not exist.
GET: /wp-json/wholesale/v1/category-discount/{category_id}
Response:
{
"code": "wholesale_rest_category_discount_cannot_view",
"message": "Category ID is invalid.",
"data": {
"status": 400
}
}