Change Status or Expiry for a Payment Link API

This API is used to update a payment link's status and expiry date.

HTTP Method: PUT

Environment

📘

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.

Request headers

ParameterDescription
mid
mandatory
String This contains the merchant identifier.
Authorization
mandatory
Bearer String This contains the client_token.

Request parameters

ParametersDescriptionExample
ID
mandatory
String This parameter must contain the payment link invoice number.INV8446471886220
dateFrom
optional
This parameter must contain the payment link creation from date.2023-04-01
dateTo
optional
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
}