You can configure webhooks using PayU Dashboard too. For more information, check PayU Dashboard. This section describes how to configure the webhook URL using API.
| Parameter | Description | Example |
|---|
Authorization
mandatory | String Specify the access token generated earlier in this parameter. | Bearer {access_token} |
payoutMerchantId
mandatory | String Specify the payout merchant id provided while onboarding or creating Payout account. | 1111126 |
Content-Type
mandatory | String Indicates the format in which the request is sent. | application/json |
📘The pid is payoutMerchantId, however it is different from the PayU merchant id. Check the Payouts Dashboard or call the PayU Customer Support if you don’t know your payoutsMerchantID.
| Parameter | Description | Example |
|---|
webhook
mandatory | Configure the webhooks for different type of events. | transfer_reversed |
values.url
mandatory | This is the post URL of the API where the merchant will listen to PayU events. In other words, this is the webhook URL. | |
values.authorization
optional | Merchant can provide this value which will be sent in the header while pushing the payouts event to the merchant.Using this merchant can authenticate that request is coming from PayU. | ## |
curl --location 'https://uatoneapi.payu.in/payout/v2/webhook' \
--header 'payoutMerchantId: 2xxx79' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 2a641dc44dc488360xxxxxxxxxx19292bce79d341169b67a' \
--data '[
{
"webhook" :"default",
"values": {
"url":"https://webhook/443cc175-9aab-44c56d-33157a71cb63",
"authorization":"asjafya56%^eyy63547ysrt4"
}
}
]'
📘
- You ned to whitelist PayU for a server call to your webhook API.
- Set Webhook API that you had created should be of type as POST
{
"status": 0,
"msg": "Webhook saved successfully",
"code": null,
"data": null
}
{
"status": 1,
"msg": "Webhook url is invalid",
"code": 20407,
"data": null
}