Delete Payment
curl --request DELETE \
--url https://api.example.com/wp-json/latepoint-api/v1/payments/{id}import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/wp-json/latepoint-api/v1/payments/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Payment not found"
}
Payments
Delete Payment
Delete a payment transaction.
DELETE
/
wp-json
/
latepoint-api
/
v1
/
payments
/
{id}
Delete Payment
curl --request DELETE \
--url https://api.example.com/wp-json/latepoint-api/v1/payments/{id}import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/wp-json/latepoint-api/v1/payments/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Payment not found"
}
Path Parameters
integer
required
The unique identifier of the payment to delete
Example Request
DELETE /wp-json/latepoint-api/v1/payments/1
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Example Response
{
"success": true,
"message": "Payment deleted successfully"
}
Error Responses
{
"success": false,
"error": "Payment not found"
}
{
"success": false,
"error": "Cannot delete payment with completed status. Please refund first."
}
{
"success": false,
"error": "Failed to delete payment"
}
Important Notes
Deleting a payment is a permanent action and cannot be undone. Consider using the update endpoint to change the status to “cancelled” or “refunded” instead of deleting the record entirely.
Some payment processors may not allow deletion of completed transactions. In such cases, you should use the refund functionality instead.
⌘I
