Split After Transaction API

You must specify two decimal places for each split, but ensure the sum split amounts are equal to the transaction amount.

📘

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.

Request structure for var1 to be included in  payment_split API

{  "type": "absolute",  
    "payuId": "xxxxxxxx", # PayuID of parent transaction which needs to be split.  
   "splitInfo": 
    {    
       "merchantKey1": 
       {
       "aggregatorSubTxnId": "30nknyhkhib",
       "aggregatorSubAmt": "8",
       "aggregatorCharges": "2" // parent merchant commission (Optional)    
       },
      "merchantKey2":
      {
       "aggregatorSubTxnId": "13u0nknou0",
       "aggregatorSubAmt": "2"
      },
       "merchantKey3":
       {
        "aggregatorSubTxnId": "13u0nknou02",
        "aggregatorSubAmt": "2",
        "aggregatorCharges": "1" // parent merchant commission (Optional)
       }
     }
}

JSON request structure

The var1 parameter is in JSON format. The fields in the JSON format are described in the following table:

FieldDescriptionExample
typeThe type of split is specified in this field. Use absolute in this field. The absolute amount is specified for each part of the split. The absolute amount is specified in the aggregatorSubAmt field of the JSON for each child or aggregator.absolute
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.
Refer to Request Structure for var1 subsection.

Sample request

curl -X POST "https://info.payu.in/merchant/postservice?form=2"
-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d
“key=A6lB8r&command=payment_splity&var1="type":"absolute","payuId":"403993715525003544","splitInfo":{"imAJ7I":{"aggregatorSubTxnId":"CHild101","aggregatorSubAmt":"50"},"qOoYIv":{"aggregatorSubTxnId":"Child202","aggregatorSubAmt":"50"}}}&hash=6692a8b560c51e8a4bb830206d3b8fac3678fb5b08443c7590047545beba66ec97257fec11775abbc339eabbaf1b1bf5e1c50d2c6bbf67e1a69ad597480d3691"

Sample response

  • Sample response for a successful split:

When split get saved & created

{
  "status": 1,
  "message": "Splits creation successful.",
  "splitStatus": "success",
  "splitSegments": [
    {
      "merchantKey": "imAJ7I",
      "amount": 50,
      "subvention_amount": 0,
      "txnId": "CHild101",
      "additional_charges": 0,
      "transaction_fee": 50    },
    {
      "merchantKey": "qOoYIv",
      "amount": 50,
      "subvention_amount": 0,
      "txnId": "Child202",
      "additional_charges": 0,
      "transaction_fee": 50    },
  ]
}
  • Sample response when split gets saved but are not yet created:

When split get saved but aren’t yet created)

{
  "status": 2,
  "message": "Splits saved, but not created yet",
  "splitStatus": "PENDING"
}
  • Split creation is failed:

In this sample response, the error_code and error_desc parameters display based on the failure. For the list of error_codes, refer to Error Codes & Error Messages.

{
  "status": 0,
  "error_code": "AGG-107"
  "error_desc": "Invalid split payload in payment request"
}

Error codes & messages

Conditionerror_codeerror_message
Invalid request posted by merchant in var1AGG-107Invalid split payload in payment request
Invalid parent payuIdAGG-103This transaction is not a aggregator flow base transaction
Split already exists for requested PayUIdAGG-104Split info already exists for this transaction
Invalid Child merchant in split requesetAGG-102One or more child merchant-keys provided are invalid
If sum amount won’t match wrt parent transaction amountAGG-108Total amount provided in split doesn\'t match the transaction amount
If merchant is not Aggregator flow merchant.AGG-101This merchant is not an Aggregator flow merchant.
When transaction is locked in other processAGG-110Some exception occurred. Try after sometime.

📘

Note:

API integration and authentication would be the same as that for general transaction flow.