Gerar token de acesso.
curl --request POST \
--url https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "8pqh3k1y0zmtg4u9xenrcvlsw2",
"clientSecret": "8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc"
}
'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken"
payload = {
"clientId": "8pqh3k1y0zmtg4u9xenrcvlsw2",
"clientSecret": "8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: '8pqh3k1y0zmtg4u9xenrcvlsw2',
clientSecret: '8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc'
})
};
fetch('https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken', 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/authentication/accesstoken",
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([
'clientId' => '8pqh3k1y0zmtg4u9xenrcvlsw2',
'clientSecret' => '8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc'
]),
CURLOPT_HTTPHEADER => [
"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/authentication/accesstoken"
payload := strings.NewReader("{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/authentication/accesstoken")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}"
response = http.request(request)
puts response.read_body{
"token_de_acesso": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tipo_de_token": "Bearer",
"expira_em_segundos": 3600,
"expira_em": "2025-10-22T12:57:21.948Z",
"escopo": "credicarro.integration.access/full"
}{
"tipo": "Partner.AccountIsIncompleted",
"titulo": "Bad Request",
"status": 400,
"detalhe": "Cadastro de conta não finalizado",
"erro": null
}Autenticação
Gerar token de acesso
Gera um token de acesso para o parceiro utilizando as credenciais do cliente.
POST
/
v1
/
authentication
/
accesstoken
Gerar token de acesso.
curl --request POST \
--url https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "8pqh3k1y0zmtg4u9xenrcvlsw2",
"clientSecret": "8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc"
}
'import requests
url = "https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken"
payload = {
"clientId": "8pqh3k1y0zmtg4u9xenrcvlsw2",
"clientSecret": "8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: '8pqh3k1y0zmtg4u9xenrcvlsw2',
clientSecret: '8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc'
})
};
fetch('https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken', 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/authentication/accesstoken",
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([
'clientId' => '8pqh3k1y0zmtg4u9xenrcvlsw2',
'clientSecret' => '8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc'
]),
CURLOPT_HTTPHEADER => [
"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/authentication/accesstoken"
payload := strings.NewReader("{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/authentication/accesstoken")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.credicarro.com.br/integration/v1/authentication/accesstoken")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"8pqh3k1y0zmtg4u9xenrcvlsw2\",\n \"clientSecret\": \"8qzn2v0w5lgyh3cmt9a7jrk1f4bepsdu6xovifn3t5hlgq7r9kc\"\n}"
response = http.request(request)
puts response.read_body{
"token_de_acesso": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tipo_de_token": "Bearer",
"expira_em_segundos": 3600,
"expira_em": "2025-10-22T12:57:21.948Z",
"escopo": "credicarro.integration.access/full"
}{
"tipo": "Partner.AccountIsIncompleted",
"titulo": "Bad Request",
"status": 400,
"detalhe": "Cadastro de conta não finalizado",
"erro": null
}Body
application/json
Response
autenticação retornada com sucesso
Token de acesso para autenticação nas requisições
Example:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Tipo do token de acesso
Example:
"Bearer"
Tempo em segundos para expiração do token
Example:
3600
Data e hora de expiração do token
Example:
"2025-10-22T12:57:21.948Z"
Escopo do token de acesso
Example:
"credicarro.integration.access/full"
⌘I