Thanks for reaching out, apologies for the delay in response.
Please note that you should proceed with the second approach which is
When 401 response that’s mean the invoice didn’t submit yet, the correct action is to resubmit the same invoice with the same ICV and new PIH.
Resubmit invoice (after 401 Unauthorized) → means use the same ICV (because the invoice was never accepted due to auth failure). or use new ICV ? Can you please clarify me?
Please note that 401 response is due to wrong authorisation, it’s not related to ICV or PIH
The right approach is the below:
1- when you share an invoice on clearance or reporting API.
2- if the response was 401 that’s mean your invoice didn’t submitted to zatca yet, due to wrong unauthorised reason,
3- in this case you need to check and confirm that you are using the same binary security token in the user name and the same secret as the password
After checking if you confirmed that you are using the correct username and password for the same VAT, I would kindly request you to elaborate more with sharing your full concern to the below mail, for our investigation and to schedule one to one meeting if needed.
My authorization is correct because when I resubmit the invoice, it is successfully accepted. That’s why I am confused about whether I should resubmit the same invoice with the same ICV or generate a new one. Which is the correct way?