API ReferencePayments
DELETE Payment
Delete payment events by transaction, visitor, or time range.
DELETE Payment
DELETE https://api.faurya.com/api/v1/payments
Delete payment events for the authenticated site. Requires Bearer Token authentication.
Request body
Send at least one filter field. Filters can be combined unless transaction_id or tx_id is provided; transaction deletion takes precedence and deletes a single matching payment.
transaction_id(string): Delete one payment by transaction ID.tx_id(string): Alias fortransaction_id.faurya_visitor_id(string): Delete payment events for a specific visitor.startAtorstartDate(string): Start of the deletion range.endAtorendDate(string): End of the deletion range.
If only one side of the time range is provided, the API uses the site creation time as the missing start or the current time as the missing end.
Response
200 OK: Matching payment events deleted.400 Bad Request: No filter was provided or the time range is invalid.401 Unauthorized: Missing or invalid API key.404 Not Found: Site, visitor, transaction, or matching payment events not found.
Delete by transaction
const response = await fetch("https://api.faurya.com/api/v1/payments", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.FAURYA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
transaction_id: "payment_456",
}),
});
const result = await response.json();Success response
{
"status": "success",
"message": "Payment event deleted",
"deleted": 1,
"transaction_id": "payment_456"
}Delete by visitor and time range
const response = await fetch("https://api.faurya.com/api/v1/payments", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.FAURYA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
faurya_visitor_id: "visitor_123",
startAt: "2026-06-01T00:00:00.000Z",
endAt: "2026-06-29T23:59:59.999Z",
}),
});
const result = await response.json();Success response
{
"status": "success",
"message": "3 payment event(s) deleted",
"deleted": 3,
"faurya_visitor_id": "visitor_123",
"timeRange": {
"start": "2026-06-01T00:00:00.000Z",
"end": "2026-06-29T23:59:59.999Z"
}
}