Split by Percentage During Transaction

You can split during a transaction made using _payment API by percentage, where you must ensure that the sum of percentage of all splits is equal to 100.

📘

Note:

You must specify two decimal places for each split, but ensure the sum of percentage of all splits is equal to 100.

HTTP Method: POST

Environment

splitRequest parameter to be included with _payment API

The _payment API includes the parameters listed in the Collect Payment API - Merchant Hosted Checkout. In addition, the splitRequest parameter is required for splitting the transactions.

Sample JSON for var1

{
  "type": "percentage",
  "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
    }
  }
}

JSON fields in var1

The following fields are included in the splitRequest parameter in a JSON format to specify the split by percentage details. The fields in the JSON format are described in the following table:

FieldDescriptionExample
type
mandatory
string Specify the percentage type of split in this field. The percentage of the amount is specified for each part of the split. The percentage of the amount is specified in the aggregatorSubAmt field of the JSON for each child or aggregator.percentage
splitInfo
mandatory
JSON This parameter must include the list of aggregator sub transaction IDs and sub amounts. Refer the Sample subsection of this section.

Sample response

TDR model

The formatted response for the above sample request is similar to the following:

Array
(
    [mihpayid] => 41**45678912383977
    [mode] => CC
    [status] => success
    [unmappedstatus] => captured
    [key] => Ax4j7J
    [txnid] => 9a70ea0155268101001b
    [amount] => 100.00
    [cardCategory] => domestic
    [discount] => 0.00
    [net_amount_debit] => 100
    [addedon] => 2021-12-22 19:02:15
    [productinfo] => Product Info
    [firstname] => Payu-Admin
    [lastname] => 
    [address1] => 
    [address2] => 
    [city] => 
    [state] => 
    [country] => 
    [zipcode] => 
    [email] => [email protected]
    [phone] => 1234567890
    [udf1] => 
    [udf2] => 
    [udf3] => 
    [udf4] => 
    [udf5] => 
    [udf6] => 
    [udf7] => 
    [udf8] => 
    [udf9] => 
    [udf10] => 
    [hash] => 6e700275583072c0361bac771a4166a4be5334112d59e40181c5668895c477a047c7be250068186fd26ca72928d7e168f92bb96003a7fffbf4933bb818f4c48a
    [field1] => 5582299554914671900181
    [field2] => 113476
    [field3] => 100.00
    [field4] => 41**45678912383977
    [field5] => 100
    [field6] => 02
    [field7] => AUTHPOSITIVE
    [field8] => 
    [field9] => Transaction is Successful
    [payment_source] => payu
    [PG_TYPE] => AxisCYBER
    [bank_ref_num] => 5582299554914671900181
    [bankcode] => CC
    [error] => E000
    [error_Message] => No Error
    [name_on_card] => Test User
    [cardnum] => 512345XXXXXX2346
    [cardhash] => This field is no longer supported in postback params.
    [splitInfo] => {"splitStatus":"success","splitSegments":[{"merchantKey":"P41sCY","amount":50,"subvention_amount":0,"txnId":"9a70ea0155268101001ba"},{"merchantKey":"P41sCK","amount":30,"subvention_amount":0,"txnId":"9a70ea0155268101001bb"},{"merchantKey":"sd3fsmr","amount":20,"subvention_amount":0,"txnId":"9a70ea0155268101001b"}]}
)

Convenience fee model

The formatted response for the above sample request is similar to the following:

Array
(
    [mihpayid] => 41**45678912383977
    [mode] => CC
    [status] => success
    [unmappedstatus] => captured
    [key] => Ax4j7J
    [txnid] => 9a70ea0155268101001b
    [amount] => 110.00
    [cardCategory] => domestic
    [discount] => 0.00
    [net_amount_debit] => 110
    [addedon] => 2021-12-22 19:02:15
    [productinfo] => Product Info
    [firstname] => Payu-Admin
    [lastname] => 
    [address1] => 
    [address2] => 
    [city] => 
    [state] => 
    [country] => 
    [zipcode] => 
    [email] => [email protected]
    [phone] => 1234567890
    [udf1] => 
    [udf2] => 
    [udf3] => 
    [udf4] => 
    [udf5] => 
    [udf6] => 
    [udf7] => 
    [udf8] => 
    [udf9] => 
    [udf10] => 
    [hash] => 6e700275583072c0361bac771a4166a4be5334112d59e40181c5668895c477a047c7be250068186fd26ca72928d7e168f92bb96003a7fffbf4933bb818f4c48a
    [field1] => 5582299554914671900181
    [field2] => 113476
    [field3] => 110.00
    [field4] => 41**45678912383977
    [field5] => 100
    [field6] => 02
    [field7] => AUTHPOSITIVE
    [field8] => 
    [field9] => Transaction is Successful
    [payment_source] => payu
    [PG_TYPE] => AxisCYBER
    [bank_ref_num] => 5582299554914671900181
    [bankcode] => CC
    [error] => E000
    [error_Message] => No Error
    [name_on_card] => Test User
    [cardnum] => 512345XXXXXX2346
    [cardhash] => This field is no longer supported in postback params.
    [splitInfo] => {"splitStatus":"success","splitSegments":[
				{"merchantKey":"P41sCY","amount":50,"subvention_amount":0,"txnId":"9a70ea0155268101001ba, “discount":0,"additionalCharges":0,”transaction_fee":0”},
				{"merchantKey":"P41sCK","amount":30,"subvention_amount":0,"txnId":"9a70ea0155268101001bb, “discount”:0,"additionalCharges":0,"transaction_fee":0"}
				,{"merchantKey":"sd3fsmr","amount":20,"subvention_amount":0,"txnId":"9a70ea0155268101001b, “discount”:0,"additionalCharges":10,"transaction_fee":0"}
				]
   			}
)