Create a payment
Create a new payment. Supports PIX, direct credit card charges for headless single-method CARD flows, hosted card checkout, and boleto. Requires an idempotency key.
Authorizations
YuvexPay API key. Include as Authorization: Bearer ypk_<env>_<kid>_<secret> where <env> is test (sandbox) or live (production). Create and manage keys in the dashboard under Settings > API Keys.
Headers
A unique string to ensure the request is processed only once. Must be unique per request. Valid for 24 hours.
100Body
Link this payment to an existing product. If set, amount is optional and defaults to the product price.
Link this payment to an existing customer. For CARD and BOLETO, the linked customer must have name and CPF/CNPJ.
Payment amount. Required unless productId is provided.
0.01 <= x <= 1000000Accepted payment methods. Headless payments must use exactly one method.
1Available public payment methods.
PIX, CARD, BOLETO Supported currencies.
BRL hosted redirects the payer to a YuvexPay checkout page. headless returns method data directly for a single payment method. Headless CARD requires the card payload for direct credit card capture. Hosted or multi-method CARD flows continue through checkout/provider invoice URLs, where debit remains available.
hosted, headless URL to redirect the payer after payment (hosted mode).
URL to redirect the payer after successful payment completion.
Payment description shown to the payer.
500Your own reference ID (e.g., order number).
100Minutes until the payment expires (5-1440).
5 <= x <= 1440PIX only. Opt-in request that the charge be paid from an account whose CPF/CNPJ matches the customer's document (same-document payment). Best-effort: when the provider cannot enforce it, the charge is still created and paid normally.
Inline customer data. For CARD and BOLETO, include at least name and CPF/CNPJ unless you use customerId.
Arbitrary key-value pairs attached to the payment.
Whether the YuvexPay fee should be added on top of amount and charged to the payer instead of being deducted from the merchant's net. When omitted, the company-level passFeeToPayerDefault setting applies. Note: payments with a resolved amount below R$1,00 are always charged to the payer regardless of this value (forced passthrough to keep merchant net positive). The final decision is reflected back as feePassedToPayer on the Payment object.
Direct credit card charge payload. Allowed only for headless single-method CARD payments and required in that flow.
Response
Payment created.
- Option 1
- Option 2

