# Retrieve Category Discount

This API handles fetching wholesale category discounts.

{% tabs %}
{% tab title="Request" %}

| Method       | Endpoint                                               |
| ------------ | ------------------------------------------------------ |
| GET          | /wp-json/wholesale/v1/category-discount/{category\_id} |
| {% endtab %} |                                                        |

{% tab title="Request Example" %}

#### Postman

List all wholesale role discounts from a specific category:

```javascript
GET: /wp-json/wholesale/v1/category-discount/{category_id}
```

{% endtab %}

{% tab title="Response Example" %}

#### 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
    }
}
```

{% endtab %}
{% endtabs %}
