# Device registration response different from API documentation

**URL:** https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829
**Category:** FATOORA portal and Simulation portal
**Created:** [October 9, 2023, 8:22am UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829 "2023-10-09T08:22:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vinay.hegde](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay.hegde](https://zatca1.discourse.group/u/vinay.hegde)
#### Post date: [October 9, 2023, 8:22am UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829/1 "2023-10-09T08:22:07Z")

</div>

Device registration is failing on production with an invalid OTP error.  
The response obtained is different from the one mentioned in the API contract.  
The API contract as per the sandbox API documentation - [Zatca](https://sandbox.zatca.gov.sa/IntegrationSandbox)

The response that we are getting from ZATCA:  
{ “body”: “Invalid OTP”, “code”: 400, “timeInMs”: 79 }

We are unable to capture the response correctly due to the change in response format.  
Also please let us know the reason for failure.

On simulation environment device registration is failing with 500 - invalid request during PCSID generation step.  
Please help us in debugging and fix the device registration on simulation env.

---

<div class="post-metadata">

### Author: ![vinay.hegde](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay.hegde](https://zatca1.discourse.group/u/vinay.hegde)
#### Post date: [October 9, 2023, 1:06pm UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829/2 "2023-10-09T13:06:36Z")

</div>

Attaching the csr request of the respective failures on sandbox and prod as discussed in the Q&A call today.

Prod CSR Request:  
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJQi96Q0NBYVFDQVFBd2dZQXhDekFKQmdOVkJBWVRBbE5CTVJNd0VRWURWUVFMREFvek1UQXhOVEl5TWpNMQpNVGd3TmdZRFZRUUtEQzlUWVhWa2FTQkliMnhrYVc1bklFTnZiWEJoYm5rZ1ptOXlJRU52Ym5abGNuTnBiMjRnClNXNWtkWE4wY21sbG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HBibVZsY21sdVp5QkRiMjV6ZFd4MFlXNWplU0JEYnk0eEhEQWFCZ05WQkFNTUUwTlUKSUMwZ1JHVjJhV05sSUMwZ01EQTFOakl3VmpBUUJnY3Foa2pPUFFJQkJnVXJnUVFBQ2dOQ0FBUTNUdVJVTm8zbAppbWwvTXBMN3RmTlk0dlAzWDB0cW1VMEhlTW9BQVVxV203ZWxmMkJuTkYvMGJuUW1EczRrc1N3T1lNeVovOVI5Ck9SMGx3RGZIOVNUYm9JSERNSUhBQmdrcWhraUc5dzBCQ1E0eGdiSXdnYTh3SkFZSkt3WUJCQUdDTnhRQ0JCY00KRlZCU1JWcEJWRU5CTFVOdlpHVXRVMmxuYm1sdVp6Q0JoZ1lEVlIwUkJIOHdmYVI3TUhreElEQWVCZ05WQkFRTQpGekV0UTFSOE1pMUZNUzR3TGpGOE15MUtSVVF3TlRZeU1SOHdIUVlLQ1pJbWlaUHlMR1FCQVF3UE16QXdOamczCk1UWTBOVEF3TURBek1RMHdDd1lEVlFRTURBUXhNVEF3TVE4d0RRWURWUVFhREFaU2FYbGhaR2d4RkRBU0JnTlYKQkE4TUMwTnZibk4xYkhSaGJuUnpNQW9HQ0NxR1NNNDlCQU1DQTBnQU1FVUNJSExLWjZQUml1dm5qVXB1QVNrMQp4dnVzZkRpT0dKclhRVTY1eEp4TnUzeTdBaUVBMURPUVhNaG9jdEJYb1h4K0hDQnJOcHB5MGF6aHY3bFI3MTd0CitVTFZTdEE9Ci0tLS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQo=

@kiaziz please check and help.

---

<div class="post-metadata">

### Author: ![kiaziz](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@kiaziz](https://zatca1.discourse.group/u/kiaziz)
#### Post date: [October 10, 2023, 9:45am UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829/3 "2023-10-10T09:45:48Z")

</div>

Dears,

please schedule a 1 to 1 call through the relationship manager.

Regards,

---

<div class="post-metadata">

### Author: ![vinay.hegde](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@vinay.hegde](https://zatca1.discourse.group/u/vinay.hegde)
#### Post date: [October 10, 2023, 10:31am UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829/4 "2023-10-10T10:31:13Z")

</div>

Sure thanks! We will request for a 1 to 1 call through the relationship manager.

Please prioritise these requests as device registration is fundamental to start E-Invoicing.

---

<div class="post-metadata">

### Author: ![sergei.shishov](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sergei.shishov](https://zatca1.discourse.group/u/sergei.shishov)
#### Post date: [October 10, 2023, 3:31pm UTC](https://zatca1.discourse.group/t/device-registration-response-different-from-api-documentation/829/5 "2023-10-10T15:31:02Z")

</div>

@kiaziz This is the issue everyone experiencing who integrated with `Sandbox` first and then migrating to `Simulation`/`Production`.

The results for invalid OTP on `Simulaiton`/`Production` and `Sandbox` are different. Could you guys fix it to remove the confusion for everyone, please?

We had exactly the same issue and we decided to handle the error from `Simulation`/`Production` only properly, leaving `Sandbox` **“broken”** as it does not make sense to support the response which will not be used in production.

Best regards,  
Sergei
