{
  "openapi": "3.0.1",
  "info": {
    "title": "AvTax Invoice API v2",
    "description": "The AvTax Invoice API v2 serves as a seamless bridge between taxpayer systems and ZATCA. It simplifies the complexities of integrating with ZATCA by accepting a simple JSON object, processing it to meet ZATCA's requirements, and validating the invoice through over 100 validation steps before submission. The API ensures that all invoices are compliant with ZATCA's standards, thereby providing a smooth and efficient way to handle tax reporting. The response from ZATCA is returned to the user, providing a complete end-to-end solution for tax invoice management.\r\n\r\n# Integration\r\n\r\n## Authentication\r\n\r\n| Mode | Token endpoint | Invoice request credentials |\r\n|---|---|---|\r\n| EGS unit | `POST /api/UserAuthentication/LoginAsEgsUnit` | `Authorization: Bearer {access_token}` |\r\n| Partner | `POST /api/Partner/Login` | `Authorization: Bearer {access_token}`, `EgsUnitClientId`, `EgsUnitClientSecret` |\r\n\r\n## Submission headers\r\n\r\n- `Api-Version: 2.0`\r\n- `Idempotency-Key: {8-128 character operation key}`\r\n- `Content-Type: application/json`\r\n\r\n`X-AVTax-Submission-Mode` is optional for B2C: `async` (default) or `wait-for-zatca`. B2B always waits for clearance.\r\n\r\n## Results\r\n\r\n- **B2C:** HTTP 200 returns signed XML and QR after issuance. `zatcaSubmissionStatus` contains the reporting state.\r\n- **B2B:** HTTP 200 returns signed XML and QR only after clearance. HTTP 422 is a ZATCA rejection. HTTP 503 is an unknown outcome.\r\n\r\n## Validation\r\n\r\nEvery invoice passes through more than 100 validation checks before submission to ZATCA.\r\n\r\n## Persistence and retries\r\n\r\nStore `signedInvoiceXmlBase64`, `qrCodeString`, `uuid`, and `invoiceHashBase64` from every successful issuance response. Retry an uncertain request with the identical JSON body and `Idempotency-Key`. Use `GET /api/Invoice/operations/{idempotencyKey}` to retrieve the current operation state.",
    "contact": {
      "name": "AvTax Partner Engineering",
      "email": "info@apps-valley.net"
    },
    "version": "2.0"
  },
  "paths": {
    "/api/Invoice/SubmitInvoice": {
      "post": {
        "tags": [
          "Invoice API v2"
        ],
        "summary": "Issues and submits an invoice using the resilient Invoice API v2 workflow.",
        "description": "B2C async mode returns signed XML and QR after issuance while reporting continues in the\r\nbackground. B2C wait-for-zatca mode waits for the first reporting result. B2B returns signed\r\nXML and QR only after ZATCA clearance succeeds.",
        "parameters": [
          {
            "name": "Api-Version",
            "in": "header",
            "description": "Required API contract selector. Fixed value: 2.0.",
            "required": true,
            "schema": {
              "enum": [
                "2.0"
              ],
              "type": "string",
              "default": "2.0"
            },
            "example": "2.0"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Client-generated 8-128 character identifier for one logical invoice. Every retry must use the same key and identical JSON body.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "0c8c38bb-8a97-4d71-89c8-b6420250db84"
          },
          {
            "name": "X-AVTax-Submission-Mode",
            "in": "header",
            "description": "B2C behavior: async (default) returns after local issuance; wait-for-zatca waits for the first submission result. B2B clearance is always synchronous.",
            "schema": {
              "type": "string",
              "default": "async"
            },
            "example": "async"
          },
          {
            "name": "Prefer",
            "in": "header",
            "description": "Optional bounded authority wait, for example wait=20. The server caps it at the configured maximum.",
            "schema": {
              "type": "string"
            },
            "example": "wait=20"
          },
          {
            "name": "EgsUnitClientId",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string"
            },
            "example": "egs-unit-client-id"
          },
          {
            "name": "EgsUnitClientSecret",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string",
              "format": "password"
            },
            "example": "egs-unit-client-secret"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitInvoiceV2Command"
              },
              "example": {"payableRoundingAmount":0,"validateWarnings":true,"documentType":"SimplifiedTaxInvoice","invoiceIndicator":"None","currency":"SAR","exchangeRate":null,"documentIssueDateTime":"2026-07-26T19:15:00","supplyDate":null,"buyer":null,"documentLineItems":[{"lineItemName":"Restaurant order","lineItemPrice":100,"lineItemQty":1,"discountOnLineItem":0,"allowanceCode":null,"taxCategoryCode":"S","taxReasonCode":"None","taxReasonDescription":null,"vatRateOnLineItem":15}],"referenceId":null,"documentId":"POS-2026-000184","notes":null,"orderReferenceId":null,"documentAllowanceOrChange":null,"invoiceTypeReason":null,"payment":{"paymentMethod":"InCash","paymentAccountIdentifier":null,"paymentNote":null},"prepaymentDetails":null}
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitInvoiceV2Command"
              },
              "example": {"payableRoundingAmount":0,"validateWarnings":true,"documentType":"SimplifiedTaxInvoice","invoiceIndicator":"None","currency":"SAR","exchangeRate":null,"documentIssueDateTime":"2026-07-26T19:15:00","supplyDate":null,"buyer":null,"documentLineItems":[{"lineItemName":"Restaurant order","lineItemPrice":100,"lineItemQty":1,"discountOnLineItem":0,"allowanceCode":null,"taxCategoryCode":"S","taxReasonCode":"None","taxReasonDescription":null,"vatRateOnLineItem":15}],"referenceId":null,"documentId":"POS-2026-000184","notes":null,"orderReferenceId":null,"documentAllowanceOrChange":null,"invoiceTypeReason":null,"payment":{"paymentMethod":"InCash","paymentAccountIdentifier":null,"paymentNote":null},"prepaymentDetails":null}
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitInvoiceV2Command"
              },
              "example": {"payableRoundingAmount":0,"validateWarnings":true,"documentType":"SimplifiedTaxInvoice","invoiceIndicator":"None","currency":"SAR","exchangeRate":null,"documentIssueDateTime":"2026-07-26T19:15:00","supplyDate":null,"buyer":null,"documentLineItems":[{"lineItemName":"Restaurant order","lineItemPrice":100,"lineItemQty":1,"discountOnLineItem":0,"allowanceCode":null,"taxCategoryCode":"S","taxReasonCode":"None","taxReasonDescription":null,"vatRateOnLineItem":15}],"referenceId":null,"documentId":"POS-2026-000184","notes":null,"orderReferenceId":null,"documentAllowanceOrChange":null,"invoiceTypeReason":null,"payment":{"paymentMethod":"InCash","paymentAccountIdentifier":null,"paymentNote":null},"prepaymentDetails":null}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Simplified invoice issued locally, or standard invoice cleared by ZATCA. zatcaSubmissionStatus identifies the authority reporting state.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              }
            }
          },
          "400": {
            "description": "The headers, JSON body, business data, or locally generated ZATCA XML failed validation before issuance.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Missing idempotency key": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_idempotency_key","message":"Idempotency-Key is required and must contain between 8 and 128 characters.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send one stable Idempotency-Key for the complete logical invoice operation."],"invoiceStatusUrl":null}
                  },
                  "Invalid submission mode": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_submission_mode","message":"X-AVTax-Submission-Mode must be either 'async' or 'wait-for-zatca'.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use async for normal B2C resilience or wait-for-zatca when a final submission result is required."],"invoiceStatusUrl":null}
                  },
                  "Invoice validation failed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_validation_failed","message":"The invoice was not issued because validation failed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["DocumentLineItems must contain at least one item."],"invoiceStatusUrl":null}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Missing idempotency key": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_idempotency_key","message":"Idempotency-Key is required and must contain between 8 and 128 characters.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send one stable Idempotency-Key for the complete logical invoice operation."],"invoiceStatusUrl":null}
                  },
                  "Invalid submission mode": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_submission_mode","message":"X-AVTax-Submission-Mode must be either 'async' or 'wait-for-zatca'.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use async for normal B2C resilience or wait-for-zatca when a final submission result is required."],"invoiceStatusUrl":null}
                  },
                  "Invoice validation failed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_validation_failed","message":"The invoice was not issued because validation failed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["DocumentLineItems must contain at least one item."],"invoiceStatusUrl":null}
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Missing idempotency key": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_idempotency_key","message":"Idempotency-Key is required and must contain between 8 and 128 characters.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send one stable Idempotency-Key for the complete logical invoice operation."],"invoiceStatusUrl":null}
                  },
                  "Invalid submission mode": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invalid_submission_mode","message":"X-AVTax-Submission-Mode must be either 'async' or 'wait-for-zatca'.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use async for normal B2C resilience or wait-for-zatca when a final submission result is required."],"invoiceStatusUrl":null}
                  },
                  "Invoice validation failed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_validation_failed","message":"The invoice was not issued because validation failed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["DocumentLineItems must contain at least one item."],"invoiceStatusUrl":null}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer token missing, invalid, or expired.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              }
            }
          },
          "403": {
            "description": "The EGS unit could not be authorized for the authenticated token.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              }
            }
          },
          "409": {
            "description": "The Idempotency-Key belongs to a different payload, or this EGS has already switched its chain to v2.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Idempotency key reused with different payload": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"idempotency_key_reused","message":"The Idempotency-Key was already used with a different invoice payload.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":null,"errors":["Reuse the original payload, or create a new key only for a genuinely new invoice operation."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "EGS certificate and private key do not match": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_signing_credentials_mismatch","message":"The EGS production certificate does not match its stored private key, so this invoice was not issued.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Renew or re-onboard this EGS unit, then retry the unchanged invoice with the same Idempotency-Key."],"invoiceStatusUrl":null}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Idempotency key reused with different payload": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"idempotency_key_reused","message":"The Idempotency-Key was already used with a different invoice payload.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":null,"errors":["Reuse the original payload, or create a new key only for a genuinely new invoice operation."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "EGS certificate and private key do not match": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_signing_credentials_mismatch","message":"The EGS production certificate does not match its stored private key, so this invoice was not issued.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Renew or re-onboard this EGS unit, then retry the unchanged invoice with the same Idempotency-Key."],"invoiceStatusUrl":null}
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Idempotency key reused with different payload": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"idempotency_key_reused","message":"The Idempotency-Key was already used with a different invoice payload.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":null,"errors":["Reuse the original payload, or create a new key only for a genuinely new invoice operation."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "EGS certificate and private key do not match": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_signing_credentials_mismatch","message":"The EGS production certificate does not match its stored private key, so this invoice was not issued.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Renew or re-onboard this EGS unit, then retry the unchanged invoice with the same Idempotency-Key."],"invoiceStatusUrl":null}
                  }
                }
              }
            }
          },
          "422": {
            "description": "A standard invoice was definitively rejected during ZATCA clearance. No printable artifacts are returned.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_rejected","message":"ZATCA rejected the standard invoice; it was not cleared and no printable artifacts are returned.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Rejected","errors":["Correct the business data and start a new invoice operation with a new Idempotency-Key; AvTax allocates its UUID, ICV and hash."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_rejected","message":"ZATCA rejected the standard invoice; it was not cleared and no printable artifacts are returned.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Rejected","errors":["Correct the business data and start a new invoice operation with a new Idempotency-Key; AvTax allocates its UUID, ICV and hash."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_rejected","message":"ZATCA rejected the standard invoice; it was not cleared and no printable artifacts are returned.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Rejected","errors":["Correct the business data and start a new invoice operation with a new Idempotency-Key; AvTax allocates its UUID, ICV and hash."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
              }
            }
          },
          "429": {
            "description": "EGS-unit rate limit exceeded. Retry after the duration specified by Retry-After and retain the original idempotency key.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              }
            }
          },
          "503": {
            "description": "Standard clearance outcome unknown, issuance commit unavailable, or committed response temporarily unavailable. Retry with the identical body and idempotency key.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Standard clearance result unknown": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_unknown","message":"A definitive ZATCA clearance result was not received.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Unknown","errors":["Retry the exact payload with the same Idempotency-Key."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "Issuance not durably committed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"issuance_not_committed","message":"The invoice was not issued because durable sequencing or temporary artifact storage was unavailable.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the identical body with the same Idempotency-Key; AvTax allocates a UUID only if the operation commits."],"invoiceStatusUrl":null}
                  },
                  "Operation committed; immediate response unavailable": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_committed_response_unavailable","message":"The invoice operation was durably committed, but its immediate response could not be completed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Pending","errors":["Retry the identical body with the same Idempotency-Key so AvTax recovers the committed UUID."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Standard clearance result unknown": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_unknown","message":"A definitive ZATCA clearance result was not received.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Unknown","errors":["Retry the exact payload with the same Idempotency-Key."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "Issuance not durably committed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"issuance_not_committed","message":"The invoice was not issued because durable sequencing or temporary artifact storage was unavailable.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the identical body with the same Idempotency-Key; AvTax allocates a UUID only if the operation commits."],"invoiceStatusUrl":null}
                  },
                  "Operation committed; immediate response unavailable": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_committed_response_unavailable","message":"The invoice operation was durably committed, but its immediate response could not be completed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Pending","errors":["Retry the identical body with the same Idempotency-Key so AvTax recovers the committed UUID."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Standard clearance result unknown": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"zatca_clearance_unknown","message":"A definitive ZATCA clearance result was not received.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Unknown","errors":["Retry the exact payload with the same Idempotency-Key."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "Issuance not durably committed": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"issuance_not_committed","message":"The invoice was not issued because durable sequencing or temporary artifact storage was unavailable.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the identical body with the same Idempotency-Key; AvTax allocates a UUID only if the operation commits."],"invoiceStatusUrl":null}
                  },
                  "Operation committed; immediate response unavailable": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_committed_response_unavailable","message":"The invoice operation was durably committed, but its immediate response could not be completed.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","zatcaSubmissionStatus":"Pending","errors":["Retry the identical body with the same Idempotency-Key so AvTax recovers the committed UUID."],"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/Invoice/operations/{idempotencyKey}": {
      "get": {
        "tags": [
          "Invoice API v2"
        ],
        "summary": "Returns the durable state and still-available delivery artifacts for one v2 operation.",
        "parameters": [
          {
            "name": "Api-Version",
            "in": "header",
            "description": "Required API contract selector. Fixed value: 2.0.",
            "required": true,
            "schema": {
              "enum": [
                "2.0"
              ],
              "type": "string",
              "default": "2.0"
            },
            "example": "2.0"
          },
          {
            "name": "idempotencyKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EgsUnitClientId",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string"
            },
            "example": "egs-unit-client-id"
          },
          {
            "name": "EgsUnitClientSecret",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string",
              "format": "password"
            },
            "example": "egs-unit-client-secret"
          }
        ],
        "responses": {
          "200": {
            "description": "Current durable state, validation messages, retry timing, and any still-available temporary delivery artifacts.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2Response"
                },
                "examples": {
                  "B2C locally issued; reporting pending": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Pending","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":0,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C reporting attempt in progress": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Submitting","isIdempotentReplay":true,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted by ZATCA": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C accepted with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; ZATCA rejected": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Rejected","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"ERROR","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C locally issued; result unknown": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Unknown","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":"2026-07-26T16:16:00Z","invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2C terminal operation after temporary artifact purge": {
                    "value": {"apiVersion":"2.0","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":"5d85e632-2f02-41ac-bdbc-95bb76a4c37b","documentId":"POS-2026-000184","documentType":"SimplifiedTaxInvoice","invoiceCounterValue":184,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"aW52b2ljZS1oYXNo","invoiceIssuanceStatus":"LocallyIssued","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":true,"temporaryXmlStatus":"Purged","temporaryXmlAvailable":false,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":null,"qrCodeString":null,"validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/0c8c38bb-8a97-4d71-89c8-b6420250db84"}
                  },
                  "B2B standard invoice cleared": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"Accepted","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  },
                  "B2B standard invoice cleared with warnings": {
                    "value": {"apiVersion":"2.0","clientRequestId":"6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351","invoiceUuid":"e3c2a2f6-8f65-45e1-9d42-a3eaf7911943","documentId":"B2B-2026-000091","documentType":"TaxInvoice","invoiceCounterValue":91,"previousInvoiceHashBase64":"cHJldmlvdXMtaW52b2ljZS1oYXNo","invoiceHashBase64":"Y2xlYXJlZC1pbnZvaWNlLWhhc2g=","invoiceIssuanceStatus":"Cleared","zatcaSubmissionStatus":"AcceptedWithWarnings","isIdempotentReplay":false,"temporaryXmlStatus":"Available","temporaryXmlAvailable":true,"temporaryXmlExpiresAtUtc":"2026-07-27T16:15:00Z","signedInvoiceXmlBase64":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","qrCodeString":"AQVBVlRheAIPMzAwMDAwMDAwMDAwMDAz","validation":{"status":"PASS","info":[],"warnings":[],"errors":[]},"zatcaSubmissionAttempts":1,"nextZatcaRetryAtUtc":null,"invoiceStatusUrl":"https://zatcaapi.avtax.net/api/Invoice/operations/6cdfa2fb-6e0c-4cf4-bdc5-3335ec41a351"}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer token missing, invalid, or expired.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              }
            }
          },
          "403": {
            "description": "The EGS unit could not be authorized for the authenticated token.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              }
            }
          },
          "404": {
            "description": "No operation belongs to this EGS unit and client request identifier.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_not_found","message":"No Invoice API v2 operation was found for this EGS unit and Idempotency-Key.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Check the Idempotency-Key and authenticate as the same EGS unit used for issuance."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_not_found","message":"No Invoice API v2 operation was found for this EGS unit and Idempotency-Key.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Check the Idempotency-Key and authenticate as the same EGS unit used for issuance."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"operation_not_found","message":"No Invoice API v2 operation was found for this EGS unit and Idempotency-Key.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Check the Idempotency-Key and authenticate as the same EGS unit used for issuance."],"invoiceStatusUrl":null}
              }
            }
          },
          "429": {
            "description": "EGS-unit rate limit exceeded. Retry after the duration specified by Retry-After and retain the original idempotency key.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              }
            }
          }
        }
      }
    },
    "/api/Invoice/{invoiceUuid}/pdf-a3": {
      "post": {
        "tags": [
          "Invoice API v2"
        ],
        "summary": "Generates a PDF/A-3 document from the signed XML returned by v2.",
        "description": "Copy signedInvoiceXmlBase64 from a previous issue or status response into the request's\r\nsignedInvoice field. The UUID and invoice hash must match the stored operation.",
        "parameters": [
          {
            "name": "Api-Version",
            "in": "header",
            "description": "Required API contract selector. Fixed value: 2.0.",
            "required": true,
            "schema": {
              "enum": [
                "2.0"
              ],
              "type": "string",
              "default": "2.0"
            },
            "example": "2.0"
          },
          {
            "name": "invoiceUuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "EgsUnitClientId",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string"
            },
            "example": "egs-unit-client-id"
          },
          {
            "name": "EgsUnitClientSecret",
            "in": "header",
            "description": "Required with a partner bearer token. Omit with an EGS-unit bearer token.",
            "schema": {
              "type": "string",
              "format": "password"
            },
            "example": "egs-unit-client-secret"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintInvoiceRequest"
              },
              "example": {"signedInvoice":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","logoUrl":"https://partner.example/assets/logo.png","pdfInvoiceBase64":null,"pdfA3Templete":"ZatcaTemplate","additionalInvoiceInformation":null}
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PrintInvoiceRequest"
              },
              "example": {"signedInvoice":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","logoUrl":"https://partner.example/assets/logo.png","pdfInvoiceBase64":null,"pdfA3Templete":"ZatcaTemplate","additionalInvoiceInformation":null}
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PrintInvoiceRequest"
              },
              "example": {"signedInvoice":"PD94bWwgdmVyc2lvbj0iMS4wIj8+PEludm9pY2UvPg==","logoUrl":"https://partner.example/assets/logo.png","pdfInvoiceBase64":null,"pdfA3Templete":"ZatcaTemplate","additionalInvoiceInformation":null}
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF/A-3 with the partner-supplied exact XML embedded as the associated invoice file.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "SignedInvoice is missing, malformed, or does not match the durable UUID and invoice hash.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Signed XML required": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"signed_invoice_required","message":"SignedInvoice is required because the partner is the permanent XML custodian.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send the exact base64 SignedInvoice saved from the issue or status response."],"invoiceStatusUrl":null}
                  },
                  "Invalid base64 or XML": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"signed_invoice_invalid","message":"SignedInvoice is not valid base64 XML.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send the unchanged SignedInvoice value returned by Invoice API v2."],"invoiceStatusUrl":null}
                  },
                  "XML UUID mismatch": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_uuid_mismatch","message":"The XML UUID does not match the invoice UUID in the route.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use the matching UUID and SignedInvoice from the same v2 response."],"invoiceStatusUrl":null}
                  },
                  "XML hash mismatch": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_hash_mismatch","message":"The supplied XML is not the exact invoice issued by this v2 operation.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Do not edit the issued XML before sending it to PDF/A-3."],"invoiceStatusUrl":null}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "examples": {
                  "Signed XML required": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"signed_invoice_required","message":"SignedInvoice is required because the partner is the permanent XML custodian.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send the exact base64 SignedInvoice saved from the issue or status response."],"invoiceStatusUrl":null}
                  },
                  "Invalid base64 or XML": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"signed_invoice_invalid","message":"SignedInvoice is not valid base64 XML.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Send the unchanged SignedInvoice value returned by Invoice API v2."],"invoiceStatusUrl":null}
                  },
                  "XML UUID mismatch": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_uuid_mismatch","message":"The XML UUID does not match the invoice UUID in the route.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use the matching UUID and SignedInvoice from the same v2 response."],"invoiceStatusUrl":null}
                  },
                  "XML hash mismatch": {
                    "value": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_hash_mismatch","message":"The supplied XML is not the exact invoice issued by this v2 operation.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Do not edit the issued XML before sending it to PDF/A-3."],"invoiceStatusUrl":null}
                  }
                }
              }
            }
          },
          "401": {
            "description": "Bearer token missing, invalid, or expired.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"authentication_required","message":"A valid EGS-unit bearer token is required.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Authenticate with /api/UserAuthentication/LoginAsEgsUnit and retry the unchanged request."],"invoiceStatusUrl":null}
              }
            }
          },
          "403": {
            "description": "The EGS unit could not be authorized for the authenticated token.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"egs_unit_access_required","message":"The authenticated identity is not authorized for this EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Login as an EGS unit associated with the target taxpayer device."],"invoiceStatusUrl":null}
              }
            }
          },
          "404": {
            "description": "The UUID does not belong to an Invoice API v2 operation for this EGS unit.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_not_found","message":"No Invoice API v2 invoice with this UUID belongs to the authenticated EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use a UUID returned to this EGS unit by Invoice API v2."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_not_found","message":"No Invoice API v2 invoice with this UUID belongs to the authenticated EGS unit.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Use a UUID returned to this EGS unit by Invoice API v2."],"invoiceStatusUrl":null}
              }
            }
          },
          "409": {
            "description": "The standard invoice has not been cleared and is not printable.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_not_printable","message":"A standard invoice cannot be rendered before ZATCA clearance.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the original clearance operation with the same Idempotency-Key; print only after invoiceIssuanceStatus is Cleared."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"invoice_not_printable","message":"A standard invoice cannot be rendered before ZATCA clearance.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the original clearance operation with the same Idempotency-Key; print only after invoiceIssuanceStatus is Cleared."],"invoiceStatusUrl":null}
              }
            }
          },
          "429": {
            "description": "EGS-unit rate limit exceeded. Retry after the duration specified by Retry-After and retain the original idempotency key.",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceV2ErrorResponse"
                },
                "example": {"apiVersion":"2.0","traceId":"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01","code":"rate_limit_exceeded","message":"The EGS-unit request rate limit was exceeded.","clientRequestId":"0c8c38bb-8a97-4d71-89c8-b6420250db84","invoiceUuid":null,"zatcaSubmissionStatus":null,"errors":["Retry the unchanged request with the same Idempotency-Key after the Retry-After interval."],"invoiceStatusUrl":null}
              }
            }
          }
        }
      }
    },
    "/api/Partner/Login": {
      "post": {
        "tags": [
          "Partner"
        ],
        "summary": "Endpoint for Partner Account Authentication",
        "description": "This endpoint, `Login`, is specifically designed for partner accounts. It provides a secure method for partners to authenticate themselves and gain access to the system.\r\n            \r\nAs a partner, you are required to provide your registered email and password. Upon successful authentication, you will be able to access the `EgsUnits` endpoints.\r\n            \r\nPlease note that the security of your account is paramount. Ensure that your credentials are kept confidential and secure.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/UserAuthentication/LoginAsEgsUnit": {
      "post": {
        "tags": [
          "UserAuthentication"
        ],
        "summary": "Endpoint for EGS Unit Authentication",
        "description": "This endpoint facilitates secure authentication for EGS units. As an EGS unit, you'll use the `ClientId` and `ClientSecret` obtained during EGS unit creation via the `/api/EgsUnits/CreateNewEgsUnit` endpoint. These credentials ensure system security and integrity.\r\n                                                                                s\r\nUpon successful authentication, a Bearer JWT token will be issued. This token serves as a key granting access to our Invoice endpoints. Additionally, authenticated EGS units gain access to `ZatcaUIData`, providing valuable insights for an enhanced user experience.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginAsEgsUnitCommand"
              },
              "example": {"clientId":"89a4ea7c-d14b-482a-8fb7-776dd7ca43cd","clientSecret":"c019869a-4072-4500-a882-141a7351c06f"}
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginAsEgsUnitCommand"
              },
              "example": {"clientId":"89a4ea7c-d14b-482a-8fb7-776dd7ca43cd","clientSecret":"c019869a-4072-4500-a882-141a7351c06f"}
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginAsEgsUnitCommand"
              },
              "example": {"clientId":"89a4ea7c-d14b-482a-8fb7-776dd7ca43cd","clientSecret":"c019869a-4072-4500-a882-141a7351c06f"}
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginAsEgsUnitResponse"
                },
                "example": {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...","expires":"2026-09-04T00:46:50.7544954Z"}
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {"errors":["The client ID or client secret you entered is incorrect. Please check and try again."]}
              }
            }
          }
        }
      }
    },
    "/api/ZatcaUIData/ReasonForAllowances": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "This endpoint retrieves all reasons for allowances.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/Countries": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "This endpoint gets a list of all countries",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/Currencies": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "This endpoint retrieves information on all available currencies.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/InvoiceTypes": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "This endpoint fetches a list of different types of invoices",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/TaxReasonCodes": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "Process a request To get all Tax Reason Codes",
        "description": "Use the 'TaxReasonCode' field in the request.\r\nThe 'Description' field is for UI purposes only and should not be used in requests.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/InvoiceIndicators": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "Process a request To get all Invoice Indicators",
        "description": "Use the 'InvoiceIndicator' field in the request.\r\nThe 'Description' field is for UI purposes only and should not be used in requests.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/ZatcaUIData/TaxCategories": {
      "get": {
        "tags": [
          "ZatcaUIData"
        ],
        "summary": "Process a request To get all Tax Categories",
        "description": "Use the 'TaxCategory' field in the request.\r\nThe 'Description' field is for UI purposes only and should not be used in requests.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AdditionalIDScheme": {
        "enum": [
          "None",
          "CRN",
          "MOM",
          "MLS",
          "Number700",
          "SAG",
          "OTH",
          "TIN",
          "NAT",
          "IQA",
          "PAS",
          "GCC"
        ],
        "type": "string"
      },
      "AdditionalInvoiceInformations": {
        "type": "object",
        "properties": {
          "signturePhotoUrl": {
            "type": "string",
            "nullable": true
          },
          "supplierBankDetails": {
            "$ref": "#/components/schemas/SupplierBankDetails"
          },
          "showConnectorBranding": {
            "type": "boolean",
            "description": "Connector-only flag. When true, the API stamps a fixed \"ZATCA Connector\"\r\ncorner badge on the rendered PDF/A-3. Hidden from Swagger and honored only\r\non the connector (Desktop) print path."
          }
        },
        "additionalProperties": false
      },
      "Buyer": {
        "type": "object",
        "properties": {
          "buyerAddress": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PartyPostalAddress"
              }
            ],
            "description": "The buyer's postal address."
          },
          "buyerName": {
            "type": "string",
            "description": "The buyer's legal or trading name.",
            "nullable": true
          },
          "buyerVatId": {
            "type": "string",
            "description": "The buyer's VAT registration number.",
            "nullable": true
          },
          "additionalIDSchemeID": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AdditionalIDScheme"
              }
            ],
            "description": "The scheme that identifies the type of additional buyer identifier."
          },
          "additionalCustomerID": {
            "type": "string",
            "description": "The buyer identifier for the selected additional ID scheme.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Currency": {
        "enum": [
          "SAR",
          "EGP",
          "USD",
          "AED",
          "AFN",
          "ALL",
          "AMD",
          "ANG",
          "AOA",
          "ARS",
          "AUD",
          "AWG",
          "AZN",
          "BAM",
          "BBD",
          "BDT",
          "BGN",
          "BHD",
          "BIF",
          "BMD",
          "BND",
          "BOB",
          "BRL",
          "BSD",
          "BTN",
          "BWP",
          "BYN",
          "BZD",
          "CAD",
          "CDF",
          "CHF",
          "CLP",
          "CNY",
          "COP",
          "CRC",
          "CUP",
          "CVE",
          "CZK",
          "DJF",
          "DKK",
          "DOP",
          "DZD",
          "ERN",
          "ETB",
          "EUR",
          "FJD",
          "FKP",
          "FOK",
          "GBP",
          "GEL",
          "GHS",
          "GIP",
          "GMD",
          "GNF",
          "GTQ",
          "GYD",
          "HKD",
          "HNL",
          "HRK",
          "HTG",
          "HUF",
          "IDR",
          "ILS",
          "INR",
          "IQD",
          "IRR",
          "ISK",
          "JMD",
          "JOD",
          "JPY",
          "KES",
          "KGS",
          "KHR",
          "KID",
          "KMF",
          "KPW",
          "KRW",
          "KWD",
          "KYD",
          "KZT",
          "LAK",
          "LBP",
          "LKR",
          "LRD",
          "LSL",
          "LYD",
          "MAD",
          "MDL",
          "MGA",
          "MKD",
          "MMK",
          "MXN",
          "MYR",
          "MZN",
          "NAD",
          "NGN",
          "NIO",
          "NOK"
        ],
        "type": "string"
      },
      "DocumentAllowanceOrChanges": {
        "type": "object",
        "properties": {
          "allowanceChargeReasonCode": {
            "type": "string",
            "description": "The code that identifies why the document-level allowance or charge was applied.",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "description": "The document-level allowance or charge amount before VAT.",
            "format": "double"
          },
          "taxCategoryCode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxCategories"
              }
            ],
            "description": "The VAT category that applies to this allowance or charge."
          },
          "taxReasonCode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxReasonCode"
              }
            ],
            "description": "The reason code for non-standard VAT treatment of this allowance or charge."
          },
          "taxReasonDescription": {
            "type": "string",
            "description": "The explanation for the selected tax reason, when required.",
            "nullable": true
          },
          "vatRate": {
            "type": "integer",
            "description": "The VAT percentage that applies to this allowance or charge.",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "DocumentLineItem": {
        "type": "object",
        "properties": {
          "lineItemName": {
            "type": "string",
            "description": "The name or description of the supplied good or service.",
            "nullable": true
          },
          "lineItemPrice": {
            "type": "number",
            "description": "The unit price before VAT and line-level discounts.",
            "format": "double",
            "default": 250
          },
          "lineItemQty": {
            "type": "number",
            "description": "The quantity supplied for this line.",
            "format": "double",
            "default": 2
          },
          "discountOnLineItem": {
            "type": "number",
            "description": "The discount amount applied to this line before VAT.",
            "format": "double"
          },
          "allowanceCode": {
            "type": "string",
            "description": "The code for a non-discount allowance applied to this line, when applicable.",
            "nullable": true
          },
          "taxCategoryCode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxCategories"
              }
            ],
            "description": "The VAT category for this line, such as standard-rated, zero-rated, exempt, or outside scope."
          },
          "taxReasonCode": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TaxReasonCode"
              }
            ],
            "description": "The reason code for non-standard VAT treatment. Use None for standard-rated supplies."
          },
          "taxReasonDescription": {
            "type": "string",
            "description": "The explanation for the selected tax reason, when required.",
            "nullable": true
          },
          "vatRateOnLineItem": {
            "type": "number",
            "description": "The VAT percentage applied to this line.",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceIndicator": {
        "enum": [
          "None",
          "ThirdParty",
          "Nominal",
          "Export",
          "Summary",
          "SelfBilled",
          "ContinuousSupply",
          "BusinessToGovernment"
        ],
        "type": "string"
      },
      "InvoiceKind": {
        "enum": [
          "TaxInvoiceCreditNote",
          "SimplifiedCreditNote",
          "TaxInvoiceDebitNote",
          "SimplifiedDebitNote",
          "PrepaymentTaxInvoice",
          "PrepaymentSimplifiedTaxInvoice",
          "TaxInvoice",
          "SimplifiedTaxInvoice"
        ],
        "type": "string"
      },
      "InvoiceV2ArtifactState": {
        "enum": [
          "NotAvailable",
          "Available",
          "Purged"
        ],
        "type": "string"
      },
      "InvoiceV2ErrorResponse": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "description": "The version of this error contract. The value is always `2.0`.",
            "nullable": true
          },
          "traceId": {
            "type": "string",
            "description": "The request trace identifier to provide when contacting support.",
            "nullable": true
          },
          "code": {
            "type": "string",
            "description": "A stable, machine-readable code that identifies the error.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "A short explanation of what prevented the request from completing.",
            "nullable": true
          },
          "clientRequestId": {
            "type": "string",
            "description": "The Idempotency-Key associated with the request, when it is known.",
            "nullable": true
          },
          "invoiceUuid": {
            "type": "string",
            "description": "The invoice UUID associated with the request, when an invoice operation exists.",
            "nullable": true
          },
          "zatcaSubmissionStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceV2SubmissionOutcome"
              }
            ],
            "description": "The last known ZATCA reporting or clearance outcome, when available."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Actionable details explaining the validation or processing failures.",
            "nullable": true
          },
          "invoiceStatusUrl": {
            "type": "string",
            "description": "The GET endpoint for recovering the operation state, when an operation was created.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceV2IssuanceStatus": {
        "enum": [
          "Validated",
          "LocallyIssued",
          "Cleared"
        ],
        "type": "string"
      },
      "InvoiceV2Response": {
        "type": "object",
        "properties": {
          "apiVersion": {
            "type": "string",
            "description": "The version of this response contract. The value is always `2.0`.",
            "nullable": true
          },
          "clientRequestId": {
            "type": "string",
            "description": "The Idempotency-Key that identifies this invoice operation.",
            "nullable": true
          },
          "invoiceUuid": {
            "type": "string",
            "description": "The UUID embedded in the issued invoice XML. Persist it with the invoice.",
            "nullable": true
          },
          "documentId": {
            "type": "string",
            "description": "The seller's invoice number supplied in the submission.",
            "nullable": true
          },
          "documentType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceKind"
              }
            ],
            "description": "The submitted invoice kind, such as a simplified B2C invoice or standard B2B invoice."
          },
          "invoiceCounterValue": {
            "type": "integer",
            "description": "The invoice counter value assigned to this invoice in the EGS-unit sequence.",
            "format": "int32"
          },
          "previousInvoiceHashBase64": {
            "type": "string",
            "description": "The Base64-encoded hash of the previous invoice in the EGS-unit sequence.",
            "nullable": true
          },
          "invoiceHashBase64": {
            "type": "string",
            "description": "The Base64-encoded hash of the exact XML issued by this operation.",
            "nullable": true
          },
          "invoiceIssuanceStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceV2IssuanceStatus"
              }
            ],
            "description": "The issuance stage reached by the invoice: validated, locally issued, or cleared."
          },
          "zatcaSubmissionStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceV2SubmissionOutcome"
              }
            ],
            "description": "The current ZATCA reporting or clearance outcome. This is separate from the issuance stage."
          },
          "isIdempotentReplay": {
            "type": "boolean",
            "description": "True when this response replays an existing operation for the same Idempotency-Key and request body."
          },
          "temporaryXmlStatus": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceV2ArtifactState"
              }
            ],
            "description": "The availability of the API's temporary delivery copy of the issued XML."
          },
          "temporaryXmlAvailable": {
            "type": "boolean",
            "description": "True when the temporary XML delivery copy is available in this response.",
            "readOnly": true
          },
          "temporaryXmlExpiresAtUtc": {
            "type": "string",
            "description": "The UTC time after which the temporary XML delivery copy may be removed. Null when no copy is available.",
            "format": "date-time",
            "nullable": true
          },
          "signedInvoiceXmlBase64": {
            "type": "string",
            "description": "The exact issued XML encoded as Base64. Persist it immediately; it may be omitted after temporary retention ends.",
            "nullable": true
          },
          "qrCodeString": {
            "type": "string",
            "description": "The QR payload read from the issued XML. It may be null when no printable XML is available.",
            "nullable": true
          },
          "validation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceV2ValidationSummary"
              }
            ],
            "description": "The validation results collected while generating the invoice and communicating with ZATCA."
          },
          "zatcaSubmissionAttempts": {
            "type": "integer",
            "description": "The number of submission attempts made to ZATCA for this operation.",
            "format": "int32"
          },
          "nextZatcaRetryAtUtc": {
            "type": "string",
            "description": "The scheduled UTC time of the next ZATCA retry. Null when no retry is scheduled.",
            "format": "date-time",
            "nullable": true
          },
          "invoiceStatusUrl": {
            "type": "string",
            "description": "The GET endpoint for retrieving the latest state of this operation.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceV2SubmissionOutcome": {
        "enum": [
          "Pending",
          "Submitting",
          "Accepted",
          "AcceptedWithWarnings",
          "Rejected",
          "Unknown"
        ],
        "type": "string"
      },
      "InvoiceV2ValidationMessage": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "description": "The message severity reported by the validator, such as INFO, WARNING, or ERROR.",
            "nullable": true
          },
          "code": {
            "type": "string",
            "description": "The validator's machine-readable rule or result code.",
            "nullable": true
          },
          "category": {
            "type": "string",
            "description": "The validation source or rule category.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "The human-readable validation detail.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "InvoiceV2ValidationSummary": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "The overall validation result reported by the API or ZATCA, such as PASS, ERROR, or UNKNOWN.",
            "nullable": true
          },
          "info": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceV2ValidationMessage"
            },
            "description": "Informational validation messages that do not require a correction.",
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceV2ValidationMessage"
            },
            "description": "Validation warnings that should be reviewed but did not prevent issuance.",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvoiceV2ValidationMessage"
            },
            "description": "Validation errors that prevented or rejected the requested operation.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LoginAsEgsUnitCommand": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "default": "adb14ccd-76d8-4d38-bf56-1d395660be0f",
            "nullable": true
          },
          "clientSecret": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LoginAsEgsUnitResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "nullable": true
          },
          "expires": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "LoginCommand": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PartyPostalAddress": {
        "type": "object",
        "properties": {
          "streetName": {
            "maxLength": 127,
            "minLength": 1,
            "type": "string",
            "description": "The street name of the address.",
            "default": "شارع الأمير محمد بن عبد العزيز",
            "nullable": true
          },
          "additionalStreetName": {
            "type": "string",
            "description": "Any additional information about the street name.",
            "default": "الرياض",
            "nullable": true
          },
          "buildingNumber": {
            "type": "string",
            "description": "The building number of the address.",
            "default": "1234",
            "nullable": true
          },
          "plotIdentification": {
            "type": "string",
            "description": "The plot identification number of the address.",
            "default": "5678",
            "nullable": true
          },
          "citySubdivisionName": {
            "type": "string",
            "description": "The subdivision name of the city for the address.",
            "default": "الرياض",
            "nullable": true
          },
          "cityName": {
            "type": "string",
            "description": "The city name of the address.",
            "default": "الرياض",
            "nullable": true
          },
          "postalZone": {
            "maxLength": 5,
            "type": "string",
            "description": "The postal zone (or zip code) of the address.",
            "default": "11564",
            "nullable": true
          },
          "countrySubentity": {
            "type": "string",
            "description": "The subentity of the country for the address.",
            "default": "منطقة الرياض",
            "nullable": true
          },
          "country": {
            "maxLength": 2,
            "type": "string",
            "description": "The country of the address. This property accepts only ISO 3166-1 alpha-2 country codes (e.g., \"SA\" for Saudi Arabia).",
            "default": "SA",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Payment": {
        "type": "object",
        "properties": {
          "paymentMethod": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentMethod"
              }
            ],
            "description": "The method used to settle the invoice, such as cash, bank transfer, or card."
          },
          "paymentAccountIdentifier": {
            "type": "string",
            "description": "The IBAN or other payment account/reference. Required when payment method is bank account.",
            "nullable": true
          },
          "paymentNote": {
            "type": "string",
            "description": "Optional payment instructions to include on the invoice.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PaymentMethod": {
        "enum": [
          "None",
          "InstrumentNotDefined",
          "InCash",
          "Credit",
          "PaymentToBankAccount",
          "BankCard"
        ],
        "type": "string"
      },
      "PdfA3Templete": {
        "enum": [
          "ZatcaTemplate",
          "SimplifiedTemplate",
          "SimplifiedTemplateAr",
          "CustomTemplate",
          "ModernTemplate",
          "ModernTemplateAr",
          "SimplifiedMixedTemplate"
        ],
        "type": "string"
      },
      "PrepaymentDetail": {
        "type": "object",
        "properties": {
          "sequentialInvoiceUUID": {
            "type": "string",
            "description": "The UUID of the invoice that records the related prepayment.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PrintInvoiceRequest": {
        "type": "object",
        "properties": {
          "signedInvoice": {
            "type": "string",
            "description": "Base64-encoded XML representation of the invoice.",
            "nullable": true
          },
          "logoUrl": {
            "type": "string",
            "nullable": true
          },
          "pdfInvoiceBase64": {
            "type": "string",
            "nullable": true
          },
          "pdfA3Templete": {
            "$ref": "#/components/schemas/PdfA3Templete"
          }
        },
        "additionalProperties": false,
        "description": "Represents the request for printing an invoice."
      },
      "SubmitInvoiceV2Command": {
        "type": "object",
        "properties": {
          "validateWarnings": {
            "type": "boolean",
            "description": "Whether to run warning-level ZATCA validation rules. Set false only when warnings are intentionally excluded.",
            "default": true,
            "example": true
          },
          "documentType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceKind"
              }
            ],
            "description": "The invoice document type, such as a simplified B2C invoice, standard B2B invoice, credit note, or debit note."
          },
          "invoiceIndicator": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceIndicator"
              }
            ],
            "description": "The business scenario for the invoice, such as third-party, self-billed, export, summary, or none."
          },
          "currency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Currency"
              }
            ],
            "description": "The currency used for invoice amounts. Use SAR unless another permitted invoice currency applies."
          },
          "exchangeRate": {
            "type": "number",
            "description": "The exchange rate used when the invoice currency is not Saudi riyal. Leave null when it does not apply.",
            "format": "double",
            "nullable": true
          },
          "documentIssueDateTime": {
            "type": "string",
            "description": "The date and time the invoice is issued, expressed in UTC.",
            "format": "date-time",
            "example": "2024-01-01T00:00:00Z"
          },
          "supplyDate": {
            "type": "string",
            "description": "The date goods or services were supplied. Leave null when it is the same as the issue date.",
            "format": "date-time",
            "default": null,
            "nullable": true
          },
          "buyer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Buyer"
              }
            ],
            "description": "The buyer's identity and postal address. Supply the information required for the selected invoice type."
          },
          "documentLineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentLineItem"
            },
            "description": "The invoice lines. Include the item, quantity, unit price, and VAT treatment for each supplied good or service.",
            "nullable": true
          },
          "referenceId": {
            "type": "string",
            "description": "An optional business reference for a related invoice, document, or transaction.",
            "nullable": true
          },
          "documentId": {
            "type": "string",
            "description": "The seller's unique invoice number.",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "description": "An optional note to include on the invoice.",
            "nullable": true
          },
          "orderReferenceId": {
            "type": "string",
            "description": "The buyer's purchase-order or order reference, when available.",
            "nullable": true
          },
          "documentAllowanceOrChange": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentAllowanceOrChanges"
            },
            "description": "Document-level allowances or charges, including their VAT treatment.",
            "nullable": true
          },
          "invoiceTypeReason": {
            "type": "string",
            "description": "The reason for a credit note, debit note, or other invoice type that needs an explanation.",
            "nullable": true
          },
          "payment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Payment"
              }
            ],
            "description": "The payment method and any payment account or instructions."
          },
          "prepaymentDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrepaymentDetail"
            },
            "description": "References to invoices that record payments made in advance.",
            "nullable": true
          },
          "payableRoundingAmount": {
            "type": "number",
            "description": "Invoice-level rounding amount (BT-114), included in the amount due for payment (BT-115).",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Invoice API v2 request body. Invoice API v1 remains unchanged; v2 supports invoice-level\r\npayable rounding and the unit-price precision permitted by ZATCA."
      },
      "SupplierBankDetails": {
        "type": "object",
        "properties": {
          "bankName": {
            "type": "string",
            "nullable": true
          },
          "accountName": {
            "type": "string",
            "nullable": true
          },
          "accountNumber": {
            "type": "string",
            "nullable": true
          },
          "iban": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxCategories": {
        "enum": [
          "None",
          "E",
          "S",
          "Z",
          "O"
        ],
        "type": "string",
        "description": " Represents tax categories for requests\r\n information to support the following VAT use cases:\r\n- Invoices for supplies for which VAT is charged\r\n- Invoices for supplies for which VAT is not charged(exempt supplies,\r\nZero rated Supplies, out of scope supplies)\r\n- Invoices for several supplies which part of them are taxable and part\r\nof them are not, so VAT to be considered at line level"
      },
      "TaxReasonCode": {
        "enum": [
          "None",
          "VATEX_SA_29",
          "VATEX_SA_29_7",
          "VATEX_SA_30",
          "VATEX_SA_32",
          "VATEX_SA_33",
          "VATEX_SA_34_1",
          "VATEX_SA_34_2",
          "VATEX_SA_34_3",
          "VATEX_SA_34_4",
          "VATEX_SA_34_5",
          "VATEX_SA_35",
          "VATEX_SA_36",
          "VATEX_SA_EDU",
          "VATEX_SA_HEA",
          "VATEX_SA_MLTRY",
          "VATEX_SA_DIPLOMAT",
          "VATEX_SA_DUTYFREE",
          "VATEX_SA_ROYALDECREE",
          "VATEX_SA_32_bis",
          "VATEX_SA_OOS"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Bearer token from POST /api/UserAuthentication/LoginAsEgsUnit or POST /api/Partner/Login. Partner tokens also require EgsUnitClientId and EgsUnitClientSecret.",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}