> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cable.tech/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cable.tech/_mcp/server.

# Submit a deletion request for a transaction and any related data

DELETE https://api.cable.tech/v2/transaction
Content-Type: application/json

This operation will submit a request to delete the transaction and any
related data.The deletion request will be processed by the system and
the data will be removed permanently from Cable's system. Deletion
requests are not processed immediately and may take some time to
complete.The status of the deletion request can be checked using the
deletion request ID and the status endpoint.This operation is not intended for regular use and should be used with caution.

Reference: https://docs.cable.tech/api-documentation/api-reference/transactions/delete-transaction

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an object.

- `tx_id` (string, required) — The unique identifier of the transaction
- `reason` (string, required) — The reason for deletion

## Response

### 200

Deletion request submitted successfully

- `tx_id` (string, optional) — The unique identifier of the transaction
- `deletion_request_id` (string, optional) — The unique identifier of the deletion request

## Errors

### 401 Unauthorized Error

Unauthorized request

- `code` (integer, required)
- `message` (string, required)
- `errors` (list of GeneralErrorErrorsItems, optional) — Detailed information about errors in specific fields.

### 404 Not Found Error

Person does not exist

- `code` (integer, required)
- `message` (string, required)
- `errors` (list of GeneralErrorErrorsItems, optional) — Detailed information about errors in specific fields.

### 429 Too Many Requests Error

Rate limit exceeded

- `code` (integer, required)
- `message` (string, required)
- `errors` (list of GeneralErrorErrorsItems, optional) — Detailed information about errors in specific fields.

### 500 Internal Server Error

Server error

- `code` (integer, required)
- `message` (string, required)
- `errors` (list of GeneralErrorErrorsItems, optional) — Detailed information about errors in specific fields.

## Types

### GeneralErrorErrorsItems

- `field` (string, optional)
- `message` (string, optional)

## Examples

**Request**

```json
{
  "tx_id": "a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01",
  "reason": "Duplicate transaction entry detected"
}
```

**Response**

```json
{
  "tx_id": "a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01",
  "deletion_request_id": "d4e5f6a7-b8c9-40d1-9e2f-3a4b5c6d7e8f"
}
```

**SDK Code**

```python
import requests

url = "https://api.cable.tech/v2/transaction"

payload = {
    "tx_id": "a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01",
    "reason": "Duplicate transaction entry detected"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.cable.tech/v2/transaction';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"tx_id":"a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01","reason":"Duplicate transaction entry detected"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.cable.tech/v2/transaction"

	payload := strings.NewReader("{\n  \"tx_id\": \"a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01\",\n  \"reason\": \"Duplicate transaction entry detected\"\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cable.tech/v2/transaction")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"tx_id\": \"a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01\",\n  \"reason\": \"Duplicate transaction entry detected\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.cable.tech/v2/transaction")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"tx_id\": \"a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01\",\n  \"reason\": \"Duplicate transaction entry detected\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.cable.tech/v2/transaction', [
  'body' => '{
  "tx_id": "a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01",
  "reason": "Duplicate transaction entry detected"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cable.tech/v2/transaction");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"tx_id\": \"a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01\",\n  \"reason\": \"Duplicate transaction entry detected\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "tx_id": "a3f1c9e2-7b4d-4f8a-9d2e-5b6c7d8e9f01",
  "reason": "Duplicate transaction entry detected"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cable.tech/v2/transaction")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```