POST /v1/payments endpoint that creates payments across
three methods (PIX, CARD, BOLETO) and two presentation modes (headless
and hosted).
Methods at a glance
Pick
headless when you want to render the payment yourself; pick hosted
when you want YuvexPay to render the checkout, including method selection.
Amounts and currency
- All amounts are in BRL as decimal numbers (e.g.
49.90), not cents. - The minimum chargeable amount is
R$ 0.01. The maximum isR$ 1,000,000.00. - Card payments currently require
installments: 1(a single installment). Larger card transactions must be sent through the hosted multi-installment flow.
Identifiers
Every payment has two identifiers:id— an internal UUID. Use it as the path parameter forGET /v1/payments/{paymentId}andPOST /v1/payments/{paymentId}/refund.txId— a stable, prefixed transaction id (PAY+ 32 hex characters) that identifies the payment across logs, reports and the dashboard.
externalId on creation — typically your own order id —
which is stored on the payment for cross-referencing. externalId is unique
per company and environment.
Lifecycle
Listen for the corresponding webhook events to react to
status changes asynchronously.
Headless PIX
Headless PIX is the simplest flow. Create the payment, render the QR code or copy-paste string, and listen forPAYMENT_PAID:
methodData.pixCopyPaste (the BR-Code string) and
methodData.qrCodeBase64 (a data URI). Render either to the payer.
Headless direct credit card
Direct card payments charge the card immediately on creation. The payer never leaves your UI, but you assume PCI scope: card data flows through your servers.methods: ["CARD"] (a single method),
installments: 1, and require card.holderInfo and card.remoteIp. For
multi-method or multi-installment card flows, use the hosted checkout.
Hosted checkout
Setmode: "hosted" to receive a checkoutUrl. Redirect the payer there;
YuvexPay handles method selection, card capture and PIX rendering.
returnUrlis where YuvexPay sends the payer if they abandon the checkout.completionUrlis where YuvexPay redirects after a successful payment.
PENDING_METHOD_SELECTION until the payer picks a
method, then transition through the same lifecycle as a headless payment.
Fees and net amount
Each payment response includes:amount— the gross amount charged to the payer.feeAmount— the YuvexPay processing fee.netAmount— the amount credited to your balance once the payment settles, before any splits.
passFeeToPayer: true shifts the fee onto the payer (the payer is charged
amount + feeAmount); when false, the fee is deducted from amount.
Splits
A payment can hand part of itself to other YuvexPay companies. Sendsplits on
POST /v1/payments; each entry names the company that receives a share and how
much of the payment it gets.
splits is optional. The maximum number of entries is the recipient limit
configured for your account — three by default, and support can raise it.
Splits are set at creation only: there is no endpoint to add, edit or remove one
afterwards. The create response and the payment detail response echo them back
as splits, each entry carrying an id alongside the three fields you sent,
and [] when the payment has none.
How the money divides
The YuvexPay fee is always the originating company’s and is never apportioned. Shares are computed fromamount — the gross — and the fee comes out of your
share alone. When passFeeToPayer is true, nothing is deducted from amount at
all.
netAmount stays pre-split: it is still amount - feeAmount, or amount when
the fee is passed to the payer. You keep netAmount minus the sum of the
splits, and the recipients are credited when the payment settles.
For amount: 49.90 against a 2.99 fee, split 10% to one company and a fixed
R$ 5.00 to another:
The sum of the splits must be at most
netAmount. A request that goes over
fails with SPLIT_AMOUNT_EXCEEDS_NET and the response names the overflow.
Nothing is clamped.
Percentage shares are rounded down to the cent, and every remaining cent
stays with the originating company. On amount: 100.00 with a 2.99 fee and
one recipient at 33.33%, the recipient is credited 33.33 and you keep
97.01 - 33.33 = 63.68.
Opting in
The first time you split to a company, that company has to accept the relationship in its dashboard. Until it does, creating the payment fails withSPLIT_RELATIONSHIP_PENDING. Once it has accepted, later payments carry no
further friction.
SPLIT_RELATIONSHIP_PENDING is the single answer for every recipient that
cannot receive a split yet. It reads the same whether the company ID belongs to
a real company or to no company at all, so the error cannot be used to discover
which company IDs exist. A consent request is created only for a recipient that
does exist, is active, is in the same environment and is approved.
Your company can hold a limited number of split requests awaiting an answer, 20
by default and counted per environment. Beyond that, naming a new recipient
fails with SPLIT_RELATIONSHIP_REQUEST_LIMIT until some of the outstanding
requests are answered.
The recipient can revoke at any time. New payments then fail with
SPLIT_RELATIONSHIP_REVOKED.
Revocation is forward-only. Payments that were already created still settle,
refund and freeze normally, and the recipient still receives those shares.
403 SPLIT_ORIGINATOR_NOT_APPROVED. A recipient that has not accepted yet
returns SPLIT_RELATIONSHIP_PENDING whatever the reason; one that had accepted
and has since stopped meeting the bar returns SPLIT_RECIPIENT_NOT_APPROVED.
What a recipient sees
A split is not the recipient’s payment, and recipients get no webhook and no receipt for it.GET /v1/payments/{paymentId}returns404for a recipient: the payment belongs to the originating company.- The payment receipt is originator-only.
- Recipients see the money in
GET /v1/balanceand inGET /v1/documents/statements, and in their dashboard.
Refunds, MED and reserve
Refunds and PIX MED are proportional. A refund debits every party in proportion to what it received, the originating company included, and partial refunds use the same proportions. A MED freezes each party’s proportional share. A recipient that has already withdrawn its share goes negative. The shortfall is never moved onto the originating company, andINSUFFICIENT_BALANCE_FOR_REFUND is measured against the originating company’s
share only.
A split credit is subject to the recipient’s own rolling reserve policy, not
the originator’s. When a refund or MED debit lands on a recipient whose share is
still in reserve, that payment’s own reserve hold is released first and the
debit is written against it.
Sandbox and anticipation
A sandbox payment can only split to a company that is in sandbox mode, and a production payment only to a production company. The other direction is always rejected, never a silent no-op:400 SPLIT_RELATIONSHIP_PENDING for a recipient
that has not accepted in this environment, and 400 SPLIT_ENVIRONMENT_MISMATCH
for one that had. Sandbox splits never touch a production balance, statement or
report.
Payments that carry splits cannot be anticipated
(ANTICIPATION_SPLIT_PAYMENT).
Pagination and filtering
GET /v1/payments supports the standard page (default 1) and limit
(default 20, max 100) parameters along with these filters:
status— filter byPaymentStatus.method— filter byPIX,CARDorBOLETO.startDate/endDate— ISO 8601 date or date-time bounds.minAmount/maxAmount— decimal BRL bounds.environment—SANDBOXorPRODUCTION(defaults to the API key’s environment).
Receipts
Once a payment isPAID or REFUNDED, you can fetch a printable receipt:

