Skip to content

Create Payment / QR Code ​

Create a PIX payment order and obtain a QR Code payload.

Endpoint ​

POST /cashin/pix/create-qrcode

Authentication ​

Merchant Credential. See Authentication.

Background ​

This API creates a Brazilian Pix dynamic QR code payment order. The merchant submits its own order and the payment amount; after Adopay completes request signature verification, parameter validation, and idempotency checks, it creates the cashin order and returns the Pix QR code string (qrcode).

The merchant must ensure that mchOrderNo is unique within the scope of the same merchant's cashin orders. It is also the idempotency key, with an idempotency validity period of 3 months: within this period, resubmitting the same order number does not create a duplicate cashin order, and the API returns status code 1406 (the same merchant order number was submitted more than once). Idempotency for cashin and cashout does not exclude each other; an order number submitted for cashin may be reused in cashout. A successful synchronous response only means the QR code was created and the order has entered the pending-payment state; the final payment result is determined by the asynchronous notification or the Query Payment by Order SN result.

WARNING

If the request times out or the response carries no order status, do not infer the order status; confirm it with Query Payment by Order SN.

QR Code Order Transaction Flow ​

  • Synchronous ordering phase: The user submits an order, the merchant requests QR code creation from Adopay, and displays the returned QR code or the payment code to the user.
  • Asynchronous payment phase: The user completes the Pix payment through the paying bank, the central bank BCB notifies Adopay of the payment result, and Adopay notifies the merchant after updating the order.
mermaid
sequenceDiagram
    autonumber
    actor U as User
    participant M as Merchant
    participant A as Adopay
    participant PB as Paying Bank
    participant BCB as Central Bank BCB
    U->>M: Submit order
    M->>A: POST /cashin/pix/create-qrcode
    A->>A: Verify signature, validate parameters and idempotency, create order and QR code
    A-->>M: Return platOrderNo, qrcode, expireTime
    M-->>U: Display QR code or payment code
    U->>PB: Scan the QR code or paste the payment code and confirm payment
    PB->>BCB: Submit Pix payment
    BCB-->>A: Notify payment result
    A->>A: Verify the result and update the order status
    A-->>M: POST the payment result to the callback URL
    alt Merchant confirms successfully
        M-->>A: Return success confirmation
        M-->>U: Update the order and display the payment result
    else Merchant does not confirm successfully
        A-->>M: Retry according to the notification task policy
    end

Request Fields ​

For authentication headers, see Authentication; they are not listed in the table below.

FieldLocationTypeLengthRequiredDescription
mchOrderNoBodystring32YesMerchant order number, generated by the merchant; only letters, digits, _ and - are allowed, up to 32 characters. Unique among the same merchant's cashin orders, and also used as the idempotency key.
amountBodydecimal(25,2)25,2YesOrder amount in BRL (Brazilian Real), at most two decimal places; range per order is 10 – 50000.
payerDocumentBodystring14NoPayer tax ID: CPF (11 digits) for individuals, CNPJ (14 digits) for companies, digits only; must be real and valid. When provided, it restricts the actual payer: the credit is rejected if the actual payer's tax ID does not match.
payerNameBodystring128NoPayer name.
expireTimeBodyint19NoOrder expiration deadline, Unix timestamp in seconds (an absolute time, not a duration); the value must be 1 minute to 24 hours after the current time. Defaults to 30 minutes after ordering if not provided.
attachBodystring128NoOpaque data passed through by the merchant; returned as-is in callback notifications or order queries, invisible to the paying user.
referenceBodystring128NoDescription visible in the user's bank statement details, up to 128 characters.

Request Examples ​

Request header example:

http
POST /cashin/pix/create-qrcode HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1790200000
X-Nonce: 550e8400-e29b-41d4-a716-446655440000
Digest: SHA-256=<Base64Digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"

Request body example:

json
{
  "mchOrderNo": "PIX20260816000001",
  "amount": 125.5,
  "payerDocument": "47929001230",
  "payerName": "Jon",
  "expireTime": 1790200300,
  "attach": "order-source=checkout",
  "reference": "Compra de produtos"
}

Response Fields ​

The API uses a unified status, msg, data response structure. A status of 200 means the dynamic QR code was created successfully; any other value means the request failed, see Response Status for the meaning.

FieldTypeLengthReturnedDescription
statusint4YesResponse code.
msgstring128YesMessage corresponding to status; sucesso on success.
dataobjectN/ANoPre-order response data; may be absent when the request fails before entering business processing.
data.mchOrderNostring32ConditionalMerchant order number; returned after pre-order business processing starts.
data.platOrderNostring64On successPlatform cashin order number.
data.applyTimeint19On successOrder application time (when Adopay accepted the order), Unix timestamp in seconds.
data.amountdecimal(25,2)25,2ConditionalOrder amount.
data.qrcodestring65535On successPix QR code string (the "copy and paste" code); the merchant can generate a QR code from it, or use it directly for copy-and-pay.
data.expireTimeint19On successOrder expiration deadline, Unix timestamp in seconds.

Response Examples ​

Success response example:

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "mchOrderNo": "PIX20260816000001",
    "platOrderNo": "BIA202608160000000001",
    "applyTime": 1790199900,
    "amount": 125.5,
    "qrcode": "00020101021226890014br.gov.bcb.pix2567pix.example.com/qr/v2/7f4a9c1e5204000053039865406125.505802BR5901N6009SAO PAULO62070503***6304ABCD",
    "expireTime": 1790200300
  }
}