Saudi einvoice

From Moshe-ship/hurmoz · View interactive version

Saudi einvoice is an AI agent skill from the GitHub repository Moshe-ship/hurmoz. ZATCA e-invoicing integration for Saudi tax compliance (Fatoorah platform)

How to use this skill

Skill file

الفوترة الإلكترونية — زاتكا (فاتورة)

تنبيه: استخدم بيانات اختبار فقط. لا تستخدم هويات وطنية حقيقية أو توكنات دفع حية أثناء التجربة. استخدم بيئة الاختبار (sandbox) دائماً. احذف السجلات بعد الانتهاء.

منصة فاتورة الرسمية من هيئة الزكاة والضريبة والجمارك (ZATCA) للفوترة الإلكترونية في المملكة العربية السعودية.

الإعداد

  1. سجّل في بوابة الاختبار: https://sandbox.zatca.gov.sa
  2. احصل على شهادة الامتثال (Compliance CSID) من البوابة
  3. اضبط المتغير: export ZATCA_API_KEY=your_base64_certificate

المصادقة تتم عبر Basic Auth باستخدام الشهادة المشفرة بـ base64:

Authorization: Basic <base64(certificate:secret)>

الحصول على شهادة الامتثال (Compliance CSID)

curl -s -X POST "https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance" \
  -H "Content-Type: application/json" \
  -H "Accept-Version: V2" \
  -H "Authorization: Basic $ZATCA_API_KEY" \
  -d '{
    "csr": "BASE64_ENCODED_CSR"
  }'

إبلاغ فاتورة مبسطة (B2C)

الفواتير المبسطة (أفراد) تُرسل عبر نظام الإبلاغ (Reporting):

curl -s -X POST "https://gw-fatoora.zatca.gov.sa/e-invoicing/core/invoices/reporting/single" \
  -H "Content-Type: application/json" \
  -H "Accept-Version: V2" \
  -H "Accept-Language: ar" \
  -H "Authorization: Basic $ZATCA_API_KEY" \
  -d '{
    "invoiceHash": "INVOICE_HASH",
    "uuid": "INVOICE_UUID",
    "invoice": "BASE64_ENCODED_XML"
  }'

اعتماد فاتورة ضريبية (B2B)

الفواتير الضريبية (شركات) تُرسل عبر نظام الاعتماد (Clearance):

curl -s -X POST "https://gw-fatoora.zatca.gov.sa/e-invoicing/core/invoices/clearance/single" \
  -H "Content-Type: application/json" \
  -H "Accept-Version: V2" \
  -H "Accept-Language: ar" \
  -H "Authorization: Basic $ZATCA_API_KEY" \
  -d '{
    "invoiceHash": "INVOICE_HASH",
    "uuid": "INVOICE_UUID",
    "invoice": "BASE64_ENCODED_XML"
  }'

فحص الامتثال

curl -s -X POST "https://gw-fatoora.zatca.gov.sa/e-invoicing/core/compliance/invoices" \
  -H "Content-Type: application/json" \
  -H "Accept-Version: V2" \
  -H "Accept-Language: ar" \
  -H "Authorization: Basic $ZATCA_API_KEY" \
  -d '{
    "invoiceHash": "INVOICE_HASH",
    "uuid": "INVOICE_UUID",
    "invoice": "BASE64_ENCODED_XML"
  }'

أنواع الفواتير

| النوع | الوصف | الآلية |

|-------|-------|--------|

| فاتورة مبسطة (B2C) | للأفراد | إبلاغ (Reporting) |

| فاتورة ضريبية (B2B) | للشركات | اعتماد (Clearance) |

| إشعار دائن | إرجاع/خصم | نفس آلية الفاتورة الأصلية |

| إشعار مدين | إضافة مبلغ | نفس آلية الفاتورة الأصلية |

عرض النتيجة

نتيجة الفوترة الإلكترونية:

متى تستخدم

تنبيه

المراجع

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.