Skip to main content

Payment split

Payment split lets you declare, when you create an immediate charge, how the amount received should be distributed among other Pix keys. After the payer pays, LB Pay reserves each share in your account and sends one Pix to each recipient, so you do not need to transfer the money manually.

info

Split is available for immediate charges (POST /v2/pix/deposit/immediate-charge). Your account must be enabled for split; ask your LB Pay contact to enable it. Charges sent with a split block by an account that is not enabled are refused with 422 SPLIT_NOT_ELIGIBLE.

How the flow works​

  1. Create the charge with a split: send the optional split block with the share of each recipient. The charge is validated and created as usual; the split block is echoed in the response and in GET /v2/pix/deposit/immediate-charge/{chargeId}.
  2. Payer pays the charge: the Pix is credited to your account normally.
  3. Shares are reserved: right after the payment settles, the amount of each share is reserved in your account. Reserved amounts cannot be spent or withdrawn.
  4. Transfers are sent: LB Pay sends one Pix to each recipient key. A recipient that is also an LB Pay customer receives an internal transfer; any other key is paid through the SPI.
  5. What is left stays with you: the part of the payment that is not distributed remains available in your account.

Request​

The split block is optional. Without it, the charge works exactly as before.

{
"amount": 10000,
"pixKey": "your-pix-key",
"externalId": "3f1c2a77-9d5e-4c1a-8f0b-6a2d1e4b7c90",
"expiresIn": 3600,
"expectedPayer": { "name": "Payer name" },
"split": {
"type": "FIXED",
"recipients": [
{ "pixKey": "recipient-one@example.com", "amountSplit": 6000 },
{ "pixKey": "12345678000190", "amountSplit": 2500 }
]
}
}

In this example the payer pays R$ 100,00, the first recipient receives R$ 60,00, the second receives R$ 25,00 and R$ 15,00 stays in your account.

FieldDescription
split.typeFIXED (each share is an amount in centavos) or PERCENT (each share is a percentage of the charge amount). Case-insensitive.
split.recipientsFrom 1 to 10 recipients.
recipients[].pixKeyPix key of the recipient: CPF, CNPJ, email, phone or random key (EVP), up to 77 characters.
recipients[].amountSplitFIXED: integer amount in centavos. PERCENT: percentage greater than 0 with up to 2 decimal places.

Business rules to plan around​

RuleValue
Base of the calculationThe gross amount of the charge
Total distributedUp to 100% of the charge (PERCENT up to 100; FIXED up to amount)
Recipients per charge1 to 10
Repeated recipientsThe same Pix key cannot appear twice, and cannot be the pixKey of the charge itself
Recipient accountMust belong to someone else. A key of your own account passes validation but the transfer fails, because money cannot be sent from an account to itself
Rounding (PERCENT)Each share is rounded down to the centavo; the remainder stays with you. Example: 3 × 33.33% of R$ 1,01 sends R$ 0,33 to each recipient and leaves R$ 0,02 with you
Minimum shareA share that would round down to 0 centavos is refused

Errors​

Validation errors are returned when the charge is created; in that case no charge is created and nothing is reserved.

HTTPTypeReason
422SPLIT_NOT_ELIGIBLEThe account is not enabled for split
422SPLIT_INVALID_TYPEsplit.type is not PERCENT or FIXED
422SPLIT_EMPTY_RECIPIENTSsplit.recipients is empty
422SPLIT_TOO_MANY_RECIPIENTSMore than 10 recipients
422SPLIT_INVALID_PIX_KEYA recipient key is not a valid CPF, CNPJ, email, phone or EVP
422SPLIT_INVALID_AMOUNTA share is not a positive number in the expected precision, or rounds down to 0 centavos
422SPLIT_AMOUNT_EXCEEDS_TOTALThe sum of FIXED shares exceeds the charge amount
422SPLIT_PERCENT_EXCEEDS_100The sum of PERCENT shares exceeds 100
422SPLIT_DUPLICATE_RECIPIENTA key appears more than once, or matches the charge pixKey
503SPLIT_ELIGIBILITY_UNAVAILABLEEligibility could not be checked at that moment; retry the request

After the payment​

  • Transfers that fail: if a recipient key is refused (for example, it does not exist in the DICT), that share stays reserved in your account and the other recipients are paid normally. LB Pay operations can resend it, correct the key or cancel the share, which releases the amount back to you.
  • Legal blocks and MED: court orders and MED blocks have priority over the split. If part of the amount received is blocked, the transfers wait until the full split amount is reserved.
  • Refunds: a refund of the charge is paid from your account balance and does not recover amounts already sent to the recipients.
  • Statement: each transfer appears in your statement as an outgoing Pix.

Testing in sandbox​

  1. Create a charge with a split block whose recipients are keys of another account.
  2. Simulate the payment with POST /v2/pix/mock/simulate-payment, sending the chargeId and the document of the account holder in receiverCnpj.
  3. Check the charge with GET /v2/pix/deposit/immediate-charge/{chargeId}: the status changes to PAID and the split block is returned.

See also​