Skip to content

PIX Cash In -- Generate QR Code

Generates a PIX charge with a QR Code for receiving payments into the account associated with your API Key.

Endpoint

POST /api/v2/external/pix/cash-in

Headers

HeaderTypeRequiredDescription
AuthorizationStringYesBearer {access_token}
Content-TypeStringYesapplication/json
hmacStringYesHMAC-SHA512 signature of the body (learn more)

Request Body

FieldTypeRequiredDescriptionExample
amountIntegerYesAmount in cents10000 (BRL 100.00)
descriptionStringNoCharge description (max 140 characters)"Order #1234"

Values in cents

All monetary values are integers in cents. BRL 100.00 = 10000. Divide by 100 to get the value in BRL.

Example

bash
BODY='{"amount":10000,"description":"Order #1234"}'
HMAC=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "$CLIENT_SECRET" | awk '{print $2}')

curl -X POST https://api.owem.com.br/api/v2/external/pix/cash-in \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "hmac: $HMAC" \
  -d "$BODY"

Success Response (200)

json
{
  "worked": true,
  "transaction_id": "PIXIN20260307a1b2c3d4e5f6",
  "end_to_end_id": "E37839059202603071530000001",
  "qr_code": "00020126580014br.gov.bcb.pix...",
  "qr_code_image": "data:image/png;base64,iVBORw0KGgo...",
  "amount": 10000,
  "status": "pending"
}
FieldTypeDescription
workedBooleantrue indicates operation success
transaction_idStringUnique transaction identifier
end_to_end_idStringBACEN End-to-End ID (E2E)
qr_codeStringEMV copy-and-paste code for payment
qr_code_imageStringQR Code image encoded in base64 (PNG)
amountIntegerCharge amount in cents
statusStringInitial status: pending (awaiting payment)

Error Response (400)

json
{
  "worked": false,
  "detail": "The amount field is required"
}

Error Response (401)

json
{
  "worked": false,
  "detail": "Invalid or expired token"
}

Error Response (422)

json
{
  "worked": false,
  "detail": "Invalid HMAC"
}
  1. Generate the charge with this endpoint
  2. Display the QR Code (qr_code_image) or the copy-and-paste code (qr_code) to the payer
  3. Receive confirmation via Webhook when payment is made
  4. Or query the status: by ID, by E2E, by Tag

QR Code Validity

The generated QR Code is valid for 24 hours. After this period, the charge expires automatically and the status changes to cancelled.

Owem Pay Instituição de Pagamento — ISPB 37839059