Delete a link
Delete a link that has never taken a payment.
Only a link that has never had a payment can be deleted, so no payment loses its link. Archive any other link instead.
Path
idstring RequiredThe link's ID, such aslnk_tDofQnHNbxq9jsyq.
Errors
- 404
not_foundNo link with that ID belongs to your business. - 409
link_has_paymentsThe link has payments. Archive it instead.
Any request can also fail on its key or its body. See errors.
Request
curl -X DELETE "https://api.402pay.co/api/v1/links/lnk_tDofQnHNbxq9jsyq" \
-H "Authorization: Bearer $PAY402_SECRET_KEY"const response = await fetch("https://api.402pay.co/api/v1/links/lnk_tDofQnHNbxq9jsyq", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.PAY402_SECRET_KEY}`,
},
});
const { data } = await response.json();import os
import requests
response = requests.delete(
"https://api.402pay.co/api/v1/links/lnk_tDofQnHNbxq9jsyq",
headers={
"Authorization": f"Bearer {os.environ['PAY402_SECRET_KEY']}",
},
)
data = response.json()["data"]Response200 OK
{
"data": {
"id": "lnk_tDofQnHNbxq9jsyq",
"kind": "link",
"deleted": true
}
}