Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/pix-qr

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Generate valid PIX Copia e Cola strings and scannable QR codes for the Brazilian instant payment system. Provide a PIX key, beneficiary name, city, and optional amount to receive a fully compliant payload and a base64-encoded QR code image ready to embed in your checkout, invoice, or receipt.

Use cases

  • Embed a PIX QR code in e-commerce checkout pages for instant payment
  • Generate donation form links for nonprofits and campaigns
  • Automate invoice generation with unique transaction IDs
  • Enable peer-to-peer payment flows in fintech applications

Request body

FieldTypeRequiredDescription
keystringYesPIX key: phone number, CPF, email, or EVP (random key)
namestringYesBeneficiary name (max 25 characters)
citystringYesBeneficiary city (max 15 characters)
amountnumberNoPayment amount in BRL. Omit for open-value transactions
descriptionstringNoTransaction description (max 72 characters)
txidstringNoTransaction ID for reconciliation

Example

{
  "key": "11999887766",
  "name": "Bunny Build",
  "city": "Sao Paulo",
  "amount": 10.00
}

Response

200 OK

FieldTypeDescription
payloadstringPIX Copia e Cola string (EMV format)
qr_base64stringBase64-encoded PNG QR code image
mime_typestringMIME type of the QR code image
keystringPIX key used
namestringBeneficiary name
citystringBeneficiary city
amountnumberAmount in BRL, if provided
Example
{
  "payload": "00020126330014BR.GOV.BCB.PIX0111119998877665204000053039865406100.005802BR5911Bunny Build6009Sao Paulo62070503***6304ABCD",
  "qr_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "mime_type": "image/png",
  "key": "11999887766",
  "name": "Bunny Build",
  "city": "Sao Paulo",
  "amount": 10.00
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Fields 'key', 'name', and 'city' are required."
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/pix-qr \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"key": "11999887766", "name": "Bunny Build", "city": "Sao Paulo", "amount": 10.00}'