Efetuar Pagamento
curl --request POST \
--url https://api.uvvipague.com.br/uvvi/v1/payment \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"checkoutId": "chk_abc123xyz",
"cardToken": "tok_abc123xyz",
"installments": 3,
"customer": {
"name": "João da Silva",
"email": "joao@example.com",
"cpfCnpj": "12345678900"
}
}
'import requests
url = "https://api.uvvipague.com.br/uvvi/v1/payment"
payload = {
"checkoutId": "chk_abc123xyz",
"cardToken": "tok_abc123xyz",
"installments": 3,
"customer": {
"name": "João da Silva",
"email": "joao@example.com",
"cpfCnpj": "12345678900"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
checkoutId: 'chk_abc123xyz',
cardToken: 'tok_abc123xyz',
installments: 3,
customer: {name: 'João da Silva', email: 'joao@example.com', cpfCnpj: '12345678900'}
})
};
fetch('https://api.uvvipague.com.br/uvvi/v1/payment', 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.uvvipague.com.br/uvvi/v1/payment",
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([
'checkoutId' => 'chk_abc123xyz',
'cardToken' => 'tok_abc123xyz',
'installments' => 3,
'customer' => [
'name' => 'João da Silva',
'email' => 'joao@example.com',
'cpfCnpj' => '12345678900'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.uvvipague.com.br/uvvi/v1/payment"
payload := strings.NewReader("{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.uvvipague.com.br/uvvi/v1/payment")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipague.com.br/uvvi/v1/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "pay_abc123xyz",
"status": "paid",
"amount": 1315.89,
"installments": 3,
"transactionId": "txn_abc123xyz"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Parâmetros inválidos na requisição",
"details": {}
}
}{
"success": false,
"error": {
"code": "PAYMENT_REJECTED",
"message": "Pagamento recusado pela operadora",
"details": "Saldo insuficiente"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Parâmetros inválidos na requisição",
"details": {}
}
}Pagamentos
Processar Pagamento
Processa o pagamento de débitos veiculares com cartão tokenizado
POST
/
uvvi
/
v1
/
payment
Efetuar Pagamento
curl --request POST \
--url https://api.uvvipague.com.br/uvvi/v1/payment \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"checkoutId": "chk_abc123xyz",
"cardToken": "tok_abc123xyz",
"installments": 3,
"customer": {
"name": "João da Silva",
"email": "joao@example.com",
"cpfCnpj": "12345678900"
}
}
'import requests
url = "https://api.uvvipague.com.br/uvvi/v1/payment"
payload = {
"checkoutId": "chk_abc123xyz",
"cardToken": "tok_abc123xyz",
"installments": 3,
"customer": {
"name": "João da Silva",
"email": "joao@example.com",
"cpfCnpj": "12345678900"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
checkoutId: 'chk_abc123xyz',
cardToken: 'tok_abc123xyz',
installments: 3,
customer: {name: 'João da Silva', email: 'joao@example.com', cpfCnpj: '12345678900'}
})
};
fetch('https://api.uvvipague.com.br/uvvi/v1/payment', 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.uvvipague.com.br/uvvi/v1/payment",
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([
'checkoutId' => 'chk_abc123xyz',
'cardToken' => 'tok_abc123xyz',
'installments' => 3,
'customer' => [
'name' => 'João da Silva',
'email' => 'joao@example.com',
'cpfCnpj' => '12345678900'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.uvvipague.com.br/uvvi/v1/payment"
payload := strings.NewReader("{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.uvvipague.com.br/uvvi/v1/payment")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipague.com.br/uvvi/v1/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"checkoutId\": \"chk_abc123xyz\",\n \"cardToken\": \"tok_abc123xyz\",\n \"installments\": 3,\n \"customer\": {\n \"name\": \"João da Silva\",\n \"email\": \"joao@example.com\",\n \"cpfCnpj\": \"12345678900\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "pay_abc123xyz",
"status": "paid",
"amount": 1315.89,
"installments": 3,
"transactionId": "txn_abc123xyz"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Parâmetros inválidos na requisição",
"details": {}
}
}{
"success": false,
"error": {
"code": "PAYMENT_REJECTED",
"message": "Pagamento recusado pela operadora",
"details": "Saldo insuficiente"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Parâmetros inválidos na requisição",
"details": {}
}
}Descrição
Processa o pagamento de débitos veiculares utilizando um cartão tokenizado. Este é o último passo do fluxo de pagamento.Antifraude Integrado: Todos os pagamentos passam pelo sistema antifraude da Uvvipague antes de serem aprovados.
Pré-requisitos
Antes de processar o pagamento, você deve:- Ter criado um checkout válido (
checkoutId) - Ter tokenizado o cartão do cliente (
cardToken) - Ter simulado as parcelas (opcional, mas recomendado)
Status de Pagamento
O pagamento pode retornar os seguintes status:- paid: Pagamento aprovado e processado com sucesso
- in_analysis: Transação em análise pelo antifraude (aguardar webhook)
- refused: Transação recusada pela operadora ou antifraude
- processing: Transação sendo processada
- awaiting_payment: Aguardando confirmação de pagamento
- cancelled: Pagamento cancelado
- refunded: Pagamento estornado
- chargeback: Contestação de pagamento
Consulte a documentação de ENUMs para detalhes completos sobre cada status.
Webhooks
Após o processamento, você receberá webhooks sobre:- Confirmação do pagamento
- Atualização de status
- Liquidação dos débitos nos órgãos
Configure seus webhooks na documentação de webhooks para receber notificações automáticas.
Códigos de Resposta HTTP
200 - Sucesso
Pagamento processado com sucesso. Verifique o campostatus para o resultado.
400 - Bad Request
Dados inválidos ou incompletos na requisição.402 - Payment Required
Pagamento recusado pela operadora. Possíveis motivos:PAYMENT_REJECTED: Recusado pela operadoraINVALID_CARD: Cartão inválidoINSUFFICIENT_FUNDS: Saldo insuficienteFRAUD_DETECTED: Fraude detectadaCARD_EXPIRED: Cartão expiradoINVALID_CVV: CVV inválido
422 - Unprocessable Entity
Dados válidos mas não podem ser processados (ex: checkout expirado).Segurança
- Nunca armazene dados completos de cartão
- Use sempre tokenização
- Valide o CVV em cada transação
- Implemente 3DS quando disponível
Authorizations
API Key fornecida no painel administrativo da Uvvipague
Body
application/json