POST api/Cliente/SetCliente?token={token}&deletarContatosNaoListados={deletarContatosNaoListados}

Cadastra um cliente no sistema

Request Information

URI Parameters

NameDescriptionTypeAdditional information
token

Valor recebido pelo método Login >> Entrar

string

Required

deletarContatosNaoListados

Flag para deletar contatos do cliente que não estao no envio

boolean

Default value is False

Body Parameters

Objeto Cliente

Cliente
NameDescriptionTypeAdditional information
CDPESSOA

integer

None.

NMPESSOA

Nome do cliente

string

Max length: 60

DTNASCIMENTO

Data de nascimento

date

None.

DSEMAIL

e-mail do cliente

string

Max length: 100

NRCPFCNPJ

CPF ou CNPJ do cliente sem formatação

string

Max length: 16

NRRG

RG do cliente

string

Max length: 16

NMPAI

Nome do pai

string

Max length: 60

NMMAE

Nome da mãe

string

Max length: 60

TPSEXO

Sexo (1 - Masculino, 2 - Feminino)

integer

None.

CDCARGO

Código do Cargo (TabelaAuxiliar >> GetCargo)

integer

None.

VLSALARIO

Valor do salário do cliente

decimal number

None.

Enderecos

Lista de endereços do cliente

Collection of Endereco

None.

Contatos

Lista de contatos do cliente

Collection of Contato

None.

Request Formats

application/json, text/json

Sample:
{
  "CDPESSOA": 1,
  "NMPESSOA": "sample string 2",
  "DTNASCIMENTO": "2025-04-26T16:34:01.4465489-03:00",
  "DSEMAIL": "sample string 3",
  "NRCPFCNPJ": "sample string 4",
  "NRRG": "sample string 5",
  "NMPAI": "sample string 6",
  "NMMAE": "sample string 7",
  "TPSEXO": 1,
  "CDCARGO": 1,
  "VLSALARIO": 1.0,
  "Enderecos": [
    {
      "TPENDERECO": 1,
      "NRCEP": "sample string 2",
      "SGUF": "sample string 3",
      "DSMUNICIPIO": "sample string 4",
      "DSBAIRRO": "sample string 5",
      "DSTIPOLOGRADOURO": "sample string 6",
      "DSLOGRADOURO": "sample string 7",
      "NRRESIDENCIA": 1,
      "NRRESIDENCIACOMP": "sample string 8",
      "DSCOMPLEMENTO": "sample string 9",
      "DSOBSERVACAO": "sample string 10"
    },
    {
      "TPENDERECO": 1,
      "NRCEP": "sample string 2",
      "SGUF": "sample string 3",
      "DSMUNICIPIO": "sample string 4",
      "DSBAIRRO": "sample string 5",
      "DSTIPOLOGRADOURO": "sample string 6",
      "DSLOGRADOURO": "sample string 7",
      "NRRESIDENCIA": 1,
      "NRRESIDENCIACOMP": "sample string 8",
      "DSCOMPLEMENTO": "sample string 9",
      "DSOBSERVACAO": "sample string 10"
    }
  ],
  "Contatos": [
    {
      "NRDDD": 1,
      "NRTELEFONE": 2,
      "TPCONTATO": 3,
      "NMCONTATO": "sample string 4",
      "IDCONTATOAUTOMATICO": true
    },
    {
      "NRDDD": 1,
      "NRTELEFONE": 2,
      "TPCONTATO": 3,
      "NMCONTATO": "sample string 4",
      "IDCONTATOAUTOMATICO": true
    }
  ]
}

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'Cliente'.

Response Information

Resource Description

RetornoPadrao
NameDescriptionTypeAdditional information
status

Valores : "sucesso", "erro"

string

None.

mensagem

Quando status "sucesso" campo retorna vazio, quando "erro" campo retorna detalhe do erro

string

None.

Response Formats

application/json, text/json

Sample:
{
  "status": "sample string 1",
  "mensagem": "sample string 2"
}