Pay Links
Delete Pay Link
Permanently delete a specific payment link.
DELETE
https://dev.mytpe.app/api/v2/mytpe-pay/links/{id}Permanently deletes a payment link identified by its ID.
Authentication: API Key (X-API-KEY + X-API-SECRET headers)
This API requires authentication via X-API-KEY and X-API-SECRET headers.
Rules & Restrictions
Deletion Restriction
You can ONLY delete payment links that have zero transactions.
If a payment link has any history of transactions (whether successful, pending, or failed), the system will block the deletion to preserve financial audit logs and data integrity.
Alternative: If you wish to stop a used link from accepting new payments, please use the Toggle Status endpoint to set it to inactive instead.
Path Parameters
Prop
Type
Example Request
const linkId = 'paylink_id';
const response = await fetch(
`https://dev.mytpe.app/api/v2/mytpe-pay/links/${linkId}`,
{
method: 'DELETE',
headers: {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
}
);
const data = await response.json();
console.log(data);interface DeletePayLinkResponse {
success: boolean;
message: string;
}
const linkId = 'paylink_id';
const response = await fetch(
`https://dev.mytpe.app/api/v2/mytpe-pay/links/${linkId}`,
{
method: 'DELETE',
headers: {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
}
);
const data: DeletePayLinkResponse = await response.json();
console.log(data);import requests
link_id = 'paylink_id'
headers = {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
}
response = requests.delete(
f'https://dev.mytpe.app/api/v2/mytpe-pay/links/{link_id}',
headers=headers,
)
data = response.json()
print(data)use Illuminate\Support\Facades\Http;
$linkId = 'paylink_id';
$response = Http::withHeaders([
'X-API-KEY' => 'your_api_key',
'X-API-SECRET' => 'your_api_secret',
])->delete("https://dev.mytpe.app/api/v2/mytpe-pay/links/{$linkId}");
$data = $response->json();<?php
$linkId = 'paylink_id';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.mytpe.app/api/v2/mytpe-pay/links/{$linkId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'X-API-KEY: your_api_key',
'X-API-SECRET: your_api_secret',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;const axios = require('axios');
const linkId = 'paylink_id';
axios.delete(`https://dev.mytpe.app/api/v2/mytpe-pay/links/${linkId}`, {
headers: {
'X-API-KEY': 'your_api_key',
'X-API-SECRET': 'your_api_secret',
},
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response?.data));Example Success Response (200 OK)
200 OK
{
"success": true,
"message": "Pay link deleted successfully"
}Error Responses
400 Bad Request
{
"message": "Cannot delete pay link with existing transactions."
}401 Unauthorized
{
"message": "Unauthenticated."
}404 Not Found
{
"success": false,
"message": "PAY_LINK_NOT_FOUND",
"code": 404
}