# Sales

## Listando todas as vendas

## Listar todos

<mark style="color:blue;">`GET`</mark> `https://api.celetus.com/api/sales`

Listar todas as vendas da conta

#### Query Parameters

| Name                                          | Type     | Description                                                        |
| --------------------------------------------- | -------- | ------------------------------------------------------------------ |
| rowsPerPage<mark style="color:red;">\*</mark> | int      | <p>Quantidade de registros por pagina</p><p></p>                   |
| pageNumber<mark style="color:red;">\*</mark>  | int      | Numero da pagina                                                   |
| status                                        | string   | status da venda peding \| processing \| canceled \| failed \| paid |
| startDate                                     | datetime | Data inicio da busca                                               |
| enddate                                       | datetime | Data final da busa                                                 |

{% tabs %}
{% tab title="200 successfully" %}

```javascript
{
  "items": [
    {
      "id": "string",
      "totalCheckout": 0,
      "status": "string",
      "totalProducts": 0,
      "totalFrete": 0,
      "discount": 0,
      "createdAt": "2023-11-10T09:41:47.559Z",
      "updatedAt": "2023-11-10T09:41:47.559Z",
      "customer": {
        "id": "string",
        "name": "string",
        "document": "string",
        "email": "string",
        "phone": "string",
        "address": "string",
        "number": "string",
        "zipCode": "string",
        "complement": "string",
        "neighborhood": "string",
        "city": "string",
        "state": "string",
        "country": "string"
      },
      "products": [
        {
          "quantity": 0,
          "unitaryValue": 0,
          "name": "string",
          "id": "string"
        }
      ]
    }
  ],
  "page": 0,
  "total": 0,
  "rowsPerPage": 0,
  "totalPages": 0,
  "info": "string",
  "hasBackPage": true,
  "hasNextPage": true,
  "isLastPage": true
}
```

{% endtab %}

{% tab title="401 Erro na chave de acesso" %}

{% endtab %}

{% tab title="404: Not Found Não encontrado" %}

{% endtab %}
{% endtabs %}

## Buscando uma venda por código

## Buscar venda por Id

<mark style="color:blue;">`GET`</mark> `https://api.celetus.com/api/sales/{id}`

Listar todas as vendas da conta

{% tabs %}
{% tab title="200 successfully" %}

```javascript
{
  "id": "string",
  "totalCheckout": 0,
  "status": "string",
  "totalProducts": 0,
  "totalFrete": 0,
  "discount": 0,
  "createdAt": "2023-11-10T09:45:43.263Z",
  "updatedAt": "2023-11-10T09:45:43.263Z",
  "customer": {
    "id": "string",
    "name": "string",
    "document": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "number": "string",
    "zipCode": "string",
    "complement": "string",
    "neighborhood": "string",
    "city": "string",
    "state": "string",
    "country": "string"
  },
  "products": [
    {
      "quantity": 0,
      "unitaryValue": 0,
      "name": "string",
      "id": "string"
    }
  ]
}
```

{% endtab %}

{% tab title="401 Erro na chave de acesso" %}

{% endtab %}

{% tab title="404: Not Found Não encontrado" %}

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://docs.celetus.com/reference/api-reference/sales.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.
