Skip to main content

Billing with Split

The split was created with the objective of automatically transferring the values of a transaction between several receiving partners with the rules established by our client.

Creating a charge with Split

A Split configuration contains one or more rules that define commission rates and conditions when the rate applies.

To create a split transaction, just add the splitRules field that will represent the rules for that charge, within the body of the request creating a transaction.

Split rules

Each rule (splitRules) in a split configuration must have:

  • Recipient Identifier (sellerId): The ID value inside splitRules must match the ID generated in seller creation.

  • Percentage: percentage of the original transaction amount that will be sent to the recipient.

  • Amount: amount that will be sent to the recipient.

  • Processing Fee: recipient will be charged processing fees, which will be deducted from their balance, set to false for marketplace discount.

  • Liable flag : recipient will be responsible for the refund (chargeback), which will be deducted from their balance, set to false for marketplace discount.

Billing example with approved Split

curl -X POST 'https://api.malga.io/v1/charges' \
--header 'X-Client-Id: <YOUR_CLIENT_ID>' \
--header 'X-Api-Key: <YOUR_SECRET_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"merchantId": "7f8870a2-71c9-4ef0-a531-82000e00b7e1",
"amount": 150,
"currency": "BRL",
"statementDescriptor": "Pedido #231 loja joão",
"capture": false,
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"paymentSource": {
"sourceType": "card",
"card": {
"cardNumber": "4929564637987814",
"cardCvv": "320",
"cardExpirationDate": "06/2028",
"cardHolderName": "JOAO DA SILVA"
}
},
"splitRules": [
{
"sellerId": "5323ece6-816d-11ed-a1eb-0242ac120002",
"percentage": 90,
"processingFee": true,
"liable": true,
},
{
"sellerId": "616605b2-816f-11ed-a1eb-0242ac120002",
"percentage": 10,
"processingFee": false,
"liable": false,
}
]
}'

< HTTP/2 201 < content-type: application/json; charset=utf-8

{
"merchantId": "46b433bf-79aa-4cb1-9eaa-cdaea42cb955",
"amount": 100,
"currency": "BRL",
"statementDescriptor": "Pedido #231 loja joão",
"capture": false,
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"paymentSource": {
"sourceType": "card",
"card": {
"cardHolderName": "JOSE DAS NEVES",
"cardNumber": "4929564637987814",
"cardCvv": "120",
"cardExpirationDate": "12/2026"
}
},
"fraudAnalysis": {
"customer": {
"name": "Jose Bonifacio Da Silveira",
"phone": "21 98889999099",
"email": "jose@gmail.com",
"identity": "02960069048",
"identityType": "CPF",
"billingAddress": {
"street": "Rua 129",
"number": "30",
"zipCode": "61936320",
"country": "BR",
"state": "CE",
"district": "Timbó",
"city": "Maracanaú",
"complement": "teste"
}
},
"cart": {
"items": [
{
"name": "Teste",
"sku": "Teste",
"risk": "Low",
"unitPrice": 1,
"quantity": 1
}
]
}
},
"splitRules": [{
"sellerId": "5323ece6-816d-11ed-a1eb-0242ac120002",
"percentage": 90,
"processingFee": true,
"liable": true,
}]
}