> 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-wwp/wholesale-role/update-a-wholesale-role.md).

# Update a Wholesale Role

This API allows you to update wholesale role.

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

| Method | Endpoint                                |
| ------ | --------------------------------------- |
| PUT    | /wp-json/wholesale/v1/roles/{role\_key} |

| Path Parameters |          |        |                                   |
| --------------- | -------- | ------ | --------------------------------- |
| role\_key       | required | string | Wholesale Role Key to be updated. |

| Body Parameters | Type   | Required | Description                 |
| --------------- | ------ | -------- | --------------------------- |
| role\_name      | string | no       | Wholesale Role name.        |
| description     | string | no       | Wholesale Role description. |
| {% endtab %}    |        |          |                             |

{% tab title="Request Example" %}

#### Postman

```
PUT: /wp-json/wholesale/v1/roles/wholesale_customer

JSON Body: 
{
    "role_name" : "updated name",
    "description" : "updated desc",
    "shipping_class_name" : "",
    "shipping_class_term_id" : "",
    "only_allow_wholesale_purchases" : "no"
}
```

{% endtab %}

{% tab title="Response Example" %}

#### Status: 200 OK

```
{
    "message": "Wholesale Role \"wholesale_customer\" has been updated.",
    "data": {
        "wholesale_customer": {
            "roleName": "Wholesale Customer",
            "desc": "updated desc test",
            "main": true
        }
    }
}
```

{% endtab %}
{% endtabs %}
