> For the complete documentation index, see [llms.txt](https://rymera.gitbook.io/wholesale-suite-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rymera.gitbook.io/wholesale-suite-api/wholesale-v1-wwpp/variations.md).

# Variations

The wholesale role API allows you to create, view, update, and delete wholesale variations.

Note that you can still use wc product properties set in WC API since our API is just extending from WC.

Note that you need to create the variable parent first via `wholesale/v1/products` endpoint before you can use this endpoint.

#### Available Routes:

* **GET:** wholesale/v1/products/{variable\_id}/variations
* **GET:** wholesale/v1/products/{variable\_id}/variations/{variation\_id}
* **POST:** wholesale/v1/products/{variable\_id}/variations
* **PUT:** wholesale/v1/products/{variable\_id}/variations/{variation\_id}
* **DELETE:** wholesale/v1/products/{variable\_id}/variations/{variation\_id}
* **POST:** wholesale/v1/products/{variable\_id}/variations/batch

## Wholesale Data Property

To get wholesale related data, it can be accessed using the property `wholesale_data` in the response.

#### Ex. Request:

**GET:** <http://example.com/wp-json/wholesale/v1/products/4303/variations/4306?wholesale\\_role=wholesale\\_customer>

#### Ex. Response:

```javascript
{
    "id": 3419,
    {...wc variation props},
    "wholesale_data": {
        "wholesale_price": {
            "wholesale_customer": "80",
        },
        "price_html": "<del class=\"original-computed-price\"><span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>100.00</bdi></span></del><span style=\"display: block;\" class=\"wholesale_price_container\">\r\n                                            <span class=\"wholesale_price_title\">Wholesale Price:</span>\r\n                                            <ins><span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>80.00</bdi></span> <small class=\"woocommerce-price-suffix wholesale-price-suffix\"></small></ins>\r\n                                        </span>"
     }
 }
```

**Note:** The `price_html` data will only show up if wholesale role is provided. The `price_html` contains the regular + wholesale price in html format. If not a wholesale product, it will show the regular price in html format.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://rymera.gitbook.io/wholesale-suite-api/wholesale-v1-wwpp/variations.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
