409 status code - Duplicate-Invoice error

Hi, I just saw this thread. Yesterday I tried reporting a simplified invoice and got this response:

{
  "validationResults": {
    "infoMessages": [],
    "warningMessages": [],
    "errorMessages": [
      {
        "type": "ERROR",
        "code": "Invoice-Errors",
        "category": "Duplicate-Invoice",
        "message": "Invoice was already reported successfully earlier.",
        "status": "ERROR"
      }
    ],
    "status": "ERROR"
  },
  "reportingStatus": "NOT_REPORTED"
}

The thing is, the invoice hash was newly generated, and I made sure there wasn’t any duplicate in our records when I first sent it. Then today, when I tried reporting the same invoice again, I got a 202 response with a warning instead. I have included the Invoice Hash in this reply.

HASH: IHaa7EiNGwHiTF+/qj2hEylSoczFIo/1xVrzUfXCGvg=

Thank you for your support.

@hnatividad as explained in the announcement Breaking Change: Checking the duplicate (response codes 208 & 409) the de-duplication check is carried out based on hashes temporarily stored for 24 hours. When you receive a 409 or 208 response, this implies invoice is already received by ZATCA.

1 Like

Alright! Thank you for your response! I already adjusted our system to work as per given guidelines. @Ankit.K.Tiwari

When we retry and we got 208 or 409, how it can tell us whether the invoice was rejected or not? I mean a invoice can be rejected with valid reasons. Or the understanding is in rejected case we will never get 409 or 208 - its only for successfully submissions?

@hamsof correct, 409 and 208 is possible only if first submission was successfully Reported or Cleared.

Hi Ankit,

For the past few days I have been receiving many 208, 409 status code responses from the clearance/reporting endpoints. However when i check my records I cannot find any document with the same invoice hash in our database, therefore from what I am seeing in my system I cannot find a reason as to why I am getting these errors.

These error happen at random phases and there is no real pattern to it, but they are happening on a periodic basis. I request some help from the ZATCA team on this in order to gain further insights on the issue. Please let me know what I can share via email so that we can communicate further.