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.
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.

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.