Generated from the published OpenAPI document (version 1.4.0). https://fatoora.tw.sa/api/v1
Basics
| Base URL | https://fatoora.tw.sa/api/v1 |
| Format | JSON over HTTPS. Send Accept: application/json. |
| Language | Messages in Arabic, or English with Accept-Language: en; the answer's Content-Language says which. See Errors. |
| Authentication | Authorization: Bearer <key>. See Authentication. |
| Success | {"ok": true, "data": {…}} |
| Error | {"ok": false, "error": {"code", "message", "details"}}. See Errors. |
| Amounts | JSON numbers rounded to 2 decimal places. |
| Dates | YYYY-MM-DD; timestamps are ISO 8601. |
| Versioning | Changes within v1 are additive and listed in the changelog. A breaking change would come under a new version path. A path naming any other version answers 400 unsupported_api_version. |
Endpoints
-
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
Webhook events
-
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
Ready to build?
API access is part of the Business and Enterprise plans. Create a key in Settings → API keys and make your first call in minutes.