Split Payments
Learn how to split payments between your marketplace and your Sub-Accounts when you accept payments.
Create a split payment
There’s the possibility to automatically split, or divide, the total amount of the payment between the Marketplace Main Account and the Sub-Account. The user will be charged in one payment, and dLocal will make the appropriate transfers between the different accounts.
The split can be made between multiple Sub-Accounts, not only between the Marketplace Main Account and one unique Sub-Account.
Refunds and chargebacks will use the same split information sent in the payment creation.
Information request
To split a payment, the following object must be included in the request.
Body Parameter | Type | Required | Description |
---|---|---|---|
splits | List | ||
amount | Number | Yes | Amount of the split in the currency of the payment. |
account_id | String | Yes | Merchant ID of the destination account. |
type | String | Yes | Commission or Sale. |
Example request
curl -X POST \
-H 'X-Date: 2018-02-20T15:44:42.310Z' \
-H 'X-Login: sak223k2wdksdl2' \
-H 'X-Trans-Key: fm12O7G9' \
-H 'Content-Type: application/json' \
-H 'X-Version: 2.1' \
-H 'User-Agent: MerchantTest / 1.0 ' \
-H 'Authorization: V2-HMAC-SHA256, Signature: 1bd227f9d892a7f4581b998c21e353b1686a6bdad5940e7bb6aa596c96e0a6ec' \
-d '{body}'
https://api.dlocal.com/payments
{
"amount": 120.00,
"currency" : "BRL",
"country": "BR",
"payment_method_id" : "CARD",
"payment_method_flow" : "DIRECT",
"payer":{
"name" : "Thiago Gabriel",
"email" : "[email protected]",
"document" : "53033315550",
"user_reference": "12345",
"address": {
"state" : "Rio de Janeiro",
"city" : "Volta Redonda",
"zip_code" : "27275-595",
"street" : "Servidao B-1",
"number" : "1106"
}
},
"card":{
"holder_name" : "Thiago Gabriel",
"number" : "4111111111111111",
"cvv" : "123",
"expiration_month" : 10,
"expiration_year" : 2040
},
"order_id": "657434343",
"notification_url": "http://merchant.com/notifications",
"splits":[
{
"account_id": "d907f733-5e17-4470-b963-165ktbkdkrk23",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "d8977365-5e17-4470-b963-c2ac2c11a440",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "afg89902-5e17-4470-b963-5jt70vgj3450",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "afg89902-5e17-4470-b963-452ac2c11a477",
"amount": 15.00,
"type": "commission"
}
]
}
Synchronous Response
{
"id": "D-4-80ca7fbd-67ad-444a-aa88-791ca4a0c2b2",
"amount": 120.00,
"currency" : "BRL",
"country": "BR",
"payment_method_id" : "CARD",
"payment_method_flow" : "DIRECT",
"payer":{
"name" : "Thiago Gabriel",
"email" : "[email protected]",
"document" : "53033315550",
"user_reference": "12345",
"address": {
"state" : "Rio de Janeiro",
"city" : "Volta Redonda",
"zip_code" : "27275-595",
"street" : "Servidao B-1",
"number" : "1106"
}
},
"card": {
"holder_name": "Thiago Gabriel",
"expiration_month": 10,
"expiration_year": 2040,
"brand": "VI",
"last4": "1111"
},
"order_id": "657434343",
"status": "PAID",
"notification_url": "http://merchant.com/notifications",
"splits":[
{
"account_id": "d907f733-5e17-4470-b963-165ktbkdkrk23",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "d8977365-5e17-4470-b963-c2ac2c11a440",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "afg89902-5e17-4470-b963-5jt70vgj3450",
"amount": 35.00,
"type": "sale"
},
{
"account_id": "afg89902-5e17-4470-b963-452ac2c11a477",
"amount": 15.00,
"type": "commission"
}
]
}
Updated 10 months ago