Skip to main content
A payment is a charge against a payer for a fixed amount in BRL. YuvexPay exposes a single 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 is R$ 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 for GET /v1/payments/{paymentId} and POST /v1/payments/{paymentId}/refund.
  • txId — a stable, prefixed transaction id (PAY + 32 hex characters) that identifies the payment across logs, reports and the dashboard.
You can also pass 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 for PAYMENT_PAID:
The response includes 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.
Direct card payments are constrained to 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

Set mode: "hosted" to receive a checkoutUrl. Redirect the payer there; YuvexPay handles method selection, card capture and PIX rendering.
  • returnUrl is where YuvexPay sends the payer if they abandon the checkout.
  • completionUrl is where YuvexPay redirects after a successful payment.
Hosted payments start in 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.
Fees are computed at creation time using the merchant’s configured rate. 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. Send splits 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 from amount — 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 with SPLIT_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.
Both companies must be approved before a split payment can be created: KYC for an individual, KYC and KYB for a business, on both sides. The check runs when the payment is created, not when it settles. Your own company failing it returns 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} returns 404 for a recipient: the payment belongs to the originating company.
  • The payment receipt is originator-only.
  • Recipients see the money in GET /v1/balance and in GET /v1/documents/statements, and in their dashboard.
Don’t build a recipient integration that waits for PAYMENT_PAID. No webhook is delivered to a recipient for a split. Read the balance or the statement instead.

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, and INSUFFICIENT_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 by PaymentStatus.
  • method — filter by PIX, CARD or BOLETO.
  • startDate / endDate — ISO 8601 date or date-time bounds.
  • minAmount / maxAmount — decimal BRL bounds.
  • environmentSANDBOX or PRODUCTION (defaults to the API key’s environment).

Receipts

Once a payment is PAID or REFUNDED, you can fetch a printable receipt:
See the Documents reference for the full response shape.