# 500Internal Server Error in Simulation (Invalid Request Code)

**URL:** <https://zatca1.discourse.group/t/500internal-server-error-in-simulation-invalid-request-code/1221>\
**Category:** FATOORA portal and Simulation portal\
**Created:** [February 8, 2024, 10:26am UTC](https://zatca1.discourse.group/t/500internal-server-error-in-simulation-invalid-request-code/1221 "2024-02-08T10:26:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Sherif.Abaza](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@Sherif.Abaza](https://zatca1.discourse.group/u/Sherif.Abaza)\
**Post date:** [March 4, 2024, 6:32am UTC](https://zatca1.discourse.group/t/500internal-server-error-in-simulation-invalid-request-code/1221/3 "2024-03-04T06:32:37Z")

</div>

To resolve this issue, Please check:  
1- CSR Request : check that you’ve correctly configured the CSR (Certificate Signing Request) based on the environment you intend to use.  
Please try generate the CSR from the beginning for the simulation with the SDK using this command:  
‘Fatoora -sim -csr -csrConfig [propertiesfilename. properties]’ (delete -sim if you are in production not in simulation).  
You can find sample for properties files located in data/input in SDK directory.

2- API Endpoint: Ensure that you are using the correct APIs for the correct Environment you want to use.  
e.g.: If you’re using Simulation Env, use the Simulation portal to get the OTP and Simulation APIs to get the CCSID and PCCSID.

to know the difference between simulation and production portal:

> [@What are the integration API endpoints for production and simulation?](https://zatca1.discourse.group/t/what-are-the-integration-api-endpoints-for-production-and-simulation/350):
>
> I want to connect to the APIs for production and Simulation. What API end points should I use?

Also there are some notes need to be noted regarding the CSR and OTP in simulation as the below answers

> [@Is there any difference between Simulation portal and Fatoora portal when creating CSR?](https://zatca1.discourse.group/t/is-there-any-difference-between-simulation-portal-and-fatoora-portal-when-creating-csr/406):
>
> Is there any difference between Simulation portal and Fatoora portal when creating CSR?

> [@Internal server error response from PCSID API](https://zatca1.discourse.group/t/internal-server-error-response-from-pcsid-api/569/6):
>
> please make sure the config file doesn’t contain special characters, and try as much as possible to avoid arabic letters and spaces

Please try to perform requests via Postman. If the issue still persists, please share the postman collection, the CSR and its config file.

---

_[View the full topic](https://zatca1.discourse.group/t/500internal-server-error-in-simulation-invalid-request-code/1221)._
