Simular condições de cartão
curl --request POST \
--url https://api.example.com/api/services/app/Cartao/Simular \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"buyValue": 123,
"totalIncome": 123,
"document": "<string>",
"hasInsurance": true
}
'import requests
url = "https://api.example.com/api/services/app/Cartao/Simular"
payload = {
"buyValue": 123,
"totalIncome": 123,
"document": "<string>",
"hasInsurance": True
}
headers = {"Content-Type": "application/json-patch+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({buyValue: 123, totalIncome: 123, document: '<string>', hasInsurance: true})
};
fetch('https://api.example.com/api/services/app/Cartao/Simular', 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.example.com/api/services/app/Cartao/Simular",
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([
'buyValue' => 123,
'totalIncome' => 123,
'document' => '<string>',
'hasInsurance' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+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.example.com/api/services/app/Cartao/Simular"
payload := strings.NewReader("{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json-patch+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.example.com/api/services/app/Cartao/Simular")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/services/app/Cartao/Simular")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}"
response = http.request(request)
puts response.read_body{
"buyValue": 123,
"totalFunded": 123,
"services": [
{
"id": 123,
"name": "<string>",
"total": 123
}
],
"installments": [
{
"buyValue": 123,
"installmentValue": 123,
"salesInsurance": 123,
"maxInstallmentValue": 123,
"installmentNumber": 123,
"allowsSale": true,
"installmentLimit": 123
}
],
"insuranceInstallments": [
{
"buyValue": 123,
"installmentValue": 123,
"salesInsurance": 123,
"maxInstallmentValue": 123,
"installmentNumber": 123,
"allowsSale": true,
"installmentLimit": 123
}
]
}Cartão Loja
Simular condições de cartão
POST
/
api
/
services
/
app
/
Cartao
/
Simular
Simular condições de cartão
curl --request POST \
--url https://api.example.com/api/services/app/Cartao/Simular \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"buyValue": 123,
"totalIncome": 123,
"document": "<string>",
"hasInsurance": true
}
'import requests
url = "https://api.example.com/api/services/app/Cartao/Simular"
payload = {
"buyValue": 123,
"totalIncome": 123,
"document": "<string>",
"hasInsurance": True
}
headers = {"Content-Type": "application/json-patch+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json-patch+json'},
body: JSON.stringify({buyValue: 123, totalIncome: 123, document: '<string>', hasInsurance: true})
};
fetch('https://api.example.com/api/services/app/Cartao/Simular', 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.example.com/api/services/app/Cartao/Simular",
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([
'buyValue' => 123,
'totalIncome' => 123,
'document' => '<string>',
'hasInsurance' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+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.example.com/api/services/app/Cartao/Simular"
payload := strings.NewReader("{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json-patch+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.example.com/api/services/app/Cartao/Simular")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/services/app/Cartao/Simular")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json-patch+json'
request.body = "{\n \"buyValue\": 123,\n \"totalIncome\": 123,\n \"document\": \"<string>\",\n \"hasInsurance\": true\n}"
response = http.request(request)
puts response.read_body{
"buyValue": 123,
"totalFunded": 123,
"services": [
{
"id": 123,
"name": "<string>",
"total": 123
}
],
"installments": [
{
"buyValue": 123,
"installmentValue": 123,
"salesInsurance": 123,
"maxInstallmentValue": 123,
"installmentNumber": 123,
"allowsSale": true,
"installmentLimit": 123
}
],
"insuranceInstallments": [
{
"buyValue": 123,
"installmentValue": 123,
"salesInsurance": 123,
"maxInstallmentValue": 123,
"installmentNumber": 123,
"allowsSale": true,
"installmentLimit": 123
}
]
}Simula as condições do Cartão Loja para um valor de compra.
Autentique-se antes (Autenticação).
curl -X POST "https://gateway.hubcred.com.br/external/v1/api/services/app/Cartao/Simular" \
-H "Authorization: Bearer SEU_TOKEN" -H "Content-Type: application/json" \
-d '{ "buyValue": 1200, "totalIncome": 3000, "document": "12345678900", "hasInsurance": false }'
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Input com os dados para simulação
Response
OK
Resultado da simulação de cartão externo.
Valor de compra.
Valor total financiado.
Lista de serviços adicionais da operação.
Show child attributes
Show child attributes
Lista de opções de parcelamento.
Show child attributes
Show child attributes
Lista de opções de parcelamento com seguro.
Show child attributes
Show child attributes
Cria uma proposta de contratação de empréstimo pessoalRealiza o pré-cadastro para solicitação de cartão
⌘I