Pré-visualizar pagamento Pix por QR Code
curl --request POST \
--url http://localhost:3030/v1/payouts/pix-qr/preview \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--header 'x-turbofy-signature: <x-turbofy-signature>' \
--header 'x-turbofy-timestamp: <x-turbofy-timestamp>' \
--data '
{
"qrCode": "<string>",
"amountCents": 750000
}
'import requests
url = "http://localhost:3030/v1/payouts/pix-qr/preview"
payload = {
"qrCode": "<string>",
"amountCents": 750000
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"x-turbofy-timestamp": "<x-turbofy-timestamp>",
"x-turbofy-signature": "<x-turbofy-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'x-turbofy-timestamp': '<x-turbofy-timestamp>',
'x-turbofy-signature': '<x-turbofy-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({qrCode: '<string>', amountCents: 750000})
};
fetch('http://localhost:3030/v1/payouts/pix-qr/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3030",
CURLOPT_URL => "http://localhost:3030/v1/payouts/pix-qr/preview",
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([
'qrCode' => '<string>',
'amountCents' => 750000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>",
"x-turbofy-signature: <x-turbofy-signature>",
"x-turbofy-timestamp: <x-turbofy-timestamp>"
],
]);
$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 := "http://localhost:3030/v1/payouts/pix-qr/preview"
payload := strings.NewReader("{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("x-turbofy-timestamp", "<x-turbofy-timestamp>")
req.Header.Add("x-turbofy-signature", "<x-turbofy-signature>")
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("http://localhost:3030/v1/payouts/pix-qr/preview")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("x-turbofy-timestamp", "<x-turbofy-timestamp>")
.header("x-turbofy-signature", "<x-turbofy-signature>")
.header("Content-Type", "application/json")
.body("{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3030/v1/payouts/pix-qr/preview")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["x-turbofy-timestamp"] = '<x-turbofy-timestamp>'
request["x-turbofy-signature"] = '<x-turbofy-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}"
response = http.request(request)
puts response.read_body{
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"qrType": "STATIC",
"recipient": {
"name": "<string>",
"documentMasked": "<string>"
},
"amountCents": 1,
"feeCents": 1,
"totalDebitedCents": 1,
"currency": "BRL"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Payouts
Pré-visualizar pagamento por QR Pix
Valida um QR Pix e retorna os dados financeiros para revisão antes do pagamento.
POST
/
v1
/
payouts
/
pix-qr
/
preview
Pré-visualizar pagamento Pix por QR Code
curl --request POST \
--url http://localhost:3030/v1/payouts/pix-qr/preview \
--header 'Content-Type: application/json' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--header 'x-turbofy-signature: <x-turbofy-signature>' \
--header 'x-turbofy-timestamp: <x-turbofy-timestamp>' \
--data '
{
"qrCode": "<string>",
"amountCents": 750000
}
'import requests
url = "http://localhost:3030/v1/payouts/pix-qr/preview"
payload = {
"qrCode": "<string>",
"amountCents": 750000
}
headers = {
"x-client-id": "<api-key>",
"x-client-secret": "<api-key>",
"x-turbofy-timestamp": "<x-turbofy-timestamp>",
"x-turbofy-signature": "<x-turbofy-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<api-key>',
'x-client-secret': '<api-key>',
'x-turbofy-timestamp': '<x-turbofy-timestamp>',
'x-turbofy-signature': '<x-turbofy-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({qrCode: '<string>', amountCents: 750000})
};
fetch('http://localhost:3030/v1/payouts/pix-qr/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3030",
CURLOPT_URL => "http://localhost:3030/v1/payouts/pix-qr/preview",
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([
'qrCode' => '<string>',
'amountCents' => 750000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <api-key>",
"x-client-secret: <api-key>",
"x-turbofy-signature: <x-turbofy-signature>",
"x-turbofy-timestamp: <x-turbofy-timestamp>"
],
]);
$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 := "http://localhost:3030/v1/payouts/pix-qr/preview"
payload := strings.NewReader("{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<api-key>")
req.Header.Add("x-client-secret", "<api-key>")
req.Header.Add("x-turbofy-timestamp", "<x-turbofy-timestamp>")
req.Header.Add("x-turbofy-signature", "<x-turbofy-signature>")
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("http://localhost:3030/v1/payouts/pix-qr/preview")
.header("x-client-id", "<api-key>")
.header("x-client-secret", "<api-key>")
.header("x-turbofy-timestamp", "<x-turbofy-timestamp>")
.header("x-turbofy-signature", "<x-turbofy-signature>")
.header("Content-Type", "application/json")
.body("{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3030/v1/payouts/pix-qr/preview")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<api-key>'
request["x-client-secret"] = '<api-key>'
request["x-turbofy-timestamp"] = '<x-turbofy-timestamp>'
request["x-turbofy-signature"] = '<x-turbofy-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"qrCode\": \"<string>\",\n \"amountCents\": 750000\n}"
response = http.request(request)
puts response.read_body{
"previewId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expiresAt": "2023-11-07T05:31:56Z",
"qrType": "STATIC",
"recipient": {
"name": "<string>",
"documentMasked": "<string>"
},
"amountCents": 1,
"feeCents": 1,
"totalDebitedCents": 1,
"currency": "BRL"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Caso de uso
Use esta operação para obter os dados do QR Pix e revisar o pagamento antes de confirmá-lo.Autenticação
x-client-idx-client-secretx-turbofy-timestampx-turbofy-signature- Escopo
payout:write
Requisitos
- O merchant e o tipo de QR precisam estar habilitados após homologação.
qrCodecontém o texto lido do QR Pix.qrCodeaceita até 4096 caracteres.amountCents, quando enviado, deve ser um inteiro positivo de até1500000centavos.
{
"qrCode": "<conteudo-do-QR-Pix>"
}
Resposta
Em200, a resposta contém previewId, expiresAt, qrType, recipient.name, recipient.documentMasked, amountCents, feeCents, totalDebitedCents e currency. O documento do recebedor é mascarado. A moeda é BRL.
O campo qrType identifica o tipo como STATIC, DYNAMIC_IMMEDIATE ou DYNAMIC_DUE_DATE. A API só aceita QR Codes cujos dados sejam coerentes e cujo merchant e tipo estejam habilitados após homologação.
Erros
409: prévia expirada ou divergência encontrada ao usar a prévia.422 PIX_QR_UNVERIFIED: QR inválido, não verificado, não suportado ou ambíguo.422 PIX_QR_AMOUNT_MISMATCH: o valor enviado diverge do valor identificado no QR.422 PIX_QR_EXPIRED: o QR expirou.422 PIX_QR_TYPE_UNAVAILABLE: o tipo de QR não está disponível.422 PIX_QR_AMOUNT_OUT_OF_RANGE: o valor está fora do intervalo permitido.503 PIX_QR_UNAVAILABLE: serviço indisponível ou recurso desabilitado para o merchant ou tipo de QR.
Próximos passos
- Revise o recebedor, o valor, a tarifa e o total debitado na prévia.
- Após a confirmação do cliente, use Solicitar pagamento por QR Pix.
Authorizations
Headers
Body
application/json
Response
Default Response
Last modified on November 12, 2026