curl --request GET \
--url https://sandbox.4seletpay.com.br/api/v2/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.4seletpay.com.br/api/v2/invoices/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "719305",
"object": "invoice",
"subscription": "sub_4Hn8Qw2Rt6Yp1Zx3",
"number": 1,
"status": "processing",
"currency": "brl",
"amount": 9000,
"attempts": 123,
"items": [
{
"code": "SKU-SUB",
"description": "Assinatura",
"quantity": 1,
"amount": 10000
}
],
"discounts": [
{
"type": "fixed",
"value": 1000,
"invoice_number": 1
}
],
"increments": [
{
"type": "fixed",
"value": 1000,
"invoice_number": 1
}
],
"payments": [
{
"id": "cha_8Kq2Lm9XvB3nT7pZ",
"object": "payment_intent",
"status": "requires_action",
"amount": 10000,
"amount_refunded": 0,
"currency": "brl",
"payment_method_details": {
"type": "card",
"card": {
"brand": "visa",
"last_four": "1111",
"holder_name": "João Silva"
},
"pix": {
"qr_code": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"qr_code_url": "https://pix.exemplo.com.br/qr/cha_8Kq2Lm9XvB3nT7pZ",
"expires_at": "2026-09-14T16:00:00.000000Z"
}
}
}
],
"next_action": {
"type": "pix_display_qr_code",
"pix": {
"qr_code": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"qr_code_url": "https://pix.exemplo.com.br/qr/cha_8Kq2Lm9XvB3nT7pZ",
"expires_at": "2026-09-14T16:00:00.000000Z"
},
"otp": {
"confirmation_id": "5f1c2a9e-7b3d-4e8f-9a6c-1d2e3f4a5b6c",
"expires_at": "2026-09-14T12:15:00.000000Z"
}
},
"created_at": "<string>",
"failure_reason": {
"code": "card_declined",
"message": "O cartão não possui saldo suficiente para concluir o pagamento.",
"customer_message": "Não foi possível concluir o pagamento. Revise os dados informados ou tente outro meio de pagamento.",
"merchant_message": "O pagamento não foi concluído. Oriente o comprador a revisar os dados informados ou tentar outro meio de pagamento."
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_secret",
"message": "Invalid API secret."
}
}{
"error": {
"type": "invalid_request_error",
"code": "account_requests_blocked",
"message": "As requisições desta conta estão bloqueadas.",
"customer_message": "Não foi possível concluir sua transação. Tente novamente mais tarde."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "Recurso \"invoice\" não encontrado."
}
}{
"message": "Too Many Attempts."
}Consultar fatura
Consulta uma fatura de assinatura pelo id. O status da fatura reflete o último pagamento: uma fatura recusada pode ser paga de novo com POST /v2/invoices/{id}/pay.
curl --request GET \
--url https://sandbox.4seletpay.com.br/api/v2/invoices/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.4seletpay.com.br/api/v2/invoices/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.4seletpay.com.br/api/v2/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.4seletpay.com.br/api/v2/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "719305",
"object": "invoice",
"subscription": "sub_4Hn8Qw2Rt6Yp1Zx3",
"number": 1,
"status": "processing",
"currency": "brl",
"amount": 9000,
"attempts": 123,
"items": [
{
"code": "SKU-SUB",
"description": "Assinatura",
"quantity": 1,
"amount": 10000
}
],
"discounts": [
{
"type": "fixed",
"value": 1000,
"invoice_number": 1
}
],
"increments": [
{
"type": "fixed",
"value": 1000,
"invoice_number": 1
}
],
"payments": [
{
"id": "cha_8Kq2Lm9XvB3nT7pZ",
"object": "payment_intent",
"status": "requires_action",
"amount": 10000,
"amount_refunded": 0,
"currency": "brl",
"payment_method_details": {
"type": "card",
"card": {
"brand": "visa",
"last_four": "1111",
"holder_name": "João Silva"
},
"pix": {
"qr_code": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"qr_code_url": "https://pix.exemplo.com.br/qr/cha_8Kq2Lm9XvB3nT7pZ",
"expires_at": "2026-09-14T16:00:00.000000Z"
}
}
}
],
"next_action": {
"type": "pix_display_qr_code",
"pix": {
"qr_code": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"qr_code_url": "https://pix.exemplo.com.br/qr/cha_8Kq2Lm9XvB3nT7pZ",
"expires_at": "2026-09-14T16:00:00.000000Z"
},
"otp": {
"confirmation_id": "5f1c2a9e-7b3d-4e8f-9a6c-1d2e3f4a5b6c",
"expires_at": "2026-09-14T12:15:00.000000Z"
}
},
"created_at": "<string>",
"failure_reason": {
"code": "card_declined",
"message": "O cartão não possui saldo suficiente para concluir o pagamento.",
"customer_message": "Não foi possível concluir o pagamento. Revise os dados informados ou tente outro meio de pagamento.",
"merchant_message": "O pagamento não foi concluído. Oriente o comprador a revisar os dados informados ou tentar outro meio de pagamento."
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_secret",
"message": "Invalid API secret."
}
}{
"error": {
"type": "invalid_request_error",
"code": "account_requests_blocked",
"message": "As requisições desta conta estão bloqueadas.",
"customer_message": "Não foi possível concluir sua transação. Tente novamente mais tarde."
}
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "Recurso \"invoice\" não encontrado."
}
}{
"message": "Too Many Attempts."
}id da fatura é um código numérico de 6 dígitos, como 482913. Ele aparece em latest_invoice.id da assinatura e na listagem de faturas.404 (resource_missing). Para pedidos, use Consultar pedido.status é failed, a resposta traz o motivo em failure_reason. Quando o cliente precisa agir, next_action traz o QR Code PIX ou os dados do código de verificação.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.
Path Parameters
Identificador do recurso (o campo id devolvido pela API)
Response
Fatura encontrada
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
