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 go through the hosted checkout only. They are charged to a credit card in a single installment (à vista) or to a debit card, and need an
amountof at leastR$ 5.00. - With line items, the amount is the sum of the lines. A coupon lowers it, and on the hosted checkout the payer can change it before picking a method by editing quantities, ticking the order bump or applying a coupon. Read the final
amountfromGET /v1/payments/{paymentId}or the webhook.
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.
A PIX payment whose create returns 502 or 503 PROVIDER_TEMPORARILY_UNAVAILABLE
is recorded as CANCELLED: the charge was not created, so retry with a new
externalId.
Boleto errors
methodData is null while a boleto payment is PROCESSING after a 502,
and on a payment recorded CANCELLED before a charge was created.
A create request that reuses an externalId returns the existing payment
instead of creating another one. Send externalId on every boleto payment.
After a 400 or a 503, use a new externalId to try again.
The 502 is stored for its X-Idempotency-Key: repeating the request with the
same X-Idempotency-Key returns the same 502 for 24 hours and never submits
a second charge. To recover the payment after a 502:
- Repeat the request once with the same
externalIdand a newX-Idempotency-Key. The response is the existing payment with itsid, and no second charge is submitted. ItsmethodDataisnullwhile it isPROCESSING. - Poll
GET /v1/payments/{paymentId}until the status leavesPROCESSING. Do not poll by repeating the create: a repeated create with the same key replays the same response for 24 hours. - If the payment ends
CANCELLED, create a new payment with a newexternalId.
externalId, a request with a new X-Idempotency-Key creates a new
payment, and the payer can end up with two boletos for the same order.
Line items
Senditems on POST /v1/payments to charge several lines in one payment. The
payment amount is the sum of unitAmount × quantity, so you can leave
amount out:
itemstakes 1 to 50 lines.- When you also send
amount, it must equal the sum of the lines exactly. Otherwise the request fails with400 AMOUNT_ITEMS_MISMATCH, anddetails.itemsTotalcarries the sum as a string, such as"159.70". - The sum must be at most
R$ 1,000,000.00(400 AMOUNT_TOO_HIGH), and at leastR$ 5.00whenmethodshasCARDorBOLETO(400 MINIMUM_AMOUNT_FOR_CARD_OR_BOLETO). itemsQuantityEditable: truelets the payer change the quantity of each line on the hosted checkout before picking a method.amount, the coupon discount, the fee and the percentage splits follow the change. It has no effect withoutitemsor on a payment with aFIXEDsplit.
kind is ITEM for a line you sent, ORDER_BUMP for the
order bump the payer ticked, and UPSELL for the line of a
payment created by a post-purchase upsell. Webhook
bodies do not carry the lines: read them with
GET /v1/payments/{paymentId}.
Coupons
Create coupons in the dashboard, under Vendas > Cupons, or with the Coupons API. A payment takes a coupon in two ways:couponCodeonPOST /v1/payments.- The Cupom (Coupon) field of the hosted checkout, shown while the payer has not picked a method and no coupon is applied, and only when your account has at least one active coupon that can apply to that payment: inside its validity window, with uses left, covering the whole order or a product of the payment, and of the payment’s environment. The page learns only whether a coupon can apply, never which codes exist. The per-payer limit does not hide the field: it is checked as described below.
PERCENT, with percentBp in basis points from 1 to 10000
(1000 is 10%), or FIXED, with an amount in BRL. The discount is computed
in centavos on the lines the coupon covers: a percentage rounds half up, and a
fixed amount never goes beyond the total of those lines. productIds limits
the coupon to the lines with those products, the order bump included when its
product is in the list; empty, the coupon covers the whole order. On a payment
without items, the coupon covers the amount when productIds is empty or
lists the payment’s productId.
With the order above and a 10% coupon BLACK10, subtotal is 159.70,
discount is 15.97 and amount is 143.73.
- One answer for every refusal.
400 COUPON_INVALIDis returned for a code that does not exist, is inactive or deleted, is outside its validity window, has no uses left, is over the per-payer limit, or gives no discount on this order. Codes are case-insensitive. - Validity.
validFromis inclusive andvalidUntilexclusive. - Uses.
maxRedemptionscounts the payments that hold the coupon plus the completed ones, and the coupon’sredemptionCountshows that number. Applying the coupon takes one use. The use is given back when the payment expires or is cancelled, and kept when it is paid or completes asFREE, so an unpaid checkout holds its use untilexpiresAt. A payment paid after it expired takes its use back, even past the limit. - Per payer.
maxRedemptionsPerBuyercounts the uses per payer e-mail, and is checked only when the e-mail is known: onPOST /v1/paymentswithcustomer.email, and on the hosted checkout when the payer picks a method. If the payer is over the limit at that point, the checkout removes the coupon and shows the full price. A headless payment created withoutcustomer.emailis not checked. - Environments. A coupon belongs to the environment it was created in: a
ypk_test_key manages sandbox coupons and aypk_live_key production ones, and a payment uses only coupons of its own environment. - Before a method is picked. On the hosted checkout, the payer applies or removes a coupon only before picking a method. A payment that already holds a coupon keeps it when you edit, deactivate or delete the coupon.
- Splits. A payment with a
FIXEDsplit never takes a coupon. The discount lowersamount, and the percentage splits with it. On the hosted checkout, a coupon whose discount would take the splits overnetAmountis refused withCOUPON_INVALID. - Methods. When the discount takes the total below
R$ 5.00, the hosted checkout offers PIX only, and a headless boleto fails with400 MINIMUM_AMOUNT_FOR_CARD_OR_BOLETO.
Free orders
When a coupon covers the whole amount, the payment completes with no charge and endsFREE:
- A headless payment completes on
POST /v1/paymentsitself. The201response hasstatus: "FREE",amount: 0andmethodData: null. - A hosted payment stays
PENDING_METHOD_SELECTION, withamount: 0, until the payer confirms the order on the checkout, which asks for no payment method. A payment that is never confirmed expires like any other, and its coupon use is given back.
FREE payment:
amount,feeAmountandnetAmountare0,discountequalssubtotal,feePassedToPayerisfalse,paidAtisnullandcompletedAtis the time the order completed.- Nothing was charged, so nothing can be refunded:
POST /v1/payments/{paymentId}/refundreturns400 INVALID_STATUS, and the payer cannot request a refund on the purchase page. - YuvexPay charges a fee for each free order: the fixed part of your PIX fee,
without the percentage and without a minimum, and nothing when your PIX fee
has no fixed part. It is never passed to the payer. It is debited from your
balance when the order completes, even if the balance goes negative, and
appears in
GET /v1/documents/statementsas Taxa de pedido gratuito (Free order fee). The payment’s ownfeeAmountstays0. Sandbox orders are never charged. - You receive
PAYMENT_FREEon the endpoints that selected it, and neverPAYMENT_PAID. The conversion plugins listen forpayment.paid, so they do not report a free order as a purchase: the order reaches plugins as thepayment.freeevent. - In production, the payer gets the
receipt e-mail and the purchase page, as for
a paid payment. The hosted checkout shows the order as confirmed and
sends the payer to
completionUrlwithyvx_status=FREEandyvx_amount_cents=0(see Signed success redirect). GET /v1/documents/payments/{paymentId}/receiptreturns400 RECEIPT_NOT_AVAILABLE.GET /v1/payments?status=FREElists free orders.- A free order never offers the post-purchase upsell,
and a create with an
upselland acouponCodethat covers the whole amount fails with400 UPSELL_AMOUNT_TOO_HIGH.
Hosted checkout
Setmode: "hosted" to receive a checkoutUrl. Redirect the payer there;
YuvexPay handles method selection, card capture and PIX rendering.
returnUrl, anhttporhttpsURL of up to 2048 characters, is the back link the hosted checkout shows while the payment is unpaid, so the payer can leave without paying.metadata.cancelUrltakes precedence when both are set.completionUrl, anhttporhttpsURL of up to 2048 characters, is where the checkout sends the payer after a successful payment, with signed query parameters (see Signed success redirect).metadata.cancelUrl, anhttporhttpsURL of up to 2048 characters, shows a back link to that URL on the hosted checkout while the payment is unpaid, including after it expires or is cancelled. Any other value is ignored, not rejected. The cancel URL of a payment link created in the dashboard works the same way on the payments the link creates.
PENDING_METHOD_SELECTION until the payer picks a
method, then transition through the same lifecycle as a headless payment. If
the payer doesn’t pick a method before expiresAt, the payment moves to
EXPIRED shortly after and you receive PAYMENT_EXPIRED.
While the payment waits for a method, the checkout shows the order: the
line items, with buttons to change each quantity when
itemsQuantityEditable is true, the Cupom field when a
coupon can apply, the order bump, the discount and
the total of each method. Each change is saved on the payment, which computes
amount, the fee and the percentage splits again. Once the payer picks a
method, the order no longer changes. After the payment, the checkout can offer
a post-purchase upsell.
Store name and branding
The payer sees your store name in the checkout header and legal line, on the purchase page, in receipts and in the e-mails YuvexPay sends them, which come from <store name> via YuvexPay. The store name is the company’s display name, Nome da loja (Store name), from 2 to 60 characters, asked when the company is created. Change it, the logo and the color under Configurações > Checkout (Settings > Checkout), on the Marca do checkout (Checkout branding) card.- A company registered with a CPF never shows the holder’s name or CPF. A store name that contains either is refused.
- A company with a CNPJ also shows its razão social and CNPJ in the legal line.
- A company without a valid store name shows YuvexPay until one is set.
Card payments
The hosted checkout is the only way to accept a card.POST /v1/payments
rejects card data, and CARD in headless mode, with
400 CARD_PAYMENTS_NOT_AVAILABLE_VIA_API (see
Payment errors), so your servers never handle
or store card data.
To charge a card:
- Create the payment with
mode: "hosted"andCARDinmethods:["CARD"], or["PIX", "CARD"]to let the payer choose. Theamountmust be at leastR$ 5.00. - Redirect the payer to the returned
checkoutUrl. The checkout collects the card and runs 3D Secure itself. It accepts credit cards, charged in a single installment, and debit cards. - Read the result from the
PAYMENT_CONFIRMED,PAYMENT_PAID,PAYMENT_EXPIREDandPAYMENT_CANCELLEDwebhooks, or pollGET /v1/payments/{paymentId}.
returnUrl and completionUrl work as for any hosted payment. A hosted card
payment whose 3D Secure challenge fails, or gets no answer for about 7
minutes, ends EXPIRED and you receive PAYMENT_EXPIRED. A card refused after
the challenge ends CANCELLED and you receive PAYMENT_CANCELLED with
reason: "payment_failed". In both cases the payer cannot pick another method
for that payment: create a new one.
Payment links created in the dashboard open the same hosted checkout.
Card payments must be enabled for your account; until they are, a request with
CARD in methods returns 403 PAYMENT_METHOD_NOT_ENABLED. Card acceptance
also requires the account owner’s e-mail to be confirmed, and YuvexPay’s risk
controls can suspend it temporarily. On an account with card payments enabled,
while card acceptance is unavailable, other methods keep working, and:
- The hosted checkout does not offer
CARD, even on payments and payment links created while it was available. - Creating a payment with
CARDand other methods succeeds withoutCARD. - Creating a payment whose only method is
CARDreturns403 PAYMENT_METHOD_NOT_ENABLED(see Payment errors).
POST /v1/payments keep
working: GET returns their masked card methodData, and webhooks, refunds and
chargebacks are unchanged.
On a card payment, GET /v1/payments/{paymentId} returns
methodData.cardFundingType: credit when the card was charged as a credit
card, debit when it was charged as a debit card, and null when the funding
type is not known, including older payments. Webhook bodies do not carry it.
Signed success redirect
When a hosted payment with acompletionUrl reaches PAID, CONFIRMED or
FREE, the checkout shows the payment as approved, counts down 5 seconds and
sends the payer to completionUrl. An Ir agora (Go now) button skips the
countdown. While a post-purchase upsell is offered,
the checkout shows only the Ir agora button, and the countdown starts once
the payer declines the offer. On a payment link created in the dashboard, the
link’s success URL takes the place of completionUrl. Only an http or
https URL of up to 2048 characters is used.
The checkout adds these query parameters to the URL:
The query parameters already in your
completionUrl are kept, and any yvx_
parameter in it is replaced. The URL is signed again each time the checkout
loads, so the same payment can reach your URL more than once, after a reload
or when the payer opens the checkout again, each time with a new yvx_ts and
yvx_signature. Sandbox payments redirect the same way, with the same secret.
Redirect secret
The signing key is your account’s redirect secret, a 64-character string shown in the dashboard under Configurações > Checkout (Settings > Checkout), in Segredo do redirecionamento (Redirect secret), to users who can edit webhooks. It is not the secret of a webhook endpoint. It is created the first time that page is opened or a payment redirects, whichever comes first. Trocar segredo (Rotate secret) replaces it at once, with no overlap: a URL signed before the rotation, for example on a checkout page that was already open, no longer verifies. Keep the secret on your server and never send it to the browser.Verifying the redirect
yvx_reference can contain dots, so never split the message to read the
values back.
- Read the six parameters. Reject the request if one is missing.
yvx_referencecan be empty, but it is always present. - Reject it if
yvx_tsis more than 600 seconds away from your clock. - Compute the signature and compare it with
yvx_signaturein constant time. - Look up your order by
yvx_payment_idand compareyvx_amount_centswith the order total in cents. When the payer can change the order on the checkout, with a coupon, editable quantities or an order bump, compare it with theamountofGET /v1/payments/{paymentId}instead, and read what was bought fromitems. - Confirm the payment on your server before you fulfil the order: call
GET /v1/payments/{paymentId}, or wait for thePAYMENT_PAID,PAYMENT_CONFIRMEDorPAYMENT_FREEwebhook. Fulfil each payment once, since the redirect can repeat and the webhook arrives as well.
Test vector
Check your signature function with this secret and these two messages. The second has an emptyyvx_reference, hence the two dots in a row. Their
yvx_ts is fixed, so the full verifier rejects them as older than 600
seconds: test the signing function on its own.
Skipping checkout steps
The hosted checkout asks the payer for their name, e-mail and CPF or CNPJ before it shows the payment methods. When you already sent them on the payment, addskip_customer=1 to the checkoutUrl and the checkout goes
straight to the payment methods:
- The form is skipped only when the payment has a customer, from
customerorcustomerIdonPOST /v1/payments, with a name of 2 to 120 characters, a valid e-mail and a CPF or CNPJ with valid check digits. Otherwise the checkout shows the form as usual. 1andtrueturn a flag on. Any other value is ignored.- Once the checkout has saved details the payer filled in on a payment, the flag no longer skips the form on that payment.
- A card payment still asks for the name on the card and a phone number.
- When the payment has such a customer, the wait for
CHECKOUT_ABANDONEDand the recovery kit starts the first time the checkout is opened while the payment is waiting for a method, with or withoutskip_customer=1. skip_address=1is accepted but has no effect today.POST /v1/paymentshas no address fields, so there is never an address to skip, and a card payment keeps asking for the CEP and the street number.- Personal data in the URL is ignored. The checkout never fills the form from
query parameters such as
name,emailordocument: send the payer’s data incustomerwhen you create the payment.
checkoutUrl only, not on the URL of a payment link.
Recovery kit
The recovery kit e-mails a payer who filled in the hosted checkout and did not pay, with a link back to the payment. Turn it on for a payment withrecoveryKit on POST /v1/payments:
trueturns the kit on for the payment andfalseturns it off. WithoutrecoveryKit, the payment follows the account default: Ativar por padrão (Turn on by default) on the Kit de recuperação (Recovery kit) card under Configurações > Checkout, which is off until you turn it on. A payment link created in the dashboard has its own Kit de recuperação setting in the link form: Padrão da conta (Account default), Ativado (On) or Desativado (Off).- The kit starts when the hosted checkout saves the payer’s name, e-mail and
CPF or CNPJ, or the first time the checkout is opened for a payment that
already has them (see Skipping checkout steps).
This is the same moment that starts the wait for
CHECKOUT_ABANDONED. A headless payment never starts a kit, sorecoveryKit: truedoes nothing on it. - The e-mails go to the e-mail the payer typed on the checkout, else the one
you sent in
customer. Up to 5 are sent, at the delays set under Envios (E-mails) on the same card, counted from the moment the kit started: 15 minutes, 1 hour and 24 hours unless you change them. Each delay is between 5 minutes and 7 days. - When the payer picked PIX, one more e-mail goes out about 10 minutes before the PIX code expires.
- The e-mails stop when the payment is paid, and when it expires or is
cancelled: an e-mail is sent only while the payment can still be paid, so
set
expiresInMinutesto cover the delays you want. - On a payment from a payment link, the e-mails go on after the payment
expires, with a link to the payment link, for as long as the link is active.
They stop when the same payer, identified by e-mail, pays another payment of
that link. A payer who opens the same link again while an earlier kit for
their e-mail is still running gets no second kit, and the new payment shows
recoveryKit.enabled: false. - An e-mail is skipped when the payer unsubscribed from your store’s e-mails or reached YuvexPay’s sending limits for their address. YuvexPay also stops sending payer e-mails to an address, for every store, after a hard bounce, a block for an invalid address or a spam report. See Payer e-mails.
- Sandbox payments never get a kit:
recoveryKit.enabledisfalseon them, even when you sendtrue.
GET /v1/documents/statements
as Kit de recuperação.
GET /v1/payments, GET /v1/payments/{paymentId} and
GET /v1/payments/txid/{txId} return the kit of each payment:
The dashboard shows the results per day on the Recuperação de vendas
(Sales recovery) card of Visão geral (Overview). The detail of a payment
shows its kit, with a Ligar kit (Turn on kit) or Parar e-mails (Stop
e-mails) button.
Order bump
An order bump is one more product offered on the hosted checkout, as a box the payer ticks before picking a method. SendorderBump on a hosted payment:
- When the payer ticks the box, the bump joins
itemswithkind: "ORDER_BUMP"and quantity1, andamount, the fee and the percentage splits are computed again. Unticked, it leaves the order. The payer can change it until they pick a method. - A coupon for the whole order covers the bump. A coupon limited to products
covers it only when its
productIdis in the coupon’sproductIds. - A payment created with an amount only can have a bump too: the bump is added to that amount.
orderBumpandupsellare for hosted payments only. In headless mode, the default, they return400 VALIDATION_ERRORwithOFFERS_REQUIRE_HOSTEDin the message.- The bump is not shown on a payment with a
FIXEDsplit.
Post-purchase upsell
An upsell is a second product offered on the hosted checkout right after the payment is paid. Sendupsell on a hosted payment, with the same fields as
orderBump:
unitAmountgoes fromR$ 1.00up to the paymentamountafter the coupon. Above it, the request fails with400 UPSELL_AMOUNT_TOO_HIGH.- The offer appears on the success screen of a
PAIDorCONFIRMEDpayment for 30 minutes, counted from the payment for PIX and from the card charge for a card. The payer sees it once: after they accept or decline, it is gone. - When the payer accepts, YuvexPay creates a new payment and takes the payer to
its checkout. If the original was paid by card in the same browser, the payer
can pay in one click with the same card, which goes through the same checks
as any card payment. Otherwise, the payer pays by PIX. PIX is offered when the
original payment accepted it, and the card only for an upsell of at least
R$ 5.00. - The new payment has its own
idandtxId,parentPaymentIdset to the original payment, one item withkind: "UPSELL", the offer name asdescription, the same payer and the same splits. It expires in 30 minutes, never passes the fee to the payer, has no recovery kit and sends its own webhooks. - The upsell is not offered on a payment with a
FIXEDsplit, or with a split whose partner relationship is no longer active, nor on a free order. It is not offered either when the payer’s changes on the checkout, such as a lower quantity or a coupon, took the finalamountbelow the upsell price.
The upsell payment is created by YuvexPay, not by your integration. It keeps
metadata.cancelUrl but none of your other metadata keys, and it has no
externalId, so its webhooks arrive for an id you never created. Read it
with GET /v1/payments/{paymentId} and link it to your order through
parentPaymentId. Once it is paid, the checkout sends the payer to the same
completionUrl, with the upsell payment’s yvx_payment_id and an empty
yvx_reference.Attribution tracking
Send the optionaltracking object on POST /v1/payments to attribute the
sale to the campaign and the visitor that brought the payer. YuvexPay stores it
with the payment and passes it to the conversion plugins enabled for your
account, such as GA4, Meta Conversions API, TikTok Events API and UTMify.
Every field is optional, and values are trimmed. A
gaClientId, fbp or fbc
that does not match its format is ignored, and the payment is created without
it. Any other field that is not a string or is over its length limit fails the
request with 400 VALIDATION_ERROR. When you send fbclid without fbc,
YuvexPay builds the fbc for Meta from it.
Tracking on the hosted checkout
The hosted checkout fillstracking by itself from the URL the payer opens it
with: the utm_source, utm_medium, utm_campaign, utm_term,
utm_content, src, sck, fbclid, gclid, ttclid, _ga, _fbp and
_fbc query parameters. The fields you sent in tracking when you created the
payment are kept: the checkout fills only the ones you left empty. Payment
links created in the dashboard capture the same parameters from the link URL.
The checkout reads these parameters only on the visit that carries them and
stores nothing in the payer’s browser. They reach YuvexPay when the payer
saves their details or picks a method on that visit, and stay on the payment
from then on. A payer who comes back later through a URL without them adds
nothing, so keep the parameters on every checkoutUrl you hand out.
Your own _ga, _fbp and _fbc cookies are set on your domain, so the
checkout cannot read them. To attribute a hosted-checkout purchase to the
visitor your GA4 tag and Meta Pixel saw, send those cookie values in tracking
when you create the payment, or append them, URL-encoded, to the checkoutUrl
as query parameters:
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.
On a hosted payment, the fee in the create response is the one of the first
method in methods. The checkout shows each method with its own total, and
when the payer picks a method, feeAmount, payerFeeAmount and netAmount
are computed again at that method’s rate, card included. Cards are charged in a
single installment, so no installment fee is added. The fee is also computed
again whenever the order changes on the checkout. Below R$ 1.00, the fee is
always passed to the payer. A free order has a fee of its own,
never passed to the payer.
A refund you issue returns the fee in proportion to the refunded amount, unless
it takes the counted volume of your verified CPF or CNPJ below a rewards prize
YuvexPay approved for it (see refunds below a redeemed rewards prize).
A PIX MED that returns funds, a chargeback and a refund YuvexPay makes after a
refund request from the payer
do not: your balance is debited the full amount returned to the payer, and
YuvexPay keeps feeAmount.
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.
Percentage shares follow the final amount, after a coupon and the
payer’s changes on the hosted checkout. A payment with a FIXED split takes no
coupon, keeps its quantities, and offers no order bump and no upsell. A
post-purchase upsell payment carries the same splits
as the original.
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 0.80 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 0.80 fee and
one recipient at 33.33%, the recipient is credited 33.33 and you keep
99.20 - 33.33 = 65.87.
Split partners
You can only split to a company that has agreed to receive splits from you. The pair is created in the dashboard, under Configurações > Parceiros de divisão: the originating company invites the recipient by its company ID — the same ID the recipient sees under Configurações > Empresa — and the recipient accepts. The recipient never initiates. Consent is per environment and per direction. A recipient that accepted in production still has to accept in sandbox, and accepting your splits does not let it split to you.GET /v1/splits/partners lists the companies
your account may split with, so an integration knows which IDs are usable
without hardcoding them. Inviting, accepting, declining and revoking are
dashboard-only: accepting is a human act.
There is one exception. A platform approved by YuvexPay connects a seller on
the seller’s first payment, with no invitation, by sending its own API key in
the X-Split-Platform-Key header of POST /v1/payments. The connection works
in production and in sandbox, with a key of the same environment as the
seller’s, and carries a fee cap: a split to an approved platform above the cap
fails with SPLIT_FEE_CAP_EXCEEDED, and one to a platform whose approval was
withdrawn fails with SPLIT_PLATFORM_SUSPENDED. See
Split platforms.
A relationship is in one of five states.
Invites do not expire; the originator can cancel one at any time. After
DECLINED, REVOKED or CANCELLED the originator can invite the same company
again — that starts a new relationship and the earlier one is kept as
history.
Creating a payment naming a recipient that has not accepted fails with
SPLIT_RELATIONSHIP_PENDING, one naming a recipient that declined the
invitation fails with SPLIT_RELATIONSHIP_DECLINED, and one naming a recipient
whose pair was revoked fails with SPLIT_RELATIONSHIP_REVOKED. Revoked is
reported ahead of declined, and declined ahead of pending.
SPLIT_RELATIONSHIP_DECLINED carries details.recipients, the company IDs that
refused; the pair becomes usable again only once you send a new invitation from
the dashboard and that company accepts it.
SPLIT_RELATIONSHIP_PENDING is still the single answer for every other
recipient that cannot receive a split yet. Declined and revoked are only
reachable for a company your own company invited first, so neither tells you
anything you did not already know, and a company you never invited reads the
same as a company ID that belongs to no company at all — so the error cannot be
used to discover which company IDs exist.
Revocation is forward-only, and either side can revoke. Payments that were
already created still settle, refund and freeze normally, and the recipient
still receives those shares — a split is fixed at creation.
SPLIT_RELATIONSHIP_REQUEST_LIMIT until some of the
outstanding requests are answered.
The number of active partners is capped too: three by default, the same
recipient limit that bounds splits[]. The dashboard enforces that ceiling
when an invite is sent or accepted. The API returns it in one case: a
platform connection that would take the seller past
the limit fails with SPLIT_PARTNER_LIMIT_EXCEEDED, and details.limit
carries the limit.
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 bar is checked
when the invite is sent and again 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 returns
SPLIT_RELATIONSHIP_PENDING whatever the reason, or
SPLIT_RELATIONSHIP_DECLINED if it refused your invitation; one that had
accepted and has since stopped meeting the bar returns
SPLIT_RECIPIENT_NOT_APPROVED.
In sandbox the flow is identical but the KYC gate does not apply, so the whole
invite → accept → split cycle is testable with unverified sandbox companies.
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
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.
The invite, accept and split cycle works in sandbox, and so does the
platform connection: the platform sends a
ypk_test_ key of its approved company in X-Split-Platform-Key, the same fee
cap applies and the seller is not notified. Once connected in sandbox, the
approved platform, a production company, can be named in the seller’s sandbox
payments: it is the one exception to the sandbox-mode rule above.
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,FREEincluded.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).
Payer e-mails
- Receipt e-mail. In production, YuvexPay e-mails the payer a receipt after they pay. E-mail de recibo ao comprador (Buyer receipt e-mail), under Configurações > Checkout, turns it off. It is on by default.
- Addresses that stop receiving e-mails. YuvexPay stops sending payer e-mails to an address after a hard bounce, a block for an invalid address or a spam report, for every store. An address that unsubscribed from your store’s e-mails gets none of them, receipts and recovery kit e-mails included.
Receipts
Once a payment isPAID or REFUNDED, you can fetch a printable receipt:
400 RECEIPT_NOT_AVAILABLE.
