Send PIX payment via QR Code (Cash-Out QR Code)
POST /api/pix/cash-out-qrcode
POST https://api.avista.global/api/pix/cash-out-qrcodeRequires a Bearer token in the Authorization header. See Generate Token to obtain one.
Sends a PIX payment from a scanned or copied QR Code (copy-and-paste). The QR Code must follow the Central Bank EMV PIX standard.
Authentication
Requires a Bearer token in the Authorization header.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Payment amount in BRL (up to 2 decimal places). Must match the amount embedded in the QR Code, when present |
qrCode | string | Yes | PIX QR Code content (EMV string). Min 50, max 500 characters. Must start with 000201 |
externalId | string | Yes | Unique external identifier for the transaction |
description | string | No | Optional payment description |
name | string | No | Recipient name (may be embedded in the QR Code) |
document | string | No | Recipient CPF or CNPJ (may be embedded in the QR Code) |
{
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
}Code Examples
curl -X POST "https://api.avista.global/api/pix/cash-out-qrcode" \
-H "Authorization: Bearer $AVISTA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
}'const axios = require('axios');
const response = await axios.post('https://api.avista.global/api/pix/cash-out-qrcode',
{
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
},
{
headers: {
'Authorization': `Bearer ${process.env.AVISTA_TOKEN}`,
'Content-Type': 'application/json',
},
}
);
console.log(response.data);import os, requests
response = requests.post(
'https://api.avista.global/api/pix/cash-out-qrcode',
headers={
'Authorization': f'Bearer {os.environ["AVISTA_TOKEN"]}',
'Content-Type': 'application/json',
},
json={
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
},
)
print(response.json())$ch = curl_init('https://api.avista.global/api/pix/cash-out-qrcode');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('AVISTA_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
}',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;String body = """
{
"value": 15.50,
"qrCode": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890520400005303986540515.505802BR5925DESTINATARIO LTDA6009SAO PAULO62070503***6304ABCD",
"externalId": "QRPAY-987654-20240119",
"description": "Pagamento fornecedor XYZ via QR Code",
"name": "Destinatário Ltda",
"document": "12345678000190"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.avista.global/api/pix/cash-out-qrcode"))
.header("Authorization", "Bearer " + System.getenv("AVISTA_TOKEN"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Response (201)
| Field | Type | Description |
|---|---|---|
transactionId | string | Internal identifier of the generated transaction |
externalId | string | External identifier provided in the request |
status | string | Current transaction status (PENDING, CONFIRMED, ERROR) |
generateTime | string | Transaction generation date/time (ISO 8601) |
{
"transactionId": "456",
"externalId": "QRPAY-987654-20240119",
"status": "PENDING",
"generateTime": "2024-01-19T14:30:00.000Z"
}Errors
| Status | Description |
|---|---|
| 400 | Invalid data, invalid QR Code, mismatched amount, or insufficient balance |
| 401 | Missing or invalid token |
| 409 | externalId already used in another transaction |
| 500 | Error processing PIX payment via QR Code |