Cancel Payment Link


Use the Cancel Payment Link API to deactivate an active payment link that is no longer required. This helps ensure that customers can’t make payments through outdated or invalid links. Once cancelled, the link becomes inactive and cannot be used for further transactions.

EnvironmentHTTP MethodAPI
SandboxPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox/paylinks/v1/{merchantOrderId}/cancel
ProductionPOSThttps://api.phonepe.com/apis/pg/paylinks/v1/{merchantOrderId}/cancel
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>

⚠️ For Partner Integrations!


It is mandatory to include the X-MERCHANT-ID header with the MerchantID of the end merchant.

Case 1: Response for Payment Link cancelled Successfully
{  
    "orderId": "OMOxx",
    "state": "CANCELLED"
}
Case 2: Response for Payment Link already in Terminal State.
{  
    "code": "BAD_REQUEST",
    "message": "Please check the inputs you have provided. [already in terminal state]"
}
Response Parameters
EnvironmentTypeDescription
orderIdStringPayment Gateway generated internal order ID.
stateStringDefines the State of the Payment Link as Cancelled.
Error Response Parameters
EnvironmentTypeDescription
codeStringError Code
messageStringError Description
headers
url params

Now that you have learnt on how to cancel the created payment link. Now let’s proceed to understand how the payment link can be shared with customers through various communication channels such as SMS, email services.

Is this article helpful?