curl --request POST \
--url https://api.staging.credicarro.com.br/integration/v1/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"celular": "+55 (11) 99876-5432",
"cpf": "12345678909",
"dataDeNascimento": "1990-05-20T00:00:00-03:00",
"email": "maria.souza@exemplo.com.br",
"nome": "Maria",
"sobrenome": "Souza"
}
'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/customer"
payload = {
"celular": "+55 (11) 99876-5432",
"cpf": "12345678909",
"dataDeNascimento": "1990-05-20T00:00:00-03:00",
"email": "maria.souza@exemplo.com.br",
"nome": "Maria",
"sobrenome": "Souza"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
celular: '+55 (11) 99876-5432',
cpf: '12345678909',
dataDeNascimento: '1990-05-20T00:00:00-03:00',
email: 'maria.souza@exemplo.com.br',
nome: 'Maria',
sobrenome: 'Souza'
})
};
fetch('https://api.staging.credicarro.com.br/integration/v1/customer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.credicarro.com.br/integration/v1/customer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'celular' => '+55 (11) 99876-5432',
'cpf' => '12345678909',
'dataDeNascimento' => '1990-05-20T00:00:00-03:00',
'email' => 'maria.souza@exemplo.com.br',
'nome' => 'Maria',
'sobrenome' => 'Souza'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.credicarro.com.br/integration/v1/customer"
payload := strings.NewReader("{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.credicarro.com.br/integration/v1/customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}"
response = http.request(request)
puts response.read_body{
"id_cliente": "123e4567-e89b-12d3-a456-426614174000"
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}Criar cliente
Cria um novo cliente com base nos dados fornecidos
curl --request POST \
--url https://api.staging.credicarro.com.br/integration/v1/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"celular": "+55 (11) 99876-5432",
"cpf": "12345678909",
"dataDeNascimento": "1990-05-20T00:00:00-03:00",
"email": "maria.souza@exemplo.com.br",
"nome": "Maria",
"sobrenome": "Souza"
}
'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/customer"
payload = {
"celular": "+55 (11) 99876-5432",
"cpf": "12345678909",
"dataDeNascimento": "1990-05-20T00:00:00-03:00",
"email": "maria.souza@exemplo.com.br",
"nome": "Maria",
"sobrenome": "Souza"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
celular: '+55 (11) 99876-5432',
cpf: '12345678909',
dataDeNascimento: '1990-05-20T00:00:00-03:00',
email: 'maria.souza@exemplo.com.br',
nome: 'Maria',
sobrenome: 'Souza'
})
};
fetch('https://api.staging.credicarro.com.br/integration/v1/customer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.credicarro.com.br/integration/v1/customer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'celular' => '+55 (11) 99876-5432',
'cpf' => '12345678909',
'dataDeNascimento' => '1990-05-20T00:00:00-03:00',
'email' => 'maria.souza@exemplo.com.br',
'nome' => 'Maria',
'sobrenome' => 'Souza'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.credicarro.com.br/integration/v1/customer"
payload := strings.NewReader("{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.credicarro.com.br/integration/v1/customer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/customer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"celular\": \"+55 (11) 99876-5432\",\n \"cpf\": \"12345678909\",\n \"dataDeNascimento\": \"1990-05-20T00:00:00-03:00\",\n \"email\": \"maria.souza@exemplo.com.br\",\n \"nome\": \"Maria\",\n \"sobrenome\": \"Souza\"\n}"
response = http.request(request)
puts response.read_body{
"id_cliente": "123e4567-e89b-12d3-a456-426614174000"
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}{
"tipo": "Validation.Cpf.Invalid",
"titulo": "Requisição inválida",
"status": 400,
"detalhe": "O CPF informado em 'cpf' é inválido.",
"campo": "cpf",
"erros": [
{
"codigo": "Validation.InvalidFormat",
"mensagem": "O valor informado para 'valorVeiculo' não é um número válido.",
"campo": "cpf"
}
]
}409.Authorizations
Cabeçalho de autenticação Bearer no formato Bearer <token> onde <token> é seu TOKEN de autenticação
Headers
Chave opcional (1 a 200 caracteres) para repetir a requisição com segurança. Reenviar a mesma chave com o mesmo conteúdo devolve o resultado original sem duplicar o registro; reutilizá-la com outro conteúdo retorna erro.
200"6f1c9a2e-3b7d-4e2a-9c51-0d8f3a7b2e10"
Body
Dados do novo cliente
Telefone celular exatamente no formato +55 (DD) 99999-9999.
1"+55 (11) 99876-5432"
CPF do cliente, com ou sem pontuação (11 dígitos). Os dígitos verificadores são validados.
11 - 14"12345678909"
Data de nascimento em ISO-8601. O cliente precisa ter entre 18 e 75 anos.
"1990-05-20T00:00:00-03:00"
Endereço de e-mail do cliente.
1"maria.souza@exemplo.com.br"
Primeiro nome do cliente.
1"Maria"
Sobrenome do cliente.
1"Souza"
Response
Cliente criado ou atualizado
Identificador único do cliente
"123e4567-e89b-12d3-a456-426614174000"