# Login

{% hint style="info" %}
Este endpoint não requer autenticação.
{% endhint %}

## Criar Token de Acesso

## Gera um Token de Acesso para as credenciais fornecidas:

<mark style="color:green;">`POST`</mark> `https://api.cloudinvoice.net/auth/login/`

#### Request Body

| Name                                       | Type   | Description            |
| ------------------------------------------ | ------ | ---------------------- |
| username<mark style="color:red;">\*</mark> | email  | Email do Utilizador    |
| password<mark style="color:red;">\*</mark> | string | Password do Utilizador |
| company\_code                              | string | Código da Empresa      |
| till\_code                                 | string | Código da Caixa        |

{% tabs %}
{% tab title="Exemplo de Pedido" %}

```shell
curl -X POST https://api.cloudinvoice.net/auth/login/
    -d '{
        "username": "user@sample.com",
        "password": "pFS2VwMk"
    }'
```

{% endtab %}

{% tab title="Exemplo de Resposta" %}

```json
{
    "key": "329c2d5cadd96ccce7b0b0f2653e8d08f61ddd52"
}

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Para além das credenciais username/password, pode também incluir a Empresa **`company_code`** e a Caixa **`till_code`** a que pretende associar o token de acesso.
{% endhint %}

Para ver exemplos de pedidos nas várias linguagens, consulte a página[ Exemplos de Pedidos.](/introducao/exemplos-de-pedidos.md)


---

# 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://apidocs.cloudinvoice.net/conta-autenticacao/login.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.
