Create a QR payin
Sendmethod: "qr" to POST /v1/payins. The key is optional and can be sent
in the JSON body or in the Idempotency-Key header.
QR expiration limits
expires_in is an integer number of seconds for platform QR payins. The
server selects the configured rail; the integrator cannot select it. The
legacy QR contract has an effective maximum of 86399 seconds (23:59:59).
The 7-day QR rail has an effective maximum of 604800 seconds, with
86400 seconds (24 hours) as its default when the value is missing or
non-positive. Values above the selected rail maximum are capped, not
rejected. For the 7-day rail, use at least 120 seconds as an operational minimum.
The response preserves the requested value as charge.requested_expires_in.
If the selected rail returns a shorter lifetime, the response also includes
ttl_notice with requested_expires_in, actual_expires_in, and a note. This
is informational: use charge.expires_at as the deadline.
Response 201:
qr_image or qr_image_url; use qr_payload only when it is present.
Brazil returns the PNG image only, without a copy-and-paste payload. The
numeric reference is the citable reference for support and sharing. When the
customer pays, the account is credited automatically. Read the current status
with GET /v1/payins/{payinID}.
Brazil: PIX QR in BRL or BOB
For Brazil,method: "qr" accepts either currency: "BRL" (recommended)
or currency: "BOB" (direct advanced mode). With BRL, the platform quotes
the BOB charge using the current mid rates, without spread in the quote, and
passes the converted BOB amount to the core. The credit and fees are based on
the BOB amount actually received. The quote is snapshotted and preserved on
idempotent replay.
Recommended: enter the payer amount in BRL
conversion.amount is the source of truth for the amount shown to the payer.
It is the exact amount the payer must transfer, and can differ materially from
the typed amount because the rail applies its own rate. For example, an
integrator may type 5.41 BRL while the generated QR requires 5.84 BRL.
Never display the request amount instead of conversion.amount.
When a rail returns a shorter lifetime than requested, the response is still
successful and includes an additive notice:
expires_in: 300 and show the fixed five-minute notice in
your portal. The rail may return approximately five minutes even when a
longer value was requested.
Advanced: enter the charge directly in BOB
Forcountry: "BR", currency: "BOB" and method: "qr", the charge is
denominated in BOB. The payer pays in BRL through the rail’s conversion.
The payer’s CPF is required; payer_phone and payer_email are optional and
are forwarded when provided:
201 with status: "pending", the QR image fields, the
conversion shown to the payer, and the rail expiration. Brazil’s QR contract
provides a PNG image, not an EMV copy-and-paste payload:
BR/BOB and BR/BRL corridors with
payer_required: true.
When a payer opens a hosted link, the server-driven page asks for the CPF
before materializing the charge. Do not bypass that form by creating a second
charge. Checkout links quote both: BRL for payers (converted to BOB at
materialization with the same mid rate and platform_quote snapshot as the
direct payin) and direct BOB; with two currencies the materialize call
sends ?currency=BRL (or BOB).
Read a QR payin
The detail endpoint returns the same sanitized charge needed to render the QR after a page reload. It includes the image, payer-facing conversion, expiry, status timestamps, and the optionalttl_notice; provider identity and
internal fields are never exposed:
charge.conversion and charge.expires_at for
QR rows, never the image. Request it with explicit date filters:
When an internal QR in a checkout link has expired but still has an image, the
checkout automatically re-materializes a fresh QR before serving it. The
expired image is never presented as payable.
Share a payment link
Use the public tracker as a payer-facing payment page for a pending QR payin. The flow is:- Issue the link with the payin ID:
- Share the exact text
Pay here: {track_url}. If your own portal renders a fallback, usepay.qr_image_urlfirst, thenpay.qr_payloadas text.pay.qr_imageis the inline base64 PNG option. - The payer sees the public page with the QR,
conversion.amountandconversion.currencywhen present, the optional rate, andexpires_at. After payment, the page reflects the public status and timeline.
The link is a signed, no-login capability and is intentionally not listable.
Do not put tracking codes in search indexes or expose them in a directory.
Only a pending QR payin includes
pay; other operations and terminal payins
omit it. The link does not create another charge.Confirmation and reconciliation
The lifecycle is webhook-first. An authenticated inbound event (the rail webhook uses its configuredx-api-key header) can close the pending charge; a
late reconciliation read is allowed only after the configured
minimum age (15 minutes by default). Until the platform status is verified as
credited, the charge remains pending and must not be credited:
Subscribe to payin_credited and payin_charge_status_changed; use
GET /v1/payins/{payinID} as the source of truth before fulfilling an order.
Never retry a possibly submitted payment with a new idempotency key.
Brazil-specific errors
Idempotent retries
idempotency_key is optional for QR payins. Send it in the JSON body or as the
Idempotency-Key header. If both are present, the body value is used. The
platform namespaces the key by account internally; the integrator sends the
key exactly as provided.
The request identity includes country, currency, method and the numeric amount.
For example, "100" and "100.00" are equivalent. description is display
text and is not part of replay identity. The QR channel is not part of the
replay identity: the same key replays the same charge regardless of channel.
The first request creates one charge. A retry with the same key and equivalent
payload returns the original object with idempotency_hit: true; it does not
create another charge:
409 idempotency_conflict:
failed, expired or cancelled, the API returns 422 previous_attempt_failed with the generalized message request could not be processed; use the code, not the message. Rotate the idempotency key and
submit the request again to receive a fresh QR. No replacement charge is
created with the failed replay.
Both the core and the platform return 400 invalid_idempotency_key when the
integrator key is longer than 256 characters or contains carriage-return/
line-feed characters. The platform also rejects the request with the same code
if its server-side account namespace would make the resulting core key exceed
256 characters. That namespace is invisible to the integrator: send the key
unchanged.
Errors
FAQ
Can I change the description when retrying?
Can I change the description when retrying?
Yes. The description is display text and is not part of the replay identity.
What if the customer paid while my request timed out?
What if the customer paid while my request timed out?
Retry with the same idempotency key, then read the returned
payin_id with
GET /v1/payins/{payinID}. Do not create a new key for the same operation.Is a CPF required for every QR payin?
Is a CPF required for every QR payin?
Only for Brazil (
BR/BRL or BOB/qr). The rail validates that the CPF
exists; a synthetic or unknown CPF can be rejected with CPF no encontrado.
Other QR corridors keep their own payer requirements.How does the Brazil QR amount work?
How does the Brazil QR amount work?
Use BRL when the amount your payer should pay is the product price. The
platform converts it to BOB at the mid rate and snapshots the quote. Use BOB
only when you need to specify the core charge directly.
Why can the payer amount differ by a few centavos?
Why can the payer amount differ by a few centavos?
conversion.amount is the exact payer-facing amount returned by the rail. The
rail’s rate and rounding can make it differ from the amount typed in the
request — an incident showed 5.41 BRL entered versus 5.84 BRL in the QR.
Always display conversion.amount and never recalculate it in the client.Why does a Brazil QR expire after five minutes?
Why does a Brazil QR expire after five minutes?
Some Brazil QR rails enforce an approximately five-minute lifetime and ignore
longer requested durations. The API records your
charge.requested_expires_in, returns the actual charge.expires_at, and adds
ttl_notice when the difference is material. Request expires_in: 300 and
start a new QR after expiry; do not reuse a dead QR.What does the QR listing include?
What does the QR listing include?
GET /v1/payins includes a lightweight QR charge with only
conversion and expires_at. Use GET /v1/payins/{id} when you need the
image or the complete sanitized charge.When can I treat a Brazil QR payin as paid?
When can I treat a Brazil QR payin as paid?
Only after the API status is
credited or the corresponding verified webhook
is received. A QR being generated, scanned or locally expired is not proof of
settlement.What is the maximum expires_in for a BO/BOB QR payin in production?
What is the maximum expires_in for a BO/BOB QR payin in production?
For the platform API, the maximum effective value is
604800 seconds (7
days) when the server selects the 7-day QR rail. The legacy QR rail
has an effective maximum of 86399 seconds (23:59:59). Values above the
selected maximum are capped, not rejected; the integrator does not choose the
rail. Use at least 120 seconds for the 7-day rail.Does the link expire with the QR?
Does the link expire with the QR?
The public link can remain reachable, but the QR is payable only until
pay.expires_at. When it expires, do not reuse that QR: create or serve a new
payment attempt according to your product flow.What does the payer see?
What does the payer see?
The payer sees the QR image or its fallback payload, the exact
conversion.amount and conversion.currency when returned, the optional rate,
the expiry and the public status timeline. Provider identity and payer PII are
not exposed.