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.
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
- Create the charge with a split: send the optional
splitblock with the share of each recipient. The charge is validated and created as usual; thesplitblock is echoed in the response and inGET /v2/pix/deposit/immediate-charge/{chargeId}. - Payer pays the charge: the Pix is credited to your account normally.
- 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.
- 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.
- 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.
| Field | Description |
|---|---|
split.type | FIXED (each share is an amount in centavos) or PERCENT (each share is a percentage of the charge amount). Case-insensitive. |
split.recipients | From 1 to 10 recipients. |
recipients[].pixKey | Pix key of the recipient: CPF, CNPJ, email, phone or random key (EVP), up to 77 characters. |
recipients[].amountSplit | FIXED: integer amount in centavos. PERCENT: percentage greater than 0 with up to 2 decimal places. |
Business rules to plan around
| Rule | Value |
|---|---|
| Base of the calculation | The gross amount of the charge |
| Total distributed | Up to 100% of the charge (PERCENT up to 100; FIXED up to amount) |
| Recipients per charge | 1 to 10 |
| Repeated recipients | The same Pix key cannot appear twice, and cannot be the pixKey of the charge itself |
| Recipient account | Must 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 share | A 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.
| HTTP | Type | Reason |
|---|---|---|
| 422 | SPLIT_NOT_ELIGIBLE | The account is not enabled for split |
| 422 | SPLIT_INVALID_TYPE | split.type is not PERCENT or FIXED |
| 422 | SPLIT_EMPTY_RECIPIENTS | split.recipients is empty |
| 422 | SPLIT_TOO_MANY_RECIPIENTS | More than 10 recipients |
| 422 | SPLIT_INVALID_PIX_KEY | A recipient key is not a valid CPF, CNPJ, email, phone or EVP |
| 422 | SPLIT_INVALID_AMOUNT | A share is not a positive number in the expected precision, or rounds down to 0 centavos |
| 422 | SPLIT_AMOUNT_EXCEEDS_TOTAL | The sum of FIXED shares exceeds the charge amount |
| 422 | SPLIT_PERCENT_EXCEEDS_100 | The sum of PERCENT shares exceeds 100 |
| 422 | SPLIT_DUPLICATE_RECIPIENT | A key appears more than once, or matches the charge pixKey |
| 503 | SPLIT_ELIGIBILITY_UNAVAILABLE | Eligibility 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
- Create a charge with a
splitblock whose recipients are keys of another account. - Simulate the payment with
POST /v2/pix/mock/simulate-payment, sending thechargeIdand the document of the account holder inreceiverCnpj. - Check the charge with
GET /v2/pix/deposit/immediate-charge/{chargeId}: the status changes toPAIDand thesplitblock is returned.