Skip to content

/cashin/pix/create-qrcode-partner Create Payment / QR Code ​

Background ​

/cashin/pix/create-qrcode-partner is the pre-order API that the payment gateway provides to partners for Brazilian PIX dynamic QR codes. Through this API the partner submits order, payer, sub-merchant, and product information; after request signature verification, protocol parsing, and message transformation, the platform invokes the pre-order capability to create the payment order and returns the PIX QR code string.

The partner must ensure that the cashin order number mchOrderNo is unique under the same primary merchant. mchOrderNo is also the idempotency key with a validity window of 3 months: resubmitting the same order number within the window does not create a duplicate payment order, and the API returns status code 1406 (the same merchant order number was submitted more than once). Cashin and cashout idempotency are independent of each other; an order number submitted for cashin may be reused in cashout. The API returns the QR code creation result synchronously; the subsequent payment result is determined by the asynchronous notification or the order query result.

QR Code Ordering Transaction Flow ​

A QR code payment consists of two mutually independent phases:

  • Synchronous ordering phase: the user submits an order to the partner, and the partner requests QR code creation from Adopay; after Adopay returns the QR code, the partner displays it to the user.
  • Asynchronous payment phase: the user completes the PIX payment through their paying bank, the Central Bank (BCB) notifies Adopay of the payment result, and Adopay notifies the partner after finishing order processing.

A successful synchronous response only means the QR code was created and the order has entered the pending-payment state; it does not mean the payer has already paid. The final payment result is determined by the Adopay asynchronous notification or the order query result.

User Ordering, QR Code Payment, and Asynchronous Payment Result Flow ​

mermaid
sequenceDiagram
    autonumber
    actor U as User
    participant M as Partner
    participant A as Adopay
    participant PB as Paying Bank
    participant BCB as Central Bank (BCB)

    Note over U,A: User places the order and the QR code is created (synchronous)
    U->>M: Selects a product or service and places the order
    M->>M: Creates the merchant order
    M->>A: POST /cashin/pix/create-qrcode-partner
    A->>A: Signature verification, digest check, timestamp and anti-replay checks
    A->>A: Parameter validation, idempotency check, and Adopay order creation
    A->>A: Creates the PIX dynamic QR code
    A->>A: Stores the order, QR code identifier, and QR code value
    A-->>M: Returns platOrderNo, qrcode, expireTime
    M-->>U: Displays the PIX QR code or copy-and-pay code

    Note over U,BCB: User scans and pays, and the payment result is notified (asynchronous)
    U->>PB: Scans the QR code or pastes the payment code and confirms payment
    PB->>BCB: Submits the PIX payment
    BCB-->>A: Notifies the PIX payment result
    A->>A: Verifies the payment result and updates the order status
    A-->>M: POSTs the payment result to the callback URL
    alt Partner acknowledges successfully
        M-->>A: Returns a success acknowledgment
        M-->>U: Updates the order status and shows the payment result
    else Partner does not acknowledge successfully
        A-->>M: Retries per the notification task policy
    end

Endpoint ​

ItemValue
MethodPOST
Path/cashin/pix/create-qrcode-partner
Content-Typeapplication/json
PurposeCreate a Brazilian PIX dynamic QR code payment order

Access Requirements ​

Request Fields ​

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

FieldLocationTypeLengthRequiredDescription
mchOrderNoBodystring32YesMerchant order number, generated by the partner; only letters, digits, _ and - are allowed, up to 32 characters. Unique among cashin orders under the same primary merchant, and also used as the idempotency key; cashin and cashout idempotency are independent, so cashout may reuse the same order number.
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.
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.
amountBodydecimal(25,2)25,2YesOrder amount in BRL (Brazilian Real), at most two decimal places; range per order is 10 – 50000.
subMerchantNoBodystring64YesPartner-specific. Sub-merchant ID.
attachBodystring128NoOpaque data passed through by the partner; returned as-is in callback notifications or order queries, invisible to the paying user.
referenceBodystring128NoDescription visible in the paying user's bank statement details, up to 128 characters.

Request Example ​

Request header example:

http
POST /cashin/pix/create-qrcode-partner HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1790200000
X-Nonce: 550e8400-e29b-41d4-a716-446655440000
Digest: SHA-256=<Base64 digest>
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.50,
  "payerDocument": "47929001230",
  "payerName": "Jon",
  "expireTime": 1790200300,
  "subMerchantNo": "SUB00000001",
  "attach": "order-source=checkout",
  "reference": "Compra de produtos"
}

Response Fields ​

The API uses the standard status, msg, and data response structure. status = 200 means the dynamic QR code was created successfully; any other value means the request failed or the order is still being processed.

FieldTypeLengthReturnedDescription
statusint4YesResponse code.
msgstring128YesMessage corresponding to status; sucesso on success.
dataobjectN/ANoPre-order response data; may be omitted when the request fails before entering business processing.
data.merchantNostring64NoPrimary merchant ID; returned after pre-order business processing begins.
data.subMerchantNostring64ConditionalPartner-specific. Sub-merchant ID, identical to the subMerchantNo in the request; returned after pre-order business processing begins.
data.mchOrderNostring32ConditionalMerchant order number; returned after pre-order business processing begins.
data.amountdecimal(25,2)25,2ConditionalOrder amount.
data.platOrderNostring64On successPlatform cashin order number.
data.applyTimeint19On successOrder application time (when Adopay accepted the order), Unix timestamp in seconds.
data.expireTimeint19On successOrder expiration deadline, Unix timestamp in seconds.
data.qrcodestring65535On successPIX QR code string (the "copy and paste" code), which can be rendered as a QR code or used as a copy-and-pay code.

Response Example ​

Success response example:

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

Response Error Codes ​

Transaction Result Handling Principles ​

  • A status = 200 from the ordering API only means the QR code was created successfully, not that the payment succeeded.
  • After the QR code is created and before the payment success result arrives, the order remains in the pending or processing state.
  • The partner should integrate both the asynchronous notification and the order query: the notification keeps orders up to date, and the query covers timeouts, missed notifications, and status reconciliation.
  • Asynchronous notifications may be delivered more than once due to network retries. The partner must use platOrderNo as the primary key and apply idempotent processing together with the notification event and order status; duplicate notifications must not lead to duplicate crediting or duplicate fulfillment.
  • Upon receiving a payment success notification, the partner should first verify the signature, then validate the merchant order number, Adopay order number, amount, currency, and order status, and only fulfill the order or provide the service after everything matches.
  • The merchant order number is the cashin idempotency key with a validity window of 3 months: resubmitting the same order number within the window does not create a duplicate payment order, and the API returns status code 1406 (the same merchant order number was submitted more than once).
  • Cashin and cashout idempotency are independent of each other: a merchant order number already submitted for cashin can still be submitted for cashout; an order number only needs to be unique within the same business direction.