You can split after a transaction is complete using the payment_split API by percentage, where you must ensure that the sum of the percentage of all splits is equal to 100.
Note:
You must specify two decimal places for each split, but ensure the sum of the percentage of all splits is equal to 100.
HTTP Method: POST
Environment
Test Environment | <https://test.payu.in/merchant/postservice.php?form=2> |
Production Environment | <https://info.payu.in/merchant/postservice.php?form=2> |
Request parameters
Parameter | Description | Sample Value |
---|---|---|
key |
|
vDy3i7 |
command |
|
payment_split |
hash |
|
|
var1 |
|
For an example, refer the Request Structure subsection. |
JSON request structure table
Field | Description | Example |
---|---|---|
type |
The type of split is specified in this field. Specify percentage must be specified in this field for split by percentage. |
percentage |
payuid |
The payment identifier provided by PayU for the transaction. |
403993715525003544 |
splitInfo |
This parameter must include the list of aggregator sub transaction IDs and sub amounts as specified in the Request Structure for var1 subsection:
|
Request structure for var1 to be included in payment_split API
The sample JSON structure for a split request:
{
"type": "percentage",
"payuId": "xxxxxxxx", # PayuID of parent transaction which needs to be split.
"splitInfo": {
"merchantKey1": {
"aggregatorSubTxnId": "30nknyhkhib",
"aggregatorSubAmt": "53.33", // %age wrt to total payable amount
"aggregatorCharges": "13.33" // parent merchant commission (Optional) | %age wrt to total payable amount
},
"merchantKey2": {
"aggregatorSubTxnId": "13u0nknou0", //%age wrt to total payable amount
"aggregatorSubAmt": "13.33" // %age wrt to total payable amount
},
"merchantKey3": {
"aggregatorSubTxnId": "13u0nknou0",
"aggregatorSubAmt": "13.33", // %age wrt to total payable amount
"aggregatorCharges": "6.68" // parent merchant commission (Optional) | %age wrt to total payable amount
}
}
}
Sample response
Without convenience fee
{
"status": 1,
"message": "Splits creation successful.",
"splitStatus": "success",
"splitSegments": [
{
"merchantKey": "merchantKey1",
"amount": 50,
"subvention_amount": 0,
"txnId": "CHild101",
"additional_charges": 0,
"transaction_fee": 50
},
{
"merchantKey": "merchantKey2",
"amount": 50,
"subvention_amount": 0,
"txnId": "Child202",
"additional_charges": 0,
"transaction_fee": 50
}
]
}
With convenience fee
The response for Rs.100 transaction with Rs. 10 as convenience fee:
{
"status": 1,
"message": "Splits creation successful.",
"splitStatus": "success",
"splitSegments": [
{
"merchantKey": "merchantKey1",
"amount": 40,
"subvention_amount": 0,
"txnId": "T1",
"additionalCharges": 0,
"transaction_fee": 40
},
{
"merchantKey": "merchantKey2",
"amount": 60,
"subvention_amount": 0,
"txnId": "T1",
"additionalCharges": 0,
"transaction_fee": 60
},
{
"merchantKey": "parentMerchantKey",
"amount": 10,
"subvention_amount": 0,
"txnId": "T",
"additionalCharges": 10,
"transaction_fee": 0
}
]
}