# Migration to Version 9

> When upgrading from version 8 to version 9, some backward-incompatible changes must be adapted when working with the library.

Source: https://ekasa.ninedigit.sk/en/docs/migration/v9

When upgrading from version 8 to version 9, some backward-incompatible changes must be adapted when working with the library.

## 1. Changes to cash deposit and withdrawal registration

When attempting to register a document of type deposit (`Deposit`) or withdrawal (`Withdrawal`), the application raises the error _Registration of deposits, withdrawals and invalid documents is not supported in this version._

To register a deposit or withdrawal, you can trigger a print output via the API call `POST {server_address}/api/v1/printers/print`, specifying the following in the request body:

- `cashRegisterCode`: the code of the cash register whose header (information about the company, point of sale and cash register code) will be printed on the print output.
- `text`: information about the deposit or withdrawal amount according to the example below.

```json
{
    "text": "\u001atext\u001econtent\u001fVKLAD: 100,00 EUR\u001eformat\u001f12\u001a",
    "cashRegisterCode": "88812345678900001",
    "contentFlags": []
}
```

Example of printing a cash deposit confirmation when using the DLL library:

```csharp
ORPCode cashRegisterCode = "88812345678900001";
decimal amount = 100;
ReceiptText receiptText = TextToken.Create(
    $"VKLAD: {amount} EUR",
    TextFormats.DoubleHeight | TextFormats.DoubleWidth)
    .ToString();
NonfiscalReceiptContentFlags contentFlags = NonfiscalReceiptContentFlags.None;
TextPrintContext printContext = new TextPrintContext(
    receiptText, contentFlags, cashRegisterCode);

await client.PrintTextAsync(printContext, cancellationToken);
```

## 2. Changes to the use of invalid documents

When attempting to register a document of type invalid document (`Invalid`), the application raises the error _Registration of deposits, withdrawals and invalid documents is not supported in this version._

Since the invalid document was intended for printing documents during staff training, we recommend using zero prices and regular cash register receipts if such a need arises.
