مولَّد من مستند OpenAPI المنشور (الإصدار 1.4.0). https://fatoora.tw.sa/api/v1
الأساسيات
| العنوان الأساسي | https://fatoora.tw.sa/api/v1 |
| الصيغة | JSON عبر HTTPS. أرسل Accept: application/json. |
| اللغة | الرسائل بالعربية، أو بالإنجليزية مع Accept-Language: en، وتذكر ترويسة Content-Language في الإجابة أيهما. راجع الأخطاء. |
| المصادقة | Authorization: Bearer <key>. راجع المصادقة. |
| النجاح | {"ok": true, "data": {…}} |
| الخطأ | {"ok": false, "error": {"code", "message", "details"}}. راجع الأخطاء. |
| المبالغ | أرقام JSON مقرّبة إلى منزلتين عشريتين. |
| التواريخ | YYYY-MM-DD، والطوابع الزمنية بمعيار ISO 8601. |
| الإصدارات | التغييرات داخل v1 إضافية فقط وتُدرج في سجل التغييرات. أي تغيير يكسر التوافق يأتي تحت مسار إصدار جديد. والمسار الذي يذكر أي إصدار آخر يعيد 400 unsupported_api_version. |
نقاط النهاية
-
GET
/invoicesList invoices -
POST
/invoicesCreate an invoice, as a draft or issued at once -
GET
/invoices/{invoice}Get an invoice -
GET
/invoices/{invoice}/statusWhere an invoice stands -
POST
/invoices/{invoice}/validateCheck whether a draft can be issued -
POST
/invoices/{invoice}/issueIssue a draft -
GET
/invoices/{invoice}/pdfDownload the invoice PDF -
GET
/invoices/{invoice}/xmlDownload the legal XML -
GET
/invoices/{invoice}/paymentsCustomer payments of an invoice -
POST
/invoices/{invoice}/paymentsRecord a customer payment on an issued invoice
Credit and debit notes, the only way to correct an issued invoice.
-
GET
/invoices/{invoice}/notesCredit and debit notes of an invoice -
POST
/invoices/{invoice}/notesRaise a credit or debit note on an issued invoice -
GET
/notes/{note}Get a credit or debit note -
POST
/notes/{note}/issueIssue a draft note -
GET
/notes/{note}/pdfDownload the note PDF -
GET
/notes/{note}/xmlDownload the note's legal XML
Signed HTTPS notifications of the company's events, the endpoints that receive them, and the events list for polling.
-
GET
/eventsList recent events -
GET
/webhook-endpointsList webhook endpoints -
POST
/webhook-endpointsRegister a webhook endpoint -
GET
/webhook-endpoints/{endpoint}Get a webhook endpoint -
PATCH
/webhook-endpoints/{endpoint}Change a webhook endpoint -
DELETE
/webhook-endpoints/{endpoint}Remove a webhook endpoint -
POST
/webhook-endpoints/{endpoint}/rotate-secretRotate an endpoint's signing secret -
POST
/webhook-endpoints/{endpoint}/testSend a test event -
GET
/webhook-endpoints/{endpoint}/deliveriesList an endpoint's deliveries -
POST
/webhook-deliveries/{delivery}/redeliverRedeliver an event
أحداث Webhooks
-
invoice.createdAn invoice draft was created
-
invoice.issuedAn invoice was issued
-
invoice.zatca_status_changedAn invoice's ZATCA status changed
-
invoice.payment_recordedA payment was recorded, voided or deleted
-
invoice.paidAn invoice was paid in full
-
invoice.overdueAn invoice became overdue
-
invoice.cancelledA draft invoice was cancelled
-
credit_note.issuedA credit note was issued
-
debit_note.issuedA debit note was issued
-
credit_note.zatca_status_changedA credit note's ZATCA status changed
-
debit_note.zatca_status_changedA debit note's ZATCA status changed
-
customer.createdA customer was added
-
customer.updatedA customer was changed
-
pingA test event you sent
جاهز للبدء؟
الوصول إلى الواجهة البرمجية ضمن باقات: الأعمال والمؤسسات. أنشئ مفتاحًا من الإعدادات ← مفاتيح API وأرسل أول طلب خلال دقائق.