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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rymera.gitbook.io/wholesale-suite-api/wholesale-v1-wwpp/category-discounts/retrieve-category-discount.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
