Generated from the published OpenAPI document (version 1.4.0). https://fatoora.tw.sa/api/v1
Credit and debit notes, the only way to correct an issued invoice.
/invoices/{invoice}/notes
Credit and debit notes of an invoice
Requires scope
invoices:read
Parameters
| Field | Type | Description |
|---|---|---|
invoice
required
|
integer · path |
Responses
- 200 The notes, oldest first.
-
default
An error.
error.codesays which.
/invoices/{invoice}/notes
Raise a credit or debit note on an issued invoice
Requires scope
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.
Parameters
| Field | Type | Description |
|---|---|---|
invoice
required
|
integer · path | |
Idempotency-Key
|
string · header | 8 to 255 visible ASCII characters, unique per operation you mean to perform. |
Request body application/json
| Field | Type | Description |
|---|---|---|
type
required
|
string: credit, debit | |
reason
required
|
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
required
|
array<object> | |
items[].description
required
|
string | |
items[].quantity
required
|
number | |
items[].unit_price
required
|
number | |
items[].vat_rate
required
|
number | One of the invoice's own VAT rates. |
items[].tax_rate_id
|
integer | null | |
items[].vat_exemption_code
|
string | null |
Responses
- 201 The note.
-
default
An error.
error.codesays which.
/notes/{note}
Get a credit or debit note
Requires scope
invoices:read
Parameters
| Field | Type | Description |
|---|---|---|
note
required
|
integer · path |
Responses
- 200 The note.
-
default
An error.
error.codesays which.
/notes/{note}/issue
Issue a draft note
Requires scope
invoices:issue
Irreversible. A note already issued answers 200 with already_issued: true.
Parameters
| Field | Type | Description |
|---|---|---|
note
required
|
integer · path | |
Idempotency-Key
|
string · header | 8 to 255 visible ASCII characters, unique per operation you mean to perform. |
Responses
- 200 The issued note.
-
default
An error.
error.codesays which.
/notes/{note}/pdf
Download the note PDF
Requires scope
invoices:download
Parameters
| Field | Type | Description |
|---|---|---|
note
required
|
integer · path |
Responses
- 200 The PDF.
-
default
An error.
error.codesays which.
/notes/{note}/xml
Download the note's legal XML
Requires scope
invoices:download
Parameters
| Field | Type | Description |
|---|---|---|
note
required
|
integer · path |
Responses
- 200 The XML.
-
default
An error.
error.codesays which.
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.