# 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 %}
