Avistadocs

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-qrcode

Requires 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

FieldTypeRequiredDescription
valuenumberYesPayment amount in BRL (up to 2 decimal places). Must match the amount embedded in the QR Code, when present
qrCodestringYesPIX QR Code content (EMV string). Min 50, max 500 characters. Must start with 000201
externalIdstringYesUnique external identifier for the transaction
descriptionstringNoOptional payment description
namestringNoRecipient name (may be embedded in the QR Code)
documentstringNoRecipient 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
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)

FieldTypeDescription
transactionIdstringInternal identifier of the generated transaction
externalIdstringExternal identifier provided in the request
statusstringCurrent transaction status (PENDING, CONFIRMED, ERROR)
generateTimestringTransaction generation date/time (ISO 8601)
{
  "transactionId": "456",
  "externalId": "QRPAY-987654-20240119",
  "status": "PENDING",
  "generateTime": "2024-01-19T14:30:00.000Z"
}

Errors

StatusDescription
400Invalid data, invalid QR Code, mismatched amount, or insufficient balance
401Missing or invalid token
409externalId already used in another transaction
500Error processing PIX payment via QR Code

On this page