> 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/supplier.md).

# Supplier

## Post Supplier

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

Endpoint para cadastro de novos fornecedores

#### 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 fornecedor. |

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

```json
{
	"message": "Cadastrado com sucesso!",
    "Fornecedor": {
        "_id": "6a1ed4042cb3bf316b3227d5",
        "name": "TESTE OPENAPI",
        "company": 3,
        "createdAt": "2026-06-02T13:00:52.924Z",
        "updatedAt": "2026-06-02T13:00:52.924Z",
        "idERP_Fornecedor": 280,
    }
}
```

{% endtab %}
{% endtabs %}

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

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

## Get All Suppliers

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

Endpoint para consulta de todos os fornecedores.

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

#### 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
  },
  "Fornecedores": [
    {
      "_id": "6862cfbc3beeb1396f53e27f",
      "name": "TESTE",
      "company": 3,
      "createdAt": "2025-06-30T17:56:12.326Z",
      "updatedAt": "2025-06-30T17:56:12.326Z",
      "idERP_Fornecedor": 1
    }
  ]
}

```

{% 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 Supplier by ID

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

Enpoint para consulta de fornecedor por id

#### Path Parameters

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

#### 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
{
    "Fornecedor": {
        "_id": "6862cfbc3beeb1396f53e27f",
        "name": "TESTE",
        "company": 3,
        "createdAt": "2025-06-30T17:56:12.326Z",
        "updatedAt": "2025-06-30T17:56:12.326Z",
        "idERP_Fornecedor": 1,
    }
}
```

{% endtab %}
{% endtabs %}

## Put Supplier

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

Enpoint para update de um fornecedor específico.

#### Path Parameters

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

#### 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
{
    "message": "Campos Alterados Com Sucesso!",
    "Fornecedor": {
        "_id": "6862cfbc3beeb1396f53e27f",
        "name": "ALTERA TESTE",
        "company": 3,
        "createdAt": "2025-06-30T17:56:12.326Z",
        "updatedAt": "2026-06-02T13:27:04.027Z",
        "idERP_Fornecedor": 1
    }
}
```

{% endtab %}
{% endtabs %}

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

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

## Delete Fornecedor

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

Endpoint para deletar uma categoria.

#### Path Parameters

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

#### 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": "Deletado com sucesso!"
}
```

{% endtab %}
{% endtabs %}

**Colocar o id do grupo a ser deletada no parâmetro**, ficando com a url no estilo **`/v1/product/supplier/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/supplier.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.
