Delete Payment Link


Merchant sends HTTP API request to this endpoint with the specified Order ID to delete the Payment Link. Useful to deactivate some specific Payment Links when merchant no longer want Customer to pay for it.


Request


Endpoints: /v1/payment-links/{order_id}
HTTP Method: DELETE

Headers:

Accept: application/json
Content-Type: application/json
Authorization: Basic AUTH_STRING
Authorization AUTH_STRING value is result of Base64Encode("YourServerKey"+":")

Midtrans API validates HTTP request by using Basic Authentication method. The username is your Server Key while the password is empty. The authorization header value is represented by AUTH_STRING. AUTH_STRING is base-64 encoded string of your username and password separated by colon symbol (:).


Sample Request including Headers & Body


curl --location --request DELETE 'https://api.sandbox.midtrans.com/v1/payment-links/1525840754698' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic AuthKeyXXXX'



Response


For successful response you will receive HTTP status code 2xx as a response. For failure response you may receive HTTP status code 4xx or 5xx.


Sample Success Response


HTTP Status Code: 200

{
   "message": "Payment Link with Order ID 1525840754698-1647594290 deleted"
}
Status Code Descriptions
200 Request is successful
404 Not Found
401 Access denied due to unauthorized request
500 Internal Server Error

Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!