Guides
Journeys

Pix Out (payments)

Send Pix by key, bank data, copy and paste or session, follow the asynchronous processing and investigate refusals.

In Pay Out, each payment is a POST /payment/api/v1/intents. The response only confirms receipt (queued); the Pix is sent asynchronously and the result arrives in the webhook (Released or Declined). There is no batch endpoint: repeat the call, and deduplication by externalId makes it safe to resend after a network failure.

1. Create the payment

bash
curl --request POST \
  --url https://pay4fun.mimicr.dev/payment/api/v1/intents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "externalId": "pedido-123",
    "callBackUrl": "https://seu-servidor.example.com/webhooks/payment",
    "amount": 150.00,
    "currency": "BRL",
    "payment": {
      "method": "Pix-Key",
      "data": { "pixKeyType": "EMAIL", "pixKeyValue": "cliente@exemplo.com" }
    },
    "tags": ["campanha-julho"]
  }'
json
{
  "message": "Solicitação de pagamento recebida com sucesso",
  "externalId": "pedido-123",
  "status": "queued"
}

The body has no intent id: it comes in the Location: /payment/api/v1/intents/{id} header. You can also look it up by externalId.

The webhook URL can go as callBackUrl (the name in Pay4Fun's example) or webhookUrl (the name in the table); one of them is required.

Reference: Create a payment.

Methods

payment.methodpayment.data
Pix-KeypixKeyType (CPF, CNPJ, EVP, EMAIL, PHONE) and pixKeyValue: valid CPF/CNPJ without punctuation, EVP as a UUID, e-mail up to 77 characters, phone +55DDDDDDDDDDD
Pix-BankDatabankCode (COMPE, 3 characters) or bankISPB (8 characters), branch, account, accountType (PERSONAL, PAYMENT, SAVING) and document
Pix-CopyPasteqrCodeCopyPaste; the amount comes from the QR Code and amount is ignored. Check it first with Decode a QR Code
Pix-Sessiondocument of someone with an active deposit session: pays the bank data of that document's latest released session: true intent

To find a bank's ISPB, use List Pix participants. Format errors answer right away with 400 (VAL-001 for an invalid key); see Errors.

Optional:

  • currency: other currencies are converted to BRL; a currency without a quote answers 422.
  • preValidations: Receiver ({"documentNumber": "..."}, the receiver must have that document) and AccountDestination (a list of {bankCode, bankISPB}; in Mimicr, blocked banks).
  • onFailRetry: true: retries recoverable failures such as insufficient balance.

2. Processing

StatusIn Mimicr
PendingReceived; validation ~1 s later
PendingPSPSent to the SPI, with payment.endToEndId; the amount is blocked in the balance
PendingRetryRecoverable failure; a new attempt follows (retryCount goes up)
CompletedSettled ~3 s later; debit on transactional, R$ 0.50 fee on owner and Released webhook
ErrorRefused in validation or sending; Declined webhook with error.code

To force each path, use the amount table (cents .11, .12, .13) in Sandbox testing. To control it step by step, turn autoProcessPayments off and use the payment.process, payment.settle and payment.decline actions.

3. Look it up and investigate

bash
curl --url https://pay4fun.mimicr.dev/payment/api/v1/intents/by-external/pedido-123 \
  --header 'Authorization: Bearer <token>'
json
{
  "id": "97ff299f-ea81-467c-9c6f-9abb6968cb9b",
  "externalId": "pedido-123",
  "status": "Completed",
  "amount": 150,
  "retryCount": 0,
  "createdAt": "2026-10-23T01:17:33Z",
  "updatedAt": "2026-10-23T01:17:37Z",
  "lastUpdatedAt": "2026-10-23T01:17:37Z",
  "completedAt": "2026-10-23T01:17:37Z",
  "urlCallback": "https://seu-servidor.example.com/webhooks/payment",
  "requestFingerprint": "70166a0c3342addd",
  "payment": {
    "id": "2fedb148-78d7-4101-b752-10db9d677a56",
    "method": "Pix-Key",
    "dataJson": "{\"pixKeyType\":\"EMAIL\",\"pixKeyValue\":\"cliente@exemplo.com\"}",
    "transactionId": "149086590",
    "endToEndId": "E29079725202610230117Dur2utScejU",
    "createdAt": "2026-10-23T01:17:33Z",
    "lastUpdatedAt": "2026-10-23T01:17:34Z"
  },
  "withdrawErrors": [],
  "validationErrors": [],
  "preValidations": [],
  "statusHistory": [
    { "id": "da87476a-...", "previousStatus": null, "newStatus": "Pending", "reason": "Solicitação recebida", "changedAt": "2026-10-23T01:17:33Z" },
    { "id": "b68e8250-...", "previousStatus": "Pending", "newStatus": "PendingPSP", "reason": "Enviado ao SPI", "changedAt": "2026-10-23T01:17:34Z" },
    { "id": "c5623234-...", "previousStatus": "PendingPSP", "newStatus": "Completed", "reason": "Pix liquidado", "changedAt": "2026-10-23T01:17:37Z" }
  ]
}

To investigate a transaction:

  1. Find the intent by id (Get a payment intent) or by externalId.
  2. Read status and statusHistory.
  3. If it was refused in validation: Validation errors.
  4. If sending failed: Withdraw errors, with the log of each attempt and canRetry.
  5. If it settled: Payment receipt (PDF) and reconciliation by endToEndId in the statement.

The list filters by status, externalId, receiver document, period and amount range. Get a payment by its own id looks up by payment.id, not by the intent id.

Balance before paying

Check availableBalance in Get the balance before a batch of payments: payments in flight sit in blockedBalance. Without balance, sending fails with AM04.