> For the complete documentation index, see [llms.txt](https://expedy.gitbook.io/openapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://expedy.gitbook.io/openapi/produto/group.md).

# Group

## Post Group

<mark style="color:green;">`POST`</mark> `/v1/product/group`

Endpoint para cadastro de novos grupos

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |
| Authorization<mark style="color:red;">\*</mark> | String | Access token para autenticação. |

#### Request Body

| Name                                   | Type   | Description    |
| -------------------------------------- | ------ | -------------- |
| name<mark style="color:red;">\*</mark> | String | Nome do grupo. |

{% tabs %}
{% tab title="201: Created Exemplo de Response." %}

```json
{
	"idERP_Grupo": 72,
	"name": "NOVOS GRUPOS OPEN API"
}
```

{% endtab %}
{% endtabs %}

Segue abaixo o exemplo de body de requisição. **Os parâmetros obrigatórios para o grupo são: name**.

```json
## Exemplo de body ##
{
    "name": "NOVOS GRUPOS OPEN API"
}
```

## Get All Groups

<mark style="color:blue;">`GET`</mark> `/v1/product/group`

Endpoint para consulta de todos os grupos.

#### Query Parameters

| Name                                       | Type   | Description                                 |
| ------------------------------------------ | ------ | ------------------------------------------- |
| pageSize<mark style="color:red;">\*</mark> | String | Quantidade de itens por página. Default: 10 |
| page<mark style="color:red;">\*</mark>     | String | Número da página. Default: 1.               |
| name                                       | String | nome do grupo                               |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Access token para autenticação. |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200: OK Exemplo de Response." %}

```json
{
  "paging": {
    "total": 31,
    "page": 1,
    "limit": 10,
    "offset": 0
  },
 "grupos": [
		{
			"idERP_Grupo": 68,
			"name": "TESTE GRUPOSSS"
		}
	]
}
```

{% endtab %}

{% tab title="200: OK Nenhuma categoria cadastrada." %}

```json
{
  "paging": {
    "total": 0,
    "page": "1",
    "limit": "5",
    "offset": 0
  },
  "Categorias": []
}
```

{% endtab %}
{% endtabs %}

Todos os parâmetros são opcionais para o request, podendo serem usados para aprimoramento da pesquisa.

## Get Group by ID

<mark style="color:blue;">`GET`</mark> `/v1/product/group/:id`

Enpoint para consulta de grupo por id

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | Id do grupo |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Access token para autenticação. |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200: OK Exemplo de Response." %}

```json
{
	"idERP_Grupo": 67,
	"name": "TESTE GRUPOSS"
}
```

{% endtab %}
{% endtabs %}

Para consultar a categoria é necessário mandar o id, deixando a url como **`/v1/product/category/7`** por exemplo.

## Put Group

<mark style="color:orange;">`PUT`</mark> `/v1/product/group/:id`

Enpoint para update de um grupo específico.

#### Path Parameters

| Name                                 | Type   | Description  |
| ------------------------------------ | ------ | ------------ |
| id<mark style="color:red;">\*</mark> | String | Id do grupo. |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Access token para autenticação. |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

#### Request Body

{% tabs %}
{% tab title="200: OK Exemplo de Response." %}

```json
{
	"idERP_Grupo": 68,
	"name": "NOVOS GRUPOS OPEN API"
}
```

{% endtab %}
{% endtabs %}

Segue abaixo o body contendo todos os campos que podem ser alterados. **Colocar o id do grupo a ser alterada no parâmetro**, ficando com a url no estilo **`/v1/product/group/7`** por exemplo.

```
## Exemplo de body ##
{
    "name": "NOVOS GRUPOS OPEN API 666"
}
```

## Delete Group

<mark style="color:red;">`DELETE`</mark> `/v1/product/group/:id`

Endpoint para deletar uma categoria.

#### Path Parameters

| Name                                 | Type   | Description  |
| ------------------------------------ | ------ | ------------ |
| id<mark style="color:red;">\*</mark> | String | Id do grupo. |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Access token para autenticação. |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                |

{% tabs %}
{% tab title="200: OK Exemplo de Response." %}

```json
{
  "message": "Grupo excluido com sucesso!"
}
```

{% endtab %}
{% endtabs %}

**Colocar o id do grupo a ser deletada no parâmetro**, ficando com a url no estilo **`/v1/product/grupo/68`** por exemplo.


---

# 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:

```
GET https://expedy.gitbook.io/openapi/produto/group.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.
