> 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 suchen

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

Sucht einen einzelnen Deal über eine beliebige bekannte Kennung. Die Kennung wird in dieser Reihenfolge geprüft: Trackleads `transaction_id`, Close-ID, Stripe-IDs (Payment Intent, Charge, Checkout Session), Ablefy-Bestellnummer, Ablefy-Bestelltoken. Die Antwort beschreibt immer den ganzen Deal. Trifft die Kennung eine Rate eines Zahlungsplans, kommt der Hauptdeal mit allen Raten zurück. Kein Treffer ist kein Fehler und antwortet ebenfalls mit 200.

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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects an object.

- `id` (string, required) — Eine Kennung des Deals.

## Response

### 200

Ergebnis der Suche.

- `ok` (boolean, required)
- `found` (boolean, required)
- `matched_by` (enum, optional) — Welche Art von Kennung getroffen hat.
  - Allowed values: `custom_id`, `close_id`, `stripe_payment_intent_id`, `stripe_charge_id`, `stripe_session_id`, `ablefy_order_id`, `ablefy_order_token`
- `deal` (Deal, optional)

## 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

### Deal

- `transaction_id` (string, optional)
- `name` (string, optional)
- `amount` (double, optional)
- `paid_total` (double, optional) — Bei Zahlungsplänen die Summe der bezahlten Raten, sonst der volle Betrag, wenn der Deal bezahlt ist, andernfalls 0.
- `date` (date, optional)
- `source` (string, optional) — Herkunft des Deals, zum Beispiel `manual`, `api`, `stripe`, `ablefy`, `close`.
- `status` (enum, optional) — `payment_abort` und `cancelled` haben Vorrang. Ein Zahlungsplan spiegelt seine Raten: `completed` bei allen bezahlten Raten, `partial` bei einigen, `pending` bei keiner.
  - Allowed values: `completed`, `partial`, `pending`, `cancelled`, `payment_abort`
- `cancelled` (boolean, optional)
- `pending` (boolean, optional)
- `payment_abort` (boolean, optional)
- `ablefy_order_id` (string, optional, nullable)
- `ablefy_order_token` (string, optional, nullable)
- `lead` (DealLead, optional, nullable)
- `product` (DealProduct, optional, nullable)
- `split` (boolean, optional) — `true` für den Hauptdeal eines Zahlungsplans.
- `rates` (list of DealRatesItems, optional) — Raten in zeitlicher Reihenfolge. Leer bei Deals ohne Zahlungsplan.

### DealLead

- `id` (string, optional) — Trackleads-Lead-ID (`custom_id`).
- `name` (string, optional)

### DealProduct

- `id` (integer, optional)
- `name` (string, optional)

### DealRatesItems

- `rate` (integer, optional)
- `date` (date, optional)
- `amount` (double, optional)
- `paid` (boolean, optional)
- `cancelled` (boolean, optional)
- `payment_abort` (boolean, optional)

## Examples

**Request**

```json
{
  "id": "pi_3PxYz1AbCdEf"
}
```

**Response**

```json
{
  "ok": true,
  "found": true,
  "matched_by": "stripe_payment_intent_id",
  "deal": {
    "transaction_id": "cs_test_a1B2c3",
    "name": "Deal: Coaching Program",
    "amount": 3000,
    "paid_total": 2000,
    "date": "2026-07-01",
    "source": "stripe",
    "status": "partial",
    "cancelled": false,
    "pending": false,
    "payment_abort": false,
    "ablefy_order_id": null,
    "ablefy_order_token": null,
    "lead": {
      "id": "LEAD-123",
      "name": "Max Muster"
    },
    "product": {
      "id": 7,
      "name": "Coaching Program"
    },
    "split": true,
    "rates": [
      {
        "rate": 1,
        "date": "2026-07-01",
        "amount": 1000,
        "paid": true,
        "cancelled": false,
        "payment_abort": false
      },
      {
        "rate": 2,
        "date": "2026-08-01",
        "amount": 1000,
        "paid": true,
        "cancelled": false,
        "payment_abort": false
      },
      {
        "rate": 3,
        "date": "2026-09-01",
        "amount": 1000,
        "paid": false,
        "cancelled": false,
        "payment_abort": false
      }
    ]
  }
}
```

**SDK Code**

```python Deals_searchTransaction_example
import requests

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

payload = { "id": "pi_3PxYz1AbCdEf" }
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Deals_searchTransaction_example
const url = 'https://api.trackleads.io/api/v1/transactions/search';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"id":"pi_3PxYz1AbCdEf"}'
};

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

```go Deals_searchTransaction_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"id\": \"pi_3PxYz1AbCdEf\"\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 Deals_searchTransaction_example
require 'uri'
require 'net/http'

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

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  \"id\": \"pi_3PxYz1AbCdEf\"\n}"

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Deals_searchTransaction_example
using RestSharp;

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

```swift Deals_searchTransaction_example
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["id": "pi_3PxYz1AbCdEf"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.trackleads.io/api/v1/transactions/search")! 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()
```