Guides
Journeys

Pix In (deposits and checkout)

Create deposit intents with a dynamic or static QR Code, follow the payment, update, cancel and refund.

In Pay In, your backend creates a deposit intent, shows the QR Code to the customer, the customer pays in their banking app and Pay4Fun notifies your webhookUrl. An intent can have several methods (deposits); each becomes a deposit with its own id and reference.

1. Create the intent

bash
curl --request POST \
  --url https://pay4fun.mimicr.dev/deposit/api/v1/intents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "externalId": "deposito-456",
    "webhookUrl": "https://seu-servidor.example.com/webhooks/deposit",
    "deposits": [
      { "method": "Pix-QrDynamic", "amount": 200.00, "data": { "expiration": 600 } }
    ],
    "tags": ["campanha-julho"]
  }'

The 201 response carries id (the canonical identifier; intentId is a deprecated alias), url, status: "Pending" and, on each deposit, reference: the BR Code copy-and-paste string you render as a QR Code in your interface.

Methoddata
Pix-QrDynamicexpiration in seconds (default 300), textInformation, rejectDifferentPayer (default false)
Pix-QrStatictextInformation
Pix-ITPdocument and redirectUrl required; see ITP

Other fields:

  • externalId (up to 250 characters) is your deduplication key. Repeating it answers 409 DEP-123.
  • currency on each deposit: other currencies are converted to BRL and the intent records finalRate, originalAmount, originalCurrency and quoteId.
  • session: true marks the deposit as a session, reusable in a Pix-Session payment (see Pix Out).
  • validations: the Payer and AccountOrigin pre-validations and the Screening post-validation. See Sandbox testing.

Reference: Create a deposit intent.

Several methods: matchingStrategy

matchingStrategyIn Mimicr
FirstDeposit (default)The first paid deposit releases the intent (Released) and closes the others
AccumulatedEach paid deposit leaves the intent Approved; it only becomes Released when all of them are paid

2. The customer pays

In Mimicr, the response's url opens a hosted checkout (/checkout/{id}) with each pending deposit, the copy-and-paste code and a choice of test payer. It is the quickest way to pay while developing. In automated tests, use the action:

bash
npx mimicr action pay4fun deposit.pay intentId=<id-or-externalId> payer=ana

When the payment is approved:

  • the deposit becomes APPROVED with providerEndToEnd;
  • the intent goes through Approved and Released (APPROVED in lookups);
  • the amount lands in the transactional account and the fee (0.99%, R$ 0.10 minimum, in Mimicr) comes out of owner;
  • your webhookUrl gets the Success webhook.

When it fails, the webhook is Rejected (payer's bank, with the error in Deposit errors) or FAILED (Pay4Fun's validation, in Validation errors).

3. Look it up

bash
curl --url https://pay4fun.mimicr.dev/deposit/api/v1/intents/596a71a0-72de-4f09-8b5f-05b0e9230adc \
  --header 'Authorization: Bearer <token>'
json
{
  "id": "596a71a0-72de-4f09-8b5f-05b0e9230adc",
  "type": "Deposit",
  "merchantInvoiceId": "deposito-456",
  "status": "APPROVED",
  "createdAt": "2026-10-23T01:17:17Z",
  "lastStatusDate": "2026-10-23T01:17:19Z",
  "deposits": [
    {
      "id": "c87b5495-ae90-4a24-8ae4-fe9fa326e459",
      "status": "APPROVED",
      "paymentMethod": { "name": "Pix", "description": "Pix QR Code dinâmico", "image": "https://go.pay4fun.com/assets/pix.svg", "currency": "BRL", "minimumAmount": 0.01 },
      "amount": 200,
      "currency": "BRL",
      "reference": "000201010212...6304D58F",
      "providerEndToEnd": "E60746948202610230117mDeBJvX51cI",
      "conciliationId": "CONCMVKA5IP2",
      "finalRate": null,
      "originalAmount": null,
      "originalCurrency": null,
      "quoteId": null,
      "pixDetails": { "type": "Dynamic", "expiration": 600, "rejectDifferentPayer": false },
      "createdAt": "2026-10-23T01:17:17Z"
    }
  ],
  "depositErrors": [],
  "validationErrors": [],
  "preValidations": [],
  "statusHistory": [
    { "id": "4c3bb4db-...", "status": "PENDING", "previousStatus": null, "reason": "Intent criada", "createdAt": "2026-10-23T01:17:17Z" },
    { "id": "85747828-...", "status": "APPROVED", "previousStatus": "PENDING", "reason": "Pagamento aprovado", "createdAt": "2026-10-23T01:17:19Z" }
  ]
}

In lookups the externalId shows up as merchantInvoiceId and statuses are upper case. Other ways to find the intent: by externalId, the list with filters and one deposit by id. Once paid, download the receipts: one PDF, or a ZIP when the intent has several paid deposits.

Expiry

An unpaid Pix-QrDynamic expires after expiration seconds. The deposit becomes EXPIRED, the intent becomes Expired (or stays Pending if other methods are still open) and a webhook arrives with deposit.status: "Expired". To test without waiting: npx mimicr clock pay4fun +10m or the deposit.expire action.

Update and cancel

OperationWhenEffect
Update an intent (PUT)Only in Draft; otherwise 400 DEP-105Replaces externalId, webhookUrl and deposits
Update deposits (PATCH .../deposit)In Mimicr, in Draft or PendingNew amount or expiration and a new QR Code; each item needs data
Cancel (DELETE)Draft or Pending204; Draft becomes Cancelled, Pending becomes Declined. No webhook

Pay4Fun doesn't document how to create an intent in Draft. In Mimicr, send "draft": true on creation and, to submit it, "draft": false on the PUT.

Refund

A Released intent can be refunded in full:

bash
curl --request POST \
  --url https://pay4fun.mimicr.dev/deposit/api/v1/intents/596a71a0-72de-4f09-8b5f-05b0e9230adc/refund \
  --header 'Authorization: Bearer <token>'
json
{ "id": "596a71a0-72de-4f09-8b5f-05b0e9230adc", "intentId": "596a71a0-72de-4f09-8b5f-05b0e9230adc", "status": "Refund" }

Outside Released, the response is 400 DEP-106. There are no partial refunds. In Mimicr, the amount is blocked in the balance and the bank completes the refund ~5 s later (or at once, with the deposit.complete_refund action): the statement gets a "Devolução Pix" debit and the RETURNED webhook arrives with originalEndToEnd.