Clients - Protected

Create a new client with proper data separation.

This endpoint follows the correct client creation pattern:

  1. Client basic info goes to Cliente table (nome, nif, contacto, etc.)
  2. Email goes to Emails table (id_modulo=12, id_modulo_id=client_id)
  3. Address goes to Moradas table (id_modulo=12, id_modulo_id=client_id)

Automatically assigns the client to the authenticated user's company. Validates NIF uniqueness within the company.

post/api/clients

Request

  • Base URL
    https://api.multigest.pt (the document declares no server; this is the origin it was published from)
  • URL
    https://api.multigest.pt/api/clients
  • Auth
    API key in header x-api-token and API key in header x-origin-verify

Headers

x-api-tokenstring nullable

Request body

data_nascimentostring date nullable
nacionalidadestring nullable

Código do país (Pais.Pais, 2 letras — ex.: 'PT')

naturalidadestring nullable
nissstring nullable

N.º de Segurança Social — 11 dígitos

doc_identificacao_tipo_idinteger nullable

Z_TiposDocumentoIdentificacao.id

dependentesinteger nullable

N.º de dependentes (0-99)

atividade_abertaboolean nullable
profissaostring nullable
data_entrada_empresastring date nullable

Mês e ano de entrada — guardado no dia 1 (aceita também 'YYYY-MM')

nif_entidade_empregadorastring nullable

9 dígitos

nome_entidade_empregadorastring nullable
data_constituicaostring date nullable
tipo_empresa_idinteger nullable

Z_TiposEmpresa.id

caestring nullable

Até 5 dígitos, enviado como texto (ex.: '01110')

atividadestring nullable
ano_contasinteger nullable

Ano a que respeitam as contas

codigo_iesstring nullable
nomestring required
emailstring nullable
contactostring nullable
nifinteger nullable

Tax ID (unique per company)

ccstring nullable

ID card number

validade_ccstring date nullable

ID card validity

entidade_emissora_ccstring nullable
particularboolean

True=Individual, False=Company

recorrenteboolean

Is recurring client

carta_conducaostring nullable
data_carta_conducaostring date nullable
ibanstring nullable
iban_alimentarstring nullable
paisstring nullable
moradastring nullable
codigo_postalstring nullable
localidadestring nullable
cidadestring nullable
id_pontodevendainteger nullable
id_estado_civilinteger nullable
id_tipo_casainteger nullable
id_contrato_trabalhointeger nullable
tipo_idinteger nullable
agregado_familiarinteger nullable
creditos_ativosinteger nullable
mensalidade_casanumber nullable
antiguidade_empresainteger nullable
mensalidade_creditosnumber nullable
vencimento_liquidonumber nullable
foreign_nifstring nullable

Foreign tax ID

Response

Successful Response

idinteger required
nomestring required
emailstring nullable
contactostring nullable
nifinteger nullable
ccstring nullable
validade_ccstring date nullable
entidade_emissora_ccstring nullable
particularboolean
recorrenteboolean
carta_conducaostring nullable
data_carta_conducaostring date nullable
ibanstring nullable
iban_alimentarstring nullable
paisstring nullable
moradastring nullable
codigo_postalstring nullable
localidadestring nullable
cidadestring nullable
idcompanyinteger nullable
id_pontodevendainteger nullable
id_estado_civilinteger nullable
id_tipo_casainteger nullable
id_contrato_trabalhointeger nullable
tipo_idinteger nullable
agregado_familiarinteger nullable
creditos_ativosinteger nullable
mensalidade_casanumber nullable
antiguidade_empresainteger nullable
mensalidade_creditosnumber nullable
vencimento_liquidonumber nullable
foreign_nifstring nullable
data_nascimentostring date nullable
nacionalidadestring nullable
naturalidadestring nullable
nissstring nullable
doc_identificacao_tipo_idinteger nullable
dependentesinteger nullable
atividade_abertaboolean nullable
profissaostring nullable
data_entrada_empresastring date nullable
nif_entidade_empregadorastring nullable
nome_entidade_empregadorastring nullable
data_constituicaostring date nullable
tipo_empresa_idinteger nullable
capital_socialnumber nullable
caestring nullable
atividadestring nullable
resultado_liquidonumber nullable
volume_negociosnumber nullable
ano_contasinteger nullable
codigo_iesstring nullable
IDinteger nullable
Nomestring nullable
NIFinteger nullable
Contactostring nullable
CCstring nullable
ValidadeCCstring nullable
EntidadeEmissoraCCstring nullable
CartaConducaostring nullable
DataCartaConducaostring nullable

Changes

    • info

      removed the pattern ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ from the request property /

    • info

      removed the pattern ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ from the request property /

    • info

      removed the pattern ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$ from the request property /

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status