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>"
}
}Read an invoice at checkout
Returns what the checkout page needs to show an invoice: your account’s details, the invoice and the available payment methods. Takes no key; it runs in the payer’s browser.
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>"
}
}Path Parameters
Your account's public identifier, as in checkout URLs.
Invoice ID.
Response
The invoice and payment options.
What the checkout page receives to show and charge an invoice.
Your account's name and look, as the payer sees them.
Show child attributes
Show child attributes
What a customer owes: line items, totals and status. Status: draft → open → paid, or void / uncollectible.
Show child attributes
Show child attributes
true when the invoice is in sandbox: no real money moves.
The payment methods available for this invoice.
A payment method the checkout can offer. It is a hint: availability is checked again at charge time.
- Option 1
- Option 2
Show child attributes
Show child attributes
Whether card is available. Derived from paymentOptions; always present.
Whether crypto payment is available on this checkout.
Method of the confirmed payment. Present only once the invoice is paid.
pix, boleto, card, crypto Authorization to save the card, which the payer must accept. Present only when card is available and the invoice is open. Send version as consentTextVersion when charging with saveInstrument.
Show child attributes
Show child attributes