curl --request POST \
--url https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "482019"
}
'import requests
url = "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm"
payload = { "code": "482019" }
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({code: '482019'})
};
fetch('https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm', 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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm",
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' => '482019'
]),
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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm"
payload := strings.NewReader("{\n \"code\": \"482019\"\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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"482019\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm")
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 \"code\": \"482019\"\n}"
response = http.request(request)
puts response.read_bodyConfirmar código de verificação da fatura
Envia o código de verificação recebido pelo pagador quando a fatura está em requires_action com next_action.type: otp_confirmation. Nada é cobrado até a confirmação. Se o pagamento for recusado, a resposta é 402 com failure_reason.
curl --request POST \
--url https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "482019"
}
'import requests
url = "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm"
payload = { "code": "482019" }
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({code: '482019'})
};
fetch('https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm', 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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm",
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' => '482019'
]),
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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm"
payload := strings.NewReader("{\n \"code\": \"482019\"\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://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"482019\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}/confirm")
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 \"code\": \"482019\"\n}"
response = http.request(request)
puts response.read_bodyrequires_action com next_action.type = "otp_confirmation" e nada é cobrado até a confirmação. Envie em code o código que o comprador recebeu.200 com a fatura atualizada (em geral processing), ou 402 se a cobrança for recusada.422 parameter_missing (sem code), 422 confirmation_code_invalid (código inválido ou expirado) e 422 order_not_confirmable (a fatura não está aguardando código).Authorizations
Chave de API (secret key) da conta, no formato sk_live_... (produção) ou sk_test_... (Dev mode). Envie no header Authorization: Bearer <chave>. Autentica todas as rotas da API v2 e as rotas de Análise de Fraude. A chave identifica a conta, então a API v2 não usa o header account. Uma chave só é aceita no ambiente em que foi criada. Gere a sua no dashboard em Configurações → Chaves de API.
Headers
Chave de idempotência opcional e recomendada. Tem até 128 caracteres e vale por 24 horas, por conta. A mesma chave com o mesmo corpo devolve a resposta original (mesmo status e mesmo corpo), sem processar de novo. Só respostas 2xx ficam guardadas: depois de um erro, a mesma chave pode ser reutilizada. A mesma chave com um corpo diferente retorna 422 (idempotency_key_conflict), uma requisição original ainda em andamento retorna 409 (idempotency_key_in_use) e uma chave com mais de 128 caracteres retorna 400 (idempotency_key_invalid).
128"pedido-1024-tentativa-1"
Path Parameters
Identificador do recurso (o campo id devolvido pela API)
Body
Código de verificação recebido pelo pagador
"482019"
Response
Código confirmado. Confira o status da fatura
Fatura de um ciclo da assinatura. processing: em processamento. requires_action: PIX aguardando pagamento ou verificação por código (veja next_action). paid: paga. failed: recusada (veja failure_reason). canceled: cancelada. refunded e partially_refunded: estornada. chargeback: contestada.
"719305"
invoice "sub_4Hn8Qw2Rt6Yp1Zx3"
Número da fatura na assinatura
1
processing, requires_action, paid, failed, canceled, refunded, partially_refunded, chargeback "brl"
Valor da fatura, em centavos, já com descontos e acréscimos
9000
Tentativas de cobrança
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
O que precisa acontecer para o pagamento seguir. pix_display_qr_code: exiba o QR Code para o pagador. otp_confirmation: a análise de fraude pediu verificação — nada é cobrado até o código ser confirmado na rota /confirm.
Show child attributes
Show child attributes
Motivo da recusa. Presente só quando o status é failed
Show child attributes
Show child attributes
