# Create

## Criar Cliente

## Cria um novo cliente.

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

#### Request Body

| Name                                             | Type    | Description                                                                                                                                             |
| ------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| code                                             | integer | <p>Código do Cliente</p><p>Valor Único</p>                                                                                                              |
| customer\_name<mark style="color:red;">\*</mark> | string  | Nome do Cliente                                                                                                                                         |
| fiscal\_number                                   | string  | Contribuinte                                                                                                                                            |
| commercial\_name                                 | string  | Nome Comercial do Cliente                                                                                                                               |
| fiscal\_status\_type\_id                         | integer | <p>Tipo de Contribuinte</p><p></p><p>Consulte a tabela <a href="/pages/Le16rQ3NG33zktn1PTI4#tipo-de-sujeito-campo-fiscal_status_type">Apêndice</a>.</p> |
| fiscal\_country\_id                              | integer | <p>País Fiscal</p><p></p><p>Consulte a tabela <a href="/pages/zDxRAoofNg5nAbyoGGBy#lista-de-paises">Países</a>.</p>                                     |
| price\_line\_id                                  | integer | <p>Linha de Preços</p><p></p><p>Consulte a tabela <a href="/pages/BRLFkhDfyaloM1d0OxTw#lista-de-linhas-de-precos">Linhas de Preços</a>.</p>             |
| payment\_term\_id                                | integer | <p>Condições de Pagamento<br></p><p>Consulte a tabela <a href="/pages/kQTzHz7UsOsRPU1d0NCE">Condições de Pagamento</a>.</p>                             |
| payment\_method\_id                              | integer | <p>Método de Pagamento</p><p></p><p>Consulte a tabela <a href="/pages/H5o1QL6JH88fxFVknUUm">Métodos de Pagamento</a>.</p>                               |
| global\_discount1                                | float   | Desconto Global                                                                                                                                         |
| line\_discount1                                  | float   | Desconto de Linha 1                                                                                                                                     |
| line\_discount2                                  | float   | Desconto de Linha 2                                                                                                                                     |
| line\_discount3                                  | float   | Desconto de Linha 3                                                                                                                                     |
| is\_vat\_exempt                                  | boolean | Isento de IVA                                                                                                                                           |
| vat\_exempt\_tax\_exemption\_id                  | integer | Tipo de Isenção                                                                                                                                         |
| contact1                                         | string  | Nome do Contacto Principal                                                                                                                              |
| job\_title1                                      | string  | Cargo do Contacto Principal                                                                                                                             |
| email1                                           | email   | E-mail do Contacto Principal                                                                                                                            |
| mobile1                                          | string  | Telemóvel do Contacto Principal                                                                                                                         |
| phone1                                           | string  | Telefone do Contacto Principal                                                                                                                          |
| fax1                                             | string  | Fax do Contacto Principal                                                                                                                               |
| web\_address                                     | string  | Endereço da Entidade/Cliente                                                                                                                            |
| country\_id                                      | integer | <p>País</p><p></p><p>Consulte a tabela <a href="/pages/zDxRAoofNg5nAbyoGGBy#lista-de-paises">Países</a>.</p>                                            |
| district\_id                                     | integer | <p>Distrito</p><p></p><p>Consulte a tabela <a href="/pages/Oy0G8bxbN2ykl7r4A5Od">Distritos</a>.</p>                                                     |
| locality\_id                                     | integer | <p>Concelho</p><p></p><p>Consulte a tabela <a href="/pages/YJTH195LHwt2kPWeMmfS">Concelhos</a>.</p>                                                     |
| city                                             | string  | Cidade                                                                                                                                                  |
| street1                                          | string  | Morada Linha 1                                                                                                                                          |
| street2                                          | string  | Morada Linha 2                                                                                                                                          |
| zip\_code                                        | string  | Código Postal                                                                                                                                           |
| zip\_locale                                      | string  | Localidade                                                                                                                                              |
| external\_code                                   | string  | Código Alternativo do Cliente                                                                                                                           |

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

```shell
curl -X POST https://api.cloudinvoice.net/customers/new/
    -d '{
        "code": "1",
        "customer_name": "Cliente Demo",
        "fiscal_number": "999999990"
    }'
```

{% endtab %}

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

```json
{
    "id": 1,
    "code": 1,
    "external_code": "",
    "customer_name": "Cliente Demo",
    "commercial_name": "",
    "fiscal_number": "999999990",
    "street1": "",
    "street2": "",
    "zip_code": "",
    "zip_locale": "",
    "city": "",
    "contact1": "",
    "job_title1": "",
    "phone1": "",
    "email1": "",
    "mobile1": "",
    "fax1": "",
    "web_address": "",
    "is_vat_exempt": false,
    "global_discount1": 0.0,
    "line_discount1": 0.0,
    "line_discount2": 0.0,
    "line_discount3": 0.0,
    "total_debits": 0.0,
    "total_credits": 0.0,
    "current_balance": 0.0,
    "party_class_id": 1601,
    "fiscal_country_id": 1,
    "fiscal_country": {
        "code": "PT",
        "country_name": "Portugal"
    },
    "country_id": 1,
    "country": {
        "code": "PT",
        "country_name": "Portugal"
    },
    "district_id": null,
    "district": null,
    "locality_id": null,
    "locality": null,
    "tax_region_id": 1,
    "tax_region": {
        "code": "PT",
        "description": "Continente"
    },
    "tax_zone_id": 21,
    "currency_id": 1,
    "currency": {
        "code": "EUR",
        "description": "Euros"
    },
    "fiscal_status_type_id": 1592,
    "vat_exempt_tax_exemption_id": null,
    "vat_exempt_tax_exemption": null,
    "payment_term_id": null,
    "payment_term": null,
    "payment_method_id": null,
    "payment_method": null,
    "price_line_id": null,
    "price_line": null,
    "party_class": {
        "code": "C",
        "description": "Cliente"
    },
    "fiscal_status_type": {
        "code": "1",
        "description": "Consumidor final"
    },
    "tax_zone": {
        "code": "N",
        "description": "Mercado Nacional"
    }
}
```

{% endtab %}
{% endtabs %}

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/documentacao-api/clientes/create.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.
