The Get Split Info API is used for getting split info of the parent transaction in the aggregator flow.
Environment
Test Environment | https://test.payu.in/merchant/postservice?form=2 |
Production Environment | https://info.payu.in/merchant/postservice?form=2 |
Request parameters
The request body contains the following parameters:
Params | Description | Example |
---|---|---|
keymandatory | Merchant key provided by PayU | JPM***g |
commandmandatory | This parameter must contain the API Command for getting Transaction. It should be get_split_info for Get Split Info API. | |
var1mandatory | This parameter must contain the PayU ID | 403993715532325577 |
hashmandatory | This parameter must contain the hash value to be calculated at your end. Hash logic for this API is: sha512(key|command|payuId|salt)
sha512 |
Sample request
curl --location 'https://test.payu.in/merchant/postservice.php?form=1' \
--header 'Cookie: PHPSESSID=j601h8g2u1cofo4u5it8v1lk8r; PHPSESSID=670cf11080b74' \
--form 'key="JPM***g"' \
--form 'command="get_split_info"' \
--form 'var1="403993715532325577"' \
--form 'hash="49fa996d81f66374fbe2eedfc494b48149f1abb9555afa0b0c03d671d7a769efd07e40eabee6571fba124966b1a2d219b8118ff9500456effb1e0ae63d94a3e2"' \
Response parameters
Parameter | Description | Example |
---|---|---|
status | This parameter returns the status of web service call. The status can be any of the following: 0 - If web service call failed. 1 - If web service call succeeded | 0 |
payuId | This parameter returns the parent merchant PayU ID that was posted in the API request. | 403993715532325577 |
splitStatus | This parameter returns the reason string. For a list of error codes for failure scenarios, refer to Error codes for failure scenario | success |
splits | This parameter contains the response in a JSON array format. Each JSON object contains the following: - merchant key - aggregator sub-transaction ID - amount - Transaction_details field. | { "merchantKey": "iC***G", "aggregatorSubTxnId": "dkjgfrfgnfm", "amount": 900.00, "splitType": "split" } |
Sample response
Success scenariro
{
"status": 1,
"payuId": 403993715532325577,
"splitStatus": "success",
"splits": [
{
"merchantKey": "iC***G",
"aggregatorSubTxnId": "dkjgfrfgnfm",
"amount": 900.00,
"splitType": "split"
},
{
"merchantKey": "ut***U",
"aggregatorSubTxnId": "dkfhdgfcdcddfn",
"amount": 100.00,
"splitType": "commission"
}
]
}
Error codes for failure scenario
Condition | error_code | error_message |
---|---|---|
Hash validation failed | AGG-300 | Hash validation failed |
invalid parent transaction Payu ID: - non-existent PayuID - PayuID is not a parent transaction of aggregator flow - Payu ID belongs to some other merchant. | AGG-301 | Invalid PayuID |
Split doesn’t exist for the transaction | AGG-302 | Split doesn't exist for this transaction |