post https://test.payu.in/merchant/postservice
The UDF Update API is used to update the UDF1-UDF5 values of a transaction. UDFs are the user-defined fields which are posted from the merchant to PayU. This API is specifically used to update the values in these fields in the PayU database. The return parameters are the updated UDF values of the transaction.
Environment
Test Environment | https://test.payu.in/merchant/postservice?form=2 |
Production Environment | https://info.payu.in/merchant/postservice?form=2 |
Reference info for request parameters
Parameter | Reference |
---|---|
key | The merchant key provided by PayU while onboarding. For more information on how to generate the Key and Salt, refer to any of the following: - Production: Generate Merchant Key and Salt - Test: Generate Test Merchant Key and Salt | |
hash | Hash logic for _payment API is:sha512(key|command|var1|salt)
sha512 |
Sample request for Cards
curl --location --globoff 'https://test.payu.in/merchant/postservice.php?form=2' \
--form 'key="PRiQvJ"' \
--form 'command="udf_update"' \
--form 'var1="my_order_642"' \
--form 'var2="AAAPZ1234C"' \
--form 'var4="22/08/1972"' \
--form 'var5="SellerName"' \
--form 'var6="INV000000005"' \
--form 'hash="{{hash}}"'
}
Sample request for UPI autopay
curl --location --globoff 'https://test.payu.in/merchant/postservice.php?form=2' \
--form 'key="PRiQvJ"' \
--form 'command="udf_update"' \
--form 'var1="my_order_64240"' \
--form 'var2="AAAPZ1234C||22/08/1972"' \
--form 'var4="INV-123_1231||MerchantName"' \
--form 'hash="{{hash}}"'
Sample response
Success Scenario
- If successfully updated for cards
{
"status": "UDF values updated",
"transaction_id": "my_order_64240",
"udf1": "AAAPZ1234C",
"udf2": "",
"udf3": "22/08/1972",
"udf4": "SellerName",
"udf5": "INV000000005"
}
- If successfully updated for UPI autopay:
{
"status": "UDF values updated",
"transaction_id": "my_order_64240",
"udf1": "AAAPZ1234C",
"udf2": "",
"udf3": "22/08/1972",
"udf4": "SellerName",
"udf5": "INV000000005"
}
Failure Scenarios
- If the transaction ID is empty
(
[status] => 0
[msg] => Parameter missing
)
- If the transaction ID is invalid
(
[status] => 0
[msg] => Invalid TXN ID
)
- If Hash is invalid:
{
"status": 0,
"msg": "Invalid Hash."
}