Cria uma proposta de contratação de CDC Celular
curl --request POST \
--url https://api.example.com/api/services/app/ECdcCelular/Contratar \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"code": "<string>",
"period": 123,
"description": "<string>",
"paymentMethod": 123
}
'import requests
url = "https://api.example.com/api/services/app/ECdcCelular/Contratar"
payload = {
"code": "<string>",
"period": 123,
"description": "<string>",
"paymentMethod": 123
}
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({code: '<string>', period: 123, description: '<string>', paymentMethod: 123})
};
fetch('https://api.example.com/api/services/app/ECdcCelular/Contratar', 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/ECdcCelular/Contratar",
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([
'code' => '<string>',
'period' => 123,
'description' => '<string>',
'paymentMethod' => 123
]),
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/ECdcCelular/Contratar"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\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/ECdcCelular/Contratar")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/services/app/ECdcCelular/Contratar")
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 \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\n}"
response = http.request(request)
puts response.read_bodyCDC Celular
Cria uma proposta de contratação de CDC Celular
POST
/
api
/
services
/
app
/
ECdcCelular
/
Contratar
Cria uma proposta de contratação de CDC Celular
curl --request POST \
--url https://api.example.com/api/services/app/ECdcCelular/Contratar \
--header 'Content-Type: application/json-patch+json' \
--data '
{
"code": "<string>",
"period": 123,
"description": "<string>",
"paymentMethod": 123
}
'import requests
url = "https://api.example.com/api/services/app/ECdcCelular/Contratar"
payload = {
"code": "<string>",
"period": 123,
"description": "<string>",
"paymentMethod": 123
}
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({code: '<string>', period: 123, description: '<string>', paymentMethod: 123})
};
fetch('https://api.example.com/api/services/app/ECdcCelular/Contratar', 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/ECdcCelular/Contratar",
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([
'code' => '<string>',
'period' => 123,
'description' => '<string>',
'paymentMethod' => 123
]),
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/ECdcCelular/Contratar"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\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/ECdcCelular/Contratar")
.header("Content-Type", "application/json-patch+json")
.body("{\n \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/services/app/ECdcCelular/Contratar")
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 \"code\": \"<string>\",\n \"period\": 123,\n \"description\": \"<string>\",\n \"paymentMethod\": 123\n}"
response = http.request(request)
puts response.read_bodyCria a proposta a partir de uma simulação: informe o Forma de pagamento (
Qualquer outro valor é recusado. A forma de pagamento é validada antes dos dados do cliente.
Com
code retornado em
Simular e o period (nº de parcelas) escolhido.
Verifique o IMEI (Verificar IMEI) antes de
contratar. Criada a proposta, ela vira uma Operação, acompanhe pela aba
Operações e obtenha o link de assinatura em
Obter link de assinatura.
Forma de pagamento (paymentMethod, opcional)
Disponível apenas para lojas com o pagamento por chave PIX habilitado pela HubCred. Sem a
habilitação, uma proposta com
paymentMethod igual a 2 é recusada. Fale com o seu contato na
HubCred para habilitar.paymentMethod | Forma de pagamento |
|---|---|
ausente ou 1 | Conta bancária (o comportamento de sempre) |
2 | Chave PIX |
paymentMethod igual a 2, o crédito é pago na chave PIX cadastrada da loja. Você não
envia a chave. Se a loja não tiver chave PIX cadastrada, a proposta é recusada.
curl -X POST "https://gateway.hubcred.com.br/external/v1/api/services/app/ECdcCelular/Contratar" \
-H "Authorization: Bearer SEU_TOKEN" -H "Content-Type: application/json" \
-d '{ "code": "ABC123", "period": 12, "description": "CDC Celular" }'
Body
application/json-patch+jsonapplication/jsontext/jsonapplication/*+json
Input com os dados para a proposta
Dados de entrada para criar uma proposta de CDC Celular.
Código da simulação retornado em Simular.
Quantidade de parcelas escolhida (Period de uma das opções simuladas).
Descrição/observação da proposta.
Forma de pagamento da proposta: 1 (conta bancária) ou 2 (chave PIX). Quando ausente, vale 1, o comportamento de sempre. O valor 2 só é aceito quando o pagamento por chave PIX está habilitado para a empresa; sem isso, a proposta é recusada. Qualquer outro valor é recusado. Com 2, o pagamento vai para a chave PIX cadastrada da loja; o parceiro não envia a chave. Se a loja não tiver chave PIX cadastrada, a proposta é recusada.
Response
200
OK