# Error scenario simulation

> Find operations on the Error scenario simulation feature.

Error scenario simulation provides simulations of different API results and returns the specified response for integration testing.

## Before you begin

Before conducting the error scenario simulation, log in to Antom Dashboard, enter the **Key configuration** page, and configure the settings for the sandbox environment.

1.  Go to **Developer** > **Key Configuration**, click **Generate key**. Or go to **Developer** > **Quick start**, find **Integration resources and tools**, select **Integration resources**, and click **Generate key**.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/b2698206-cb70-4735-a8f0-e2814e9b4349.png)

2.  Click **Confirm**. The keys are generated.

> **Note**: Your private key is only displayed once and Antom does not store it. Make sure you save your private key for later use.

3.  If you decide to replace the keys, you can replace API keys with one click or by using tools. Go to **Developer** > **Key configuration**, click **Replace keys**. Or go to **Developer** > **Quick start**, find **Integration resources and tools**, select **Integration resources**, and click **Replace keys**.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/d97f8ac0-8dd7-41a3-a54e-00a16001e149.png)

> **Note:** To replace keys, use one of the following methods:
>
> -   Click **Replace** **keys with one click** to replace the old keys with the keys generated by Antom.
> -   Click **Use your own public and private keys** to generate your own public and private keys by using the tool provided on the page.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/2ec655e3-ca25-4308-b063-d637930eae08.png)

4.  Go to **Developer** > **Notification URL**. Select the **Configuration** tab. Click **Add** under **Action** and enter your notification receiving address under Notification URL.

## Simulate errors

Error scenario simulation can simulate all result codes, including rare production environment scenarios. This helps developers to work with the same corresponding system logic processing in the test mode. The effective time of the results can be changed by adjusting the simulation time.

Antom provides a variety of responses corresponding to different result codes. Select a specific result code for the system to simulate the corresponding response of the API.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/d55b8bd1-38f1-4872-a612-99bc0c36467d.png)

**API simulation duration**

Once you set a specific time duration (30 min, 60 min, 90 min, or 120 min) for **API simulation duration**, the simulation of API calls with the specified error scenario will automatically conclude when the set duration expires.

![image.png](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/bc1fc7a5-3680-4425-a4c6-6599c5df72f8.png)

After you specify a response, the specified response is always returned for the corresponding API when the API simulation is turned on. For details about API simulation process, see [API call simulation](https://docs.antom.com/ac/merchant_service/api_call_sim.md).