This API is used to update a payment link's status and expiry date.
HTTP Method: PUT
Environment
Test Environment | https://uatoneapi.payu.in/payment-links |
Production Environment | https://oneapi.payu.in/payment-links |
Note:
The access token with the scope as update_payment_links is required on the header. For more information on getting the access token, refer to Get Token API - Payment Links.
Request headers
Parameter | Description |
---|---|
mid mandatory | String This contains the merchant identifier. |
Authorization mandatory | Bearer String This contains the client_token. For more information, refer to Get Token API - Payment Links . |
Request parameters
Parameters | Description | Example |
---|---|---|
IDmandatory | String This parameter must contain the payment link invoice number. | INV8446471886220 |
dateFromoptional | This parameter must contain the payment link creation from date. | 2023-04-01 |
dateTooptional | This parameter must contain the payment link creation to date. | 2023-04-06 |
The request parameters will include the payment link invoice number, and the API command will consist of the data-raw to update the expiry date or status similar to the following:
data-raw '{
"expiry":"2022-03-21 16:12:12"
}'
Sample request
curl --location -g --request PUT '{{baseUrl}}/payment-links/INV8446471886220' \
--header 'merchantId: {{merchantId}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--data-raw '{
"expiry":"2022-03-21 16:12:12"
}'
Sample response
Success scenario
{
"status": 0,
"message": "paymentLink updated",
"result": null,
"errorCode": null,
"guid": null
}
Failure scenario
{
"status": -1,
"message": "expiry cannot be less than the current date",
"result": null,
"errorCode": null,
"guid": null
}