curl --request GET \
--url https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}import requests
url = "https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}', 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-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"merchant": {
"slug": "<string>",
"name": "<string>",
"logoUrl": "<string>"
},
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscriptionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>",
"status": "draft",
"currency": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>",
"amountDue": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"finalizedAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"successUrl": "<string>",
"cancelUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "usage",
"meterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"amount": "<string>",
"proration": true
}
]
},
"testMode": true,
"paymentOptions": [
{
"method": "pix",
"flow": "pix"
}
],
"cardEnabled": true,
"cryptoEnabled": true,
"paymentMethod": "pix",
"mandate": {
"version": "<string>",
"text": "<string>"
}
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"error": {
"code": "internal_error",
"message": "<string>",
"request_id": "<string>"
}
}Ler fatura no checkout
Devolve o que a página de checkout precisa para mostrar uma fatura: dados da sua conta, a fatura e os meios de pagamento disponíveis. Não leva chave; roda no navegador de quem paga.
curl --request GET \
--url https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}import requests
url = "https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}', 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-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/pay/{slug}/invoices/{invoiceID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"merchant": {
"slug": "<string>",
"name": "<string>",
"logoUrl": "<string>"
},
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscriptionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoiceNumber": "<string>",
"status": "draft",
"currency": "<string>",
"subtotal": "<string>",
"tax": "<string>",
"total": "<string>",
"amountDue": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"finalizedAt": "2023-11-07T05:31:56Z",
"paidAt": "2023-11-07T05:31:56Z",
"successUrl": "<string>",
"cancelUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lineItems": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "usage",
"meterId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"priceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"quantity": "<string>",
"unitPrice": "<string>",
"amount": "<string>",
"proration": true
}
]
},
"testMode": true,
"paymentOptions": [
{
"method": "pix",
"flow": "pix"
}
],
"cardEnabled": true,
"cryptoEnabled": true,
"paymentMethod": "pix",
"mandate": {
"version": "<string>",
"text": "<string>"
}
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}{
"error": {
"code": "internal_error",
"message": "<string>",
"request_id": "<string>"
}
}Parâmetros de caminho
O identificador público da sua conta, o mesmo das URLs de checkout.
ID da fatura.
Resposta
A fatura e as opções de pagamento.
O que a página de checkout recebe para mostrar e cobrar uma fatura.
Nome e aparência da sua conta, como o pagador vê.
Show child attributes
Show child attributes
O que um cliente deve: itens, totais e status. Status: draft → open → paid, ou void / uncollectible.
Show child attributes
Show child attributes
true quando a fatura é do sandbox: nenhum dinheiro real se move.
Os meios de pagamento disponíveis para esta fatura.
Um meio de pagamento que o checkout pode oferecer. É uma indicação: a disponibilidade é conferida de novo na cobrança.
- Option 1
- Option 2
Show child attributes
Show child attributes
Se cartão está disponível. Derivado de paymentOptions; sempre presente.
Se pagamento em cripto está disponível neste checkout.
Meio do pagamento confirmado. Só aparece depois que a fatura é paga.
pix, boleto, card, crypto Autorização para salvar o cartão, que o pagador precisa aceitar. Só aparece quando há cartão e a fatura está aberta. Envie version como consentTextVersion ao cobrar com saveInstrument.
Show child attributes
Show child attributes