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

# Test environment

> Test your integration against a simulated market before you send schedules to the real market.

The test environment lets you test your integration with the Engrate API before you go live. You use a test organization. Engrate connects the test organization to a simulated market. Nothing that the test organization sends reaches the real market.

The simulated market sends the same kinds of message as the real market. It plays the Scheduling Area Responsible and your counterparties. Because of this, the API shows the same state, statuses and match reports as in production. [How it is different from the real market](#how-it-is-different-from-the-real-market) gives the differences.

The test environment is available for the Netherlands. There, the simulated market takes the place of the TenneT MMC Hub.

## What the simulated market does

| Process | What the simulated market does |
| - | - |
| [Scheduling](https://docs.engrate.io/market-communication/schedules/overview.md) | It answers each revision with an acknowledgement. It can refuse a revision, for example a revision that is not balanced. |
| [Matching](https://docs.engrate.io/market-communication/schedules/matching-and-confirmation.md) | For domestic series, three simulated counterparties (a trader, a supplier and a producer) send their series. The simulated market matches your series against their series. Then it sends anomaly reports and confirmation reports. For foreign series, it sends only an acknowledgement and a confirmation report. |
| [Allocations per accounting point](https://docs.engrate.io/market-communication/allocations/accounting-points.md) and [aggregate allocations](https://docs.engrate.io/market-communication/allocations/aggregate-allocations.md) | Each day, it sends allocations for a portfolio of test accounting points. It sends an allocation for each accounting point with telemetry, and aggregate allocations for each metering grid area. Allocations for a delivery day come on the next day at 14:00 Amsterdam time. |

## How it is different from the real market

* **Answers come in a few minutes or less.** The real market answers over hours. The simulated market keeps the order of the answers, but it makes the time between them shorter.
* **Your counterparties follow a scenario.** The scenario sets the values that your counterparties send and what goes wrong during the day. See [Scenarios](#scenarios).
* **Allocations come from one run each day.** The simulated market does not send later corrections.
* **The data is test data.** The counterparties and the accounting points do not exist in the real market. Use only the identifiers that we give you.

## Scenarios

A scenario is one delivery day from the first revision to the last confirmation report. Each delivery day that you send starts the scenario again. Your test organization has one scenario for domestic series and one for foreign series. If you do not ask for a scenario, you get a normal day.

| Scenario | What happens |
| - | - |
| Normal day | Your series match. Later, the trader changes an intraday trade. You get an anomaly report. You send a new revision with the same change. Then you get a new confirmation report. |
| Error that you correct | Your first revision has an incorrect value in a trade with the trader. You get an anomaly report. Your next revision corrects the value, and the series match. |
| Counterparty sends nothing | The supplier does not send its series. You get an anomaly report. For that trade, the confirmation report sets the values to zero. |
| Several anomalies | Your first revision is not balanced and is refused. Your next revision has an incorrect value in a trade with the trader, and the producer is late with its series. You get an anomaly report for each problem. You correct the value, and the producer sends its series. In the evening, a counterparty reports a trade that you did not make. You get an anomaly report. |
| Normal day, foreign | You send foreign series on the cross-border capacity contracts of the day. You get an acknowledgement and a confirmation report. |
| Capacity exceeded, foreign | Your first revision nominates more than the capacity of a contract and is refused. Your next revision stays within the capacity. |

With the scenario, we send you a test package. The test package gives the EAN-13 codes of your counterparties, the schedule that you send at each step, and what the API returns after each step. Your counterparties send fixed values, so your series match only when you send the values from the test package. To change the scenario, [contact us](mailto:hello@engrate.io).

## Get started

**1. Ask for a test organization**

[Contact us](mailto:hello@engrate.io). Tell us the scenario that you want and the size of the test portfolio for allocations. We make a test organization for you, separate from your production organization, and connect it to the simulated market. Then we send you the test package. For foreign series, it also gives the identifiers of the capacity contracts.

**2. Get an API key**

The test organization has its own sign-in to the Engrate Console. Your production sign-in cannot make API keys for the test organization. Sign in to the test organization and make an API key, as in [Authentication](https://docs.engrate.io/guides/authentication.md). Keep it apart from the API key of your production organization. The API key selects the organization, and the organization selects the market that receives your schedules.

**3. Send a schedule**

Send a schedule with `"market": "NL"` and `"tso": "TENNET_TSO"`, in the same way as in [Send your first schedule](https://docs.engrate.io/market-communication/guides/send-your-first-schedule.md). Use the `receiver_id` and the EAN-13 codes from the test package. For foreign series, set `market_agreement_id` to the capacity contracts from the test package. Use the same URL as in production, `https://api.engrate.io`.

**4. Read the results**

Read the revisions, the series state and the match reports with the same endpoints as in production. Compare the results with the test package.

## Go live

To go live in the Netherlands, TenneT requires a qualification test in its own test environment. We can connect a test organization to that environment for you. When you pass the qualification test, we connect your production organization to TenneT. Then send your schedules with the API key of your production organization.

Your test organization stays connected to the simulated market. You can continue to use it for tests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.