POST api/Clientes

Creates a new client

Request Information

URI Parameters

None.

Body Parameters

Client data

Cliente
NameDescriptionTypeAdditional information
Id

integer

None.

Nome

string

None.

Morada

string

None.

NIF

string

None.

Contacto

string

None.

Email

string

None.

CodigoPostal

string

None.

Registo

date

None.

Ativo

boolean

None.

Faturas

Collection of Fatura

None.

Contadors

Collection of Contador

None.

Request Formats

application/json, text/json

Sample:
{
  "Id": 1,
  "Nome": "sample string 2",
  "Morada": "sample string 3",
  "NIF": "sample string 4",
  "Contacto": "sample string 5",
  "Email": "sample string 6",
  "CodigoPostal": "sample string 7",
  "Registo": "2026-08-27T22:30:44.1020783-05:00",
  "Ativo": true,
  "Faturas": [
    {
      "Id": 1,
      "DataFatura": "2026-08-27T22:30:44.1020783-05:00",
      "ValorTotal": 3.1,
      "Pago": true,
      "Anulado": true,
      "ClienteId": 1,
      "ContadorId": 1,
      "ConsumoId": 1,
      "Consumo": {
        "Id": 1,
        "DataLeitura": "2026-08-27T22:30:44.1020783-05:00",
        "ValorConsumido": 3.1,
        "LeituraAtual": 4.1,
        "LeituraAnterior": 5.1,
        "ContadorId": 1,
        "Faturas": [],
        "Contador": {
          "Id": 1,
          "NumeroContador": "sample string 2",
          "DataInstalacao": "2026-08-27T22:30:44.1020783-05:00",
          "Ativo": true,
          "ClienteId": 1,
          "Faturas": [],
          "Consumos": []
        }
      },
      "Contador": {
        "Id": 1,
        "NumeroContador": "sample string 2",
        "DataInstalacao": "2026-08-27T22:30:44.1020783-05:00",
        "Ativo": true,
        "ClienteId": 1,
        "Faturas": [],
        "Consumos": [
          {
            "Id": 1,
            "DataLeitura": "2026-08-27T22:30:44.1020783-05:00",
            "ValorConsumido": 3.1,
            "LeituraAtual": 4.1,
            "LeituraAnterior": 5.1,
            "ContadorId": 1,
            "Faturas": []
          }
        ]
      }
    }
  ],
  "Contadors": [
    {
      "Id": 1,
      "NumeroContador": "sample string 2",
      "DataInstalacao": "2026-08-27T22:30:44.1020783-05:00",
      "Ativo": true,
      "ClienteId": 1,
      "Faturas": [
        {
          "Id": 1,
          "DataFatura": "2026-08-27T22:30:44.1020783-05:00",
          "ValorTotal": 3.1,
          "Pago": true,
          "Anulado": true,
          "ClienteId": 1,
          "ContadorId": 1,
          "ConsumoId": 1,
          "Consumo": {
            "Id": 1,
            "DataLeitura": "2026-08-27T22:30:44.1020783-05:00",
            "ValorConsumido": 3.1,
            "LeituraAtual": 4.1,
            "LeituraAnterior": 5.1,
            "ContadorId": 1,
            "Faturas": []
          }
        }
      ],
      "Consumos": [
        {
          "Id": 1,
          "DataLeitura": "2026-08-27T22:30:44.1020783-05:00",
          "ValorConsumido": 3.1,
          "LeituraAtual": 4.1,
          "LeituraAnterior": 5.1,
          "ContadorId": 1,
          "Faturas": [
            {
              "Id": 1,
              "DataFatura": "2026-08-27T22:30:44.1020783-05:00",
              "ValorTotal": 3.1,
              "Pago": true,
              "Anulado": true,
              "ClienteId": 1,
              "ContadorId": 1,
              "ConsumoId": 1
            }
          ]
        }
      ]
    }
  ]
}

application/xml

Sample:

Sample not available.

text/xml

Sample:

Sample not available.

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

Operation result

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.