# Fixing the error "Chyba v podpise dátovej správy"

> The eKasa system rejects receipts with a data message signature error. The most common cause is a wrongly set environment.

Source: https://ekasa.ninedigit.sk/en/docs/troubleshooting/invalid-signature

The error “Chyba v podpise dátovej správy” (error in the data message signature) is most likely caused by the wrong
environment (integration vs. production) in the Portos eKasa configuration.

**HTTP API:**

If you use the HTTP WEB API service:

- open the admin application at `http://localhost:3010`
- in the main menu, choose `Nastavenia` (Settings)
- on the `eKasa klient` (eKasa client) tab, in the `Základné` (Basic) part, choose the required value in the `Prostredie` (Environment) field

From version 8 we recommend setting the *Prostredie* (Environment) field to *(automaticky určené)* (determined
automatically). The environment is then derived from the cash register identification data.

**.NET library:**

- open the `Portos eKasa Servis` service application
- in the top bar, choose the `Nastavenia` (Settings) tab
- in the section `Pokročilé` (Advanced) > `eKasa klient` (eKasa client), enter the required value in the `prostredie` (environment) field

If you use the library without loading the configuration from a file, and instead create it manually in source code
or from your own source, change the environment type in the configuration object (the `ClientConfiguration` class),
which is a parameter of the `Client` class constructor.

```csharp
ClientConfiguration configuration = new ClientConfiguration
{
    // integration (Playground) or production (Production) environment,
    // null (default, since version 8) = determined from the identification data
    EKasaClient = new EKasaClientConfiguration { Environment = EKasaEnvironment.Playground }
};

Client client = new NineDigit.eKasa.Client(configuration);
```

From version 8 we recommend setting the *prostredie* (environment) field to automatic detection (the value `null` in code).
