> For the complete documentation index, see [llms.txt](https://cloudware.gitbook.io/documentacao-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloudware.gitbook.io/documentacao-api/api-v0/produtos-e-servicos.md).

# Produtos e serviços

## Produtos

Os detalhes do pedido POST para a criação de produtos estão descritos de seguida, em formato OpenAPI, e em cURL.

```
curl -v -X POST -H 'Content-Type: application/vnd.api+json' -H 'Accept: application/json' -H 'Authorization: Bearer <access_token>' -d '<payload JSON>' '<API_URL>/products'
```

No pedido acima, o \<access\_token> corresponde ao token de acesso válido devolvido pelo serviço de OAuth, e o \<payload JSON> deverá ter o seguinte formato

```
{
  "data": {
    "type": "products",                         // [OBRIGATÓRIO]
    "attributes": {
      "type": "Product",                        // [OBRIGATÓRIO]
      "item_code": "PTEST",                     // [OBRIGATÓRIO]
      "item_description": "Test product",       // [OBRIGATÓRIO]
      "sales_price": 100,                       // [OPCIONAL]
      "sales_price_includes_vat": false,        // [OPCIONAL] Por omissão, false; true, se o preço de venda do produto incluir IVA
      "tax_code": "NOR"                         // [OPCIONAL] Os tipos de IVA suportados são "NOR" (normal), "INT" (intermédio), "RED" (reduzido), "ISE" (isento)
    }
  }
}
```

{% openapi src="/files/Ph0j7Hyh5VB7NivP1zhf" path="/products" method="post" %}
[openapi\_swagger.yml](https://1113994710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiTdJalKSEf3HO0XWftdu%2Fuploads%2FVKja7VTBGEn3Y3110UWU%2Fopenapi_swagger.yml?alt=media\&token=9ecc7973-2b20-491a-b2ee-e9de90da70ed)
{% endopenapi %}

De modo a obter informações sobre um dado produto, poderá realizar o seguinte pedido

<mark style="color:blue;">`GET`</mark> `/products`

#### Path Parameters

| Name                | Type   | Description   |
| ------------------- | ------ | ------------- |
| filter\[item\_code] | String | \<item\_code> |

{% tabs %}
{% tab title="200: OK Toda a informação sobre o produto" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

Neste, pode não indicar nenhum filtro, e obter todos os produtos disponíveis, ou então filtrar por qualquer um dos campos disponíveis, tal como no exemplo dado, e seguindo as convenções JSONAPI

## Serviços

Os detalhes do pedido POST para a criação de serviços estão descritos de seguida, em formato OpenAPI, e em cURL.

```
curl -v -X POST -H 'Content-Type: application/vnd.api+json' -H 'Accept: application/json' -H 'Authorization: Bearer <access_token>' -d '<payload JSON>' '<API_URL>/services'
```

No pedido acima, o \<access\_token> corresponde ao token de acesso válido devolvido pelo serviço de OAuth, e o \<payload JSON> deverá ter o seguinte formato

```
{
  "data": {
    "type": "services",                         // [OBRIGATÓRIO]
    "attributes": {
      "type": "Service",                        // [OBRIGATÓRIO]
      "item_code": "STEST",                     // [OBRIGATÓRIO]
      "item_description": "Test service",       // [OBRIGATÓRIO]
      "sales_price": 100,                       // [OPCIONAL]
      "sales_price_includes_vat": false,        // [OPCIONAL] Por omissão, false; true, se o preço de venda do produto incluir IVA
      "tax_code": "NOR"                         // [OPCIONAL] Os tipos de IVA suportados são "NOR" (normal), "INT" (intermédio), "RED" (reduzido), "ISE" (isento)
    }
  }
}
```

{% openapi src="/files/Ph0j7Hyh5VB7NivP1zhf" path="/services" method="post" %}
[openapi\_swagger.yml](https://1113994710-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiTdJalKSEf3HO0XWftdu%2Fuploads%2FVKja7VTBGEn3Y3110UWU%2Fopenapi_swagger.yml?alt=media\&token=9ecc7973-2b20-491a-b2ee-e9de90da70ed)
{% endopenapi %}

De modo a obter informações sobre um dado serviço, poderá realizar o seguinte pedido

<mark style="color:blue;">`GET`</mark> `/services`

#### Path Parameters

| Name                | Type   | Description   |
| ------------------- | ------ | ------------- |
| filter\[item\_code] | String | \<item\_code> |

{% tabs %}
{% tab title="200: OK Toda a informação sobre o serviço" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

Neste, pode não indicar nenhum filtro, e obter todos os serviços disponíveis, ou então filtrar por qualquer um dos campos disponíveis, tal como no exemplo dado, e seguindo as convenções JSONAPI


---

# 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://cloudware.gitbook.io/documentacao-api/api-v0/produtos-e-servicos.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.
