المطورون

مرجع الواجهة البرمجية: الإشعارات الدائنة والمدينة

مولَّد من مستند OpenAPI المنشور (الإصدار 1.4.0). https://fatoora.tw.sa/api/v1

Credit and debit notes, the only way to correct an issued invoice.

GET /invoices/{invoice}/notes

Credit and debit notes of an invoice

الصلاحية المطلوبة invoices:read

المعاملات

الحقل النوع الوصف
invoice مطلوب integer · path

الردود

  • 200 The notes, oldest first.
  • default An error. error.code says which.
POST /invoices/{invoice}/notes

Raise a credit or debit note on an issued invoice

الصلاحية المطلوبة invoices:draft

A draft unless issue is true, which also needs invoices:issue. A reason is required, and a credit can never exceed what is left on the invoice (credit_exceeds_invoice). If issuing fails, no note is kept.

المعاملات

الحقل النوع الوصف
invoice مطلوب integer · path
Idempotency-Key string · header 8 to 255 visible ASCII characters, unique per operation you mean to perform.

محتوى الطلب application/json

الحقل النوع الوصف
type مطلوب string: credit, debit
reason مطلوب string Why the invoice is corrected; printed on the note.
issue_date string | null (date) Defaults to today.
notes string | null
issue boolean | null
items مطلوب array<object>
items[].description مطلوب string
items[].quantity مطلوب number
items[].unit_price مطلوب number
items[].vat_rate مطلوب number One of the invoice's own VAT rates.
items[].tax_rate_id integer | null
items[].vat_exemption_code string | null

الردود

  • 201 The note.
  • default An error. error.code says which.
GET /notes/{note}

Get a credit or debit note

الصلاحية المطلوبة invoices:read

المعاملات

الحقل النوع الوصف
note مطلوب integer · path

الردود

  • 200 The note.
  • default An error. error.code says which.
POST /notes/{note}/issue

Issue a draft note

الصلاحية المطلوبة invoices:issue

Irreversible. A note already issued answers 200 with already_issued: true.

المعاملات

الحقل النوع الوصف
note مطلوب integer · path
Idempotency-Key string · header 8 to 255 visible ASCII characters, unique per operation you mean to perform.

الردود

  • 200 The issued note.
  • default An error. error.code says which.
GET /notes/{note}/pdf

Download the note PDF

الصلاحية المطلوبة invoices:download

المعاملات

الحقل النوع الوصف
note مطلوب integer · path

الردود

  • 200 The PDF.
  • default An error. error.code says which.
GET /notes/{note}/xml

Download the note's legal XML

الصلاحية المطلوبة invoices:download

المعاملات

الحقل النوع الوصف
note مطلوب integer · path

الردود

  • 200 The XML.
  • default An error. error.code says which.

العودة إلى مرجع الواجهة البرمجية

جاهز للبدء؟

الوصول إلى الواجهة البرمجية ضمن باقات: الأعمال والمؤسسات. أنشئ مفتاحًا من الإعدادات ← مفاتيح API وأرسل أول طلب خلال دقائق.