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

# Deal aktualisieren

POST https://api.trackleads.io/api/v1/transactions/update
Content-Type: application/json

Aktualisiert einen Deal über seine `transaction_id`. Sende nur die Felder, die sich ändern sollen. Neben `transaction_id` muss mindestens ein weiteres Feld enthalten sein.

Reference: https://docs.trackleads.io/api/referenz/deals/update-transaction

## Authentication

- `X-API-Key` header (required) — API-Key des Business. Alternativ als `Authorization: Bearer <key>`.

## Request

### Body (application/json)

This endpoint expects a TransactionUpdate.

- `transaction_id` (string, required) — Die Kennung aus dem Create-Aufruf oder die Kennung einer Rate aus der Create-Antwort.
- `amount` (double, optional) — Neuer Betrag in EUR. Bei Raten gesperrt.
- `date` (date, optional)
- `product` (string, optional)
- `tags` (list of string, optional)
- `name` (string, optional)
- `employee_setter` (string, optional)
- `employee_closer` (string, optional)
- `pending` (boolean, optional) — `false` markiert eine Zahlung als abgeschlossen, zum Beispiel eine bezahlte Rate.
- `cancelled` (boolean, optional) — `true` storniert den Deal und ist auch die Semantik für eine Erstattung. Auf dem Hauptdeal eines Zahlungsplans werden alle Raten mit storniert.
- `payment_abort` (boolean, optional) — Markiert die Zahlung als fehlgeschlagen oder abgebrochen.
- `cancel_unpaid_rates` (boolean, optional) — Kündigt einen Zahlungsplan und behält bezahlte Raten als Umsatz. Darf nur allein gesendet werden.
- `email` (string, optional) — Verknüpft den Deal mit einem anderen bestehenden Lead.
- `phone` (string, optional) — Verknüpft den Deal mit einem anderen bestehenden Lead.
- `custom_id` (string, optional) — Verknüpft den Deal mit einem anderen bestehenden Lead.

## Response

### 200

Der Deal wurde aktualisiert.

- `ok` (boolean, optional)
- `transaction_id` (string, optional)
- `cancelled` (boolean, optional)
- `plan` (TransactionUpdateResponsePlan, optional) — Nur nach `cancel_unpaid_rates`.

## Errors

### 401 Unauthorized Error

API-Key fehlt oder ist ungültig.

- `ok` (boolean, optional)
- `error` (enum, optional)
  - Allowed values: `API_KEY_MISSING`, `API_KEY_INVALID`

### 422 Unprocessable Entity Error

Validierung fehlgeschlagen, zum Beispiel "Lead not found", eine doppelte `transaction_id` oder ein unbekannter Status.

- `message` (string, optional)
- `errors` (map from string to list of string, optional)

### 429 Too Many Requests Error

Rate-Limit überschritten. Warte die Sekunden aus dem Header `Retry-After` ab.

- `any`

## Types

### TransactionUpdateResponsePlan

Nur nach `cancel_unpaid_rates`.

- `cancelled_rates` (integer, optional)
- `paid_rates_kept` (integer, optional)
- `amount` (double, optional) — Verbleibender Wert des Deals.
- `fully_cancelled` (boolean, optional)

## Examples

### Rate bezahlt

**Request**

```json
{
  "transaction_id": "C3D4E5F6",
  "date": "2026-12-15",
  "pending": false
}
```

**Response**

```json
{
  "ok": true,
  "transaction_id": "C3D4E5F6",
  "cancelled": false
}
```

**SDK Code**

```python Rate bezahlt
import requests

url = "https://api.trackleads.io/api/v1/transactions/update"

payload = {
    "transaction_id": "C3D4E5F6",
    "date": "2026-12-15",
    "pending": False
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Rate bezahlt
const url = 'https://api.trackleads.io/api/v1/transactions/update';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"transaction_id":"C3D4E5F6","date":"2026-12-15","pending":false}'
};

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

```go Rate bezahlt
package main

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

func main() {

	url := "https://api.trackleads.io/api/v1/transactions/update"

	payload := strings.NewReader("{\n  \"transaction_id\": \"C3D4E5F6\",\n  \"date\": \"2026-12-15\",\n  \"pending\": false\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Rate bezahlt
require 'uri'
require 'net/http'

url = URI("https://api.trackleads.io/api/v1/transactions/update")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"transaction_id\": \"C3D4E5F6\",\n  \"date\": \"2026-12-15\",\n  \"pending\": false\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.trackleads.io/api/v1/transactions/update")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"transaction_id\": \"C3D4E5F6\",\n  \"date\": \"2026-12-15\",\n  \"pending\": false\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.trackleads.io/api/v1/transactions/update', [
  'body' => '{
  "transaction_id": "C3D4E5F6",
  "date": "2026-12-15",
  "pending": false
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Rate bezahlt
using RestSharp;

var client = new RestClient("https://api.trackleads.io/api/v1/transactions/update");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"transaction_id\": \"C3D4E5F6\",\n  \"date\": \"2026-12-15\",\n  \"pending\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rate bezahlt
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "transaction_id": "C3D4E5F6",
  "date": "2026-12-15",
  "pending": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trackleads.io/api/v1/transactions/update")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Erstattung

**Request**

```json
{
  "transaction_id": "ORDER-1001",
  "cancelled": true
}
```

**Response**

```json
{
  "ok": true,
  "transaction_id": "ORDER-1001",
  "cancelled": true
}
```

**SDK Code**

```python Erstattung
import requests

url = "https://api.trackleads.io/api/v1/transactions/update"

payload = {
    "transaction_id": "ORDER-1001",
    "cancelled": True
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Erstattung
const url = 'https://api.trackleads.io/api/v1/transactions/update';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"transaction_id":"ORDER-1001","cancelled":true}'
};

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

```go Erstattung
package main

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

func main() {

	url := "https://api.trackleads.io/api/v1/transactions/update"

	payload := strings.NewReader("{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancelled\": true\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Erstattung
require 'uri'
require 'net/http'

url = URI("https://api.trackleads.io/api/v1/transactions/update")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancelled\": true\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.trackleads.io/api/v1/transactions/update")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancelled\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.trackleads.io/api/v1/transactions/update', [
  'body' => '{
  "transaction_id": "ORDER-1001",
  "cancelled": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Erstattung
using RestSharp;

var client = new RestClient("https://api.trackleads.io/api/v1/transactions/update");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancelled\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Erstattung
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "transaction_id": "ORDER-1001",
  "cancelled": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trackleads.io/api/v1/transactions/update")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Plan gekündigt

**Request**

```json
{
  "transaction_id": "ORDER-1001",
  "cancel_unpaid_rates": true
}
```

**Response**

```json
{
  "ok": true,
  "transaction_id": "ORDER-1001",
  "cancelled": false,
  "plan": {
    "cancelled_rates": 2,
    "paid_rates_kept": 1,
    "amount": 100,
    "fully_cancelled": false
  }
}
```

**SDK Code**

```python Plan gekündigt
import requests

url = "https://api.trackleads.io/api/v1/transactions/update"

payload = {
    "transaction_id": "ORDER-1001",
    "cancel_unpaid_rates": True
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Plan gekündigt
const url = 'https://api.trackleads.io/api/v1/transactions/update';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"transaction_id":"ORDER-1001","cancel_unpaid_rates":true}'
};

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

```go Plan gekündigt
package main

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

func main() {

	url := "https://api.trackleads.io/api/v1/transactions/update"

	payload := strings.NewReader("{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancel_unpaid_rates\": true\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Plan gekündigt
require 'uri'
require 'net/http'

url = URI("https://api.trackleads.io/api/v1/transactions/update")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancel_unpaid_rates\": true\n}"

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

```java Plan gekündigt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.trackleads.io/api/v1/transactions/update")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancel_unpaid_rates\": true\n}")
  .asString();
```

```php Plan gekündigt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.trackleads.io/api/v1/transactions/update', [
  'body' => '{
  "transaction_id": "ORDER-1001",
  "cancel_unpaid_rates": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Plan gekündigt
using RestSharp;

var client = new RestClient("https://api.trackleads.io/api/v1/transactions/update");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"transaction_id\": \"ORDER-1001\",\n  \"cancel_unpaid_rates\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Plan gekündigt
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "transaction_id": "ORDER-1001",
  "cancel_unpaid_rates": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trackleads.io/api/v1/transactions/update")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```