Split by Percentage after Transaction

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

Request parameters

ParameterDescriptionSample Value
keystring This parameter must include the Merchant key that was provided by PayU.vDy3i7
commandstring The parameter must contain the name of the web service.payment_split
hashString The hash string encryption is specified in this parameter. The format of the hash is:
|sha512(key|command|var1|salt)
Where, var1 contains the fields as described in the var1 description.
Β 
var1string (JSON) This parameter is in a JSON format and fields included in the JSON format are explained the JSON request structure table.For an example, refer the Request Structure subsection.

JSON request structure table

FieldDescriptionExample
typeThe type of split is specified in this field. Specify percentage must be specified in this field for split by percentage.percentage
payuidThe payment identifier provided by PayU for the transaction.403993715525003544
splitInfoThis parameter must include the list of aggregator sub transaction IDs and sub amounts as specified in the Request Structure for var1 subsection:

- aggregatorSubTxnId: The aggregator sub transaction ID is specified in this field.
- aggregatorSubAmt: The aggregator sub amount is specified in this field.
- aggregatorCharges: The aggregator charges is specified in this field.
Note: The aggregatorCharges field can only be used by parent merchant to get the aggregator commission.

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
    }
  ]
}