> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration auf Version 2 der API

> Aktualisieren Sie Ihren Code beim Upgrade von v1 auf v2 der ABBYY FlexiCapture for Invoices Cloud REST API: Anwendungen, mehrspaltige Felder und umbenannte v2-URLs.

Wenn Sie von Version 1 auf Version 2 der ABBYY FlexiCapture for Invoices Cloud REST API upgraden, müssen Sie einige Änderungen an Ihrem Code vornehmen.

Zu den wichtigsten Änderungen gehören:

* **Anwendungen** — Version 2 führt das Konzept von Anwendungen ein. Ein Konto kann mehrere Anwendungen haben, die unabhängig voneinander arbeiten. Jede Anwendung arbeitet nur mit ihren eigenen Aufgaben, Verarbeitungsdaten und trainierten Modellen und kann nicht auf Informationen anderer Anwendungen zugreifen.
* **Mehrspaltige Felder** — Felder können jetzt Varianten haben, sodass unterschiedliche Schreibweisen und Fehler berücksichtigt werden können. Das erleichtert die Zuordnung von Vendors und Geschäftsbereichen. Die erfassten Felder werden als Arrays mit Varianten dargestellt.
* **Version in URLs aktualisiert** — Die URLs wurden entsprechend der Version umbenannt: `v1` in der URL wurde zu `v2`.

Die API-Methoden von Version 1 sind unten nach Kategorie aufgelistet. Jeder Eintrag zeigt die URL für Version 2 sowie die Änderungen an Request und Antwort.

<div id="working-with-files">
  ## Arbeiten mit Dateien
</div>

<div id="post-file">
  ### POST /file
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/file
POST https://api-{location-id}.flexicapture.com/v2/file
```

* Den Abfrageparameter `email` entfernt; stattdessen wird die E-Mail-Adresse des Kontos verwendet.
* Der Antwort hinzugefügt: `application` (Application ID) und `expiring` (das Ablaufdatum der Datei).
* Aus der Antwort entfernt: die Schlüssel für Dateivalidierung und -löschung (`validated`, `is_validated`, `deleted`, `is_deleted`), die Fehlermeldung (`error`) und die Seitenanzahl (`pages_count`).

### GET /file/{id}/{token}/info

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}/info
GET https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}/info
```

* Für gelöschte Dateien können keine Metadaten mehr abgerufen werden; stattdessen wird jetzt eine `404`-Antwort zurückgegeben.
* Zur Antwort hinzugefügt: `application` (Application ID) und `expiring` (das Ablaufdatum der Datei).
* Aus der Antwort entfernt: die Schlüssel für Dateivalidierung und Löschung (`validated`, `is_validated`, `deleted`, `is_deleted`), die Fehlermeldung (`error`) und die Seitenanzahl (`pages_count`).

### GET /file/{id}/{token}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}
GET https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}
```

### DELETE /file/{id}/{token}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/file/{id}/{token}
DELETE https://api-{location-id}.flexicapture.com/v2/file/{id}/{token}
```

<div id="capturing-documents">
  ## Dokumente erfassen
</div>

<div id="post-taskcapturedocuments">
  ### POST /task/capture/documents
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/capture/data
POST https://api-{location-id}.flexicapture.com/v2/task/capture/documents
```

Änderungen an der Anfrage:

* Der Request-Body soll die Schlüssel `email` und `label` nicht mehr enthalten.
* Die Schlüssel `region`, `export_format` und `verification_type` wurden in das Dictionary `properties` verschoben.

Änderungen an der Antwort:

* Hinzugefügte Schlüssel: `batch_id`, `is_realtime_enabled`, `processing_priority`, `is_demo`, `account`, `application`, `is_extra_error`, `documents > data`, `documents > is_moved`, `documents > traininglayout_fileid`.
* Entfernte Schlüssel: `label`, `lead_time`, `started`, `delivered`, `deleted`, `wait_for_action`, `is_test`, `region`, `export_format`, `verification_type`, `business_unit`, `properties > export_format`, `properties > verification_type`.
* Das Array `services` wurde entfernt; der Schlüssel `files` wurde aus dem Array `services` in das Array `documents` verschoben.
* `number` ist jetzt ein `string` statt einer Ganzzahl.
* `progress` ist jetzt eine Gleitkommazahl statt einer Ganzzahl.

<div id="invoice-capturing-tasks">
  ## Aufgaben zur Rechnungserfassung
</div>

<div id="post-taskcaptureinvoices">
  ### POST /task/capture/invoices
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/capture/invoices
POST https://api-{location-id}.flexicapture.com/v2/task/capture/invoices
```

Änderungen an der Anfrage:

* Der Request-Body sollte die Schlüssel `business_unit`, `email` und `label` nicht mehr enthalten.
* Die Schlüssel `region`, `export_format` und `verification_type` wurden in das Dictionary `properties` verschoben.

Änderungen an der Antwort:

* Hinzugefügte Schlüssel: `batch_id`, `is_realtime_enabled`, `processing_priority`, `is_demo`, `account`, `application`, `is_extra_error`, `documents > data`, `documents > is_moved`, `documents > traininglayout_fileid`.
* Entfernte Schlüssel: `label`, `lead_time`, `started`, `delivered`, `deleted`, `wait_for_action`, `is_test`, `region`, `export_format`, `verification_type`, `business_unit`, `properties > export_format`, `properties > verification_type`.
* Das Array `services` wurde entfernt; der Schlüssel `files` wurde aus dem Array `services` in das Array `documents` verschoben.
* `number` ist jetzt ein string statt einer Ganzzahl.
* `progress` ist jetzt eine Gleitkommazahl statt einer Ganzzahl.

### GET /task/{id}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/task/{id}
GET https://api-{location-id}.flexicapture.com/v2/task/{id}
```

Die Antwort ist jetzt genauso strukturiert wie bei der Methode zur Aufgabenerstellung.

* Hinzugefügte Schlüssel, ähnlich wie bei der Methode zur Aufgabenerstellung: `batch_id`, `is_realtime_enabled`, `processing_priority`, `is_demo`, `account`, `application`, `documents_count`, `pages_count`, `is_extra_error`, `documents > data`, `documents > is_moved`, `documents > traininglayout_fileid`.
* Weitere Schlüssel für die extrahierten Daten hinzugefügt — `documents > data > { region, export_format, verification_type, vendor_name, invoice_date, total, currency }` — sowie für die Aufgabenabrechnung: `billed`, `is_billed`.
* Entfernte Schlüssel: `label`, `lead_time`, `deleted`, `wait_for_action`, `is_test`, `region`, `export_format`, `verification_type`, `business_unit`.
* Das `services`-Array wurde entfernt; der Schlüssel `files` wurde aus dem `services`-Array in das `documents`-Array verschoben.
* `number` ist jetzt ein `string` statt einer Ganzzahl.
* `progress` ist jetzt eine Gleitkommazahl statt einer Ganzzahl.

### DELETE /task/{id}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/task/{id}
DELETE https://api-{location-id}.flexicapture.com/v2/task/{id}
```

<div id="working-with-datasets">
  ## Arbeiten mit Datensätzen
</div>

<div id="post-datasetbusinessunits">
  ### POST /dataset/businessunits
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/dataset/businessunits
POST https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
```

* Sowohl in der Anfrage als auch in der Antwort enthalten die folgenden Schlüssel nun Arrays mit Varianten: `name`, `street`, `city`, `state`, `zip`, `vat`.

<div id="put-datasetbusinessunits">
  ### PUT /dataset/businessunits
</div>

```http theme={null}
PUT https://api-{location-id}.flexicapture.com/v1/dataset/businessunits
PUT https://api-{location-id}.flexicapture.com/v2/dataset/businessunits
```

* Sowohl in der Anfrage als auch in der Antwort enthalten die folgenden Schlüssel nun Arrays mit Varianten: `name`, `street`, `city`, `state`, `zip`, `vat`.

### GET /dataset/businessunits/{region}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/dataset/businessunits/{region}
GET https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}
```

* Mit optionalen Abfrageparametern können jetzt die Daten eines der Geschäftsbereiche abgerufen werden: `externalId`, `skip`, `take`.
* Sowohl in der Anfrage als auch in der Antwort enthalten die folgenden Schlüssel jetzt Arrays mit Varianten: `name`, `street`, `city`, `state`, `zip`, `vat`.

### DELETE /dataset/businessunits/{region}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/dataset/businessunits/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunits/{region}
```

### DELETE /dataset/businessunit/{region}/{externalId}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/dataset/businessunit/{region}/{externalId}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/businessunit/{region}/{externalId}
```

<div id="post-datasetvendors">
  ### POST /dataset/vendors
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/dataset/vendors
POST https://api-{location-id}.flexicapture.com/v2/dataset/vendors
```

* Sowohl in der Anfrage als auch in der Antwort enthalten die folgenden Schlüssel jetzt Arrays mit Varianten: `name`, `street`, `city`, `state`, `zip`, `vat`, `national_vat`, `iban`, `bank_account`, `bank_code`, `gl_code`.

<div id="put-datasetvendors">
  ### PUT /dataset/vendors
</div>

```http theme={null}
PUT https://api-{location-id}.flexicapture.com/v1/dataset/vendors
PUT https://api-{location-id}.flexicapture.com/v2/dataset/vendors
```

* In der Anfrage und in der Antwort liegen die folgenden Schlüssel nun als Arrays mit Varianten vor: `name`, `street`, `city`, `state`, `zip`, `vat`, `national_vat`, `iban`, `bank_account`, `bank_code`, `gl_code`.

### GET /dataset/vendors/{region}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}
GET https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}
```

* Optionale Abfrageparameter können jetzt verwendet werden, um die Daten eines Vendors abzurufen: `externalId`, `skip`, `take`.
* Sowohl in der Anfrage als auch in der Antwort enthalten die folgenden Schlüssel jetzt Arrays mit Varianten: `name`, `street`, `city`, `state`, `zip`, `vat`, `national_vat`, `iban`, `bank_account`, `bank_code`, `gl_code`.

### DELETE /dataset/vendors/{region}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}
```

### DELETE /dataset/vendors/{region}/{externalId}

```http theme={null}
DELETE https://api-{location-id}.flexicapture.com/v1/dataset/vendors/{region}/{externalId}
DELETE https://api-{location-id}.flexicapture.com/v2/dataset/vendors/{region}/{externalId}
```

<div id="training-the-data-capture-models">
  ## Trainieren der Modelle für die Datenerfassung
</div>

<div id="post-training">
  ### POST /training
</div>

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/data/train
POST https://api-{location-id}.flexicapture.com/v2/training
```

<div id="put-training">
  ### PUT /training
</div>

```http theme={null}
PUT https://api-{location-id}.flexicapture.com/v1/data/train
PUT https://api-{location-id}.flexicapture.com/v2/training
```

### GET /training/layout/{taskId}/{fileId}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/data/{taskId}/{fileId}
GET https://api-{location-id}.flexicapture.com/v2/training/layout/{taskId}/{fileId}
```

### POST /training/station/{taskId}

```http theme={null}
POST https://api-{location-id}.flexicapture.com/v1/data/train/station/{taskId}
POST https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}
```

### PUT /training/station/{taskId}

```http theme={null}
PUT https://api-{location-id}.flexicapture.com/v1/data/train/station/{taskId}
PUT https://api-{location-id}.flexicapture.com/v2/training/station/{taskId}
```

### GET /training/batch{region}

```http theme={null}
GET https://api-{location-id}.flexicapture.com/v1/data/batch/{region}
GET https://api-{location-id}.flexicapture.com/v2/training/batch{region}
```
