Endpoints
GET /v1/debit-notes/
GET /v1/debit-notes/:id/
POST /v1/debit-notes/
PATCH /v1/debit-notes/:id/
DELETE /v1/debit-notes/:id/
GET /v1/debit-notes/:id/download/
GET /v1/debit-notes/:id/line-items/
POST /v1/debit-notes/:id/line-items/:line_item_id/
PATCH /v1/debit-notes/:id/line-items/:line_item_id/
DELETE /v1/debit-notes/:id/line-items/:line_item_id/
Debit Note object
Attributes | Type | Description |
---|
id | string | The id of the object. |
amount | number | The debit note amount. |
contact | string | The id of the contact. |
currency | string | The currency used in the debit note. |
debit_note_number | string | The debit note number. |
debit_note_date | string | The date of the debit note. |
language | string | The language used in the debit note. |
line_items | array | The line items of the debit note. |
reference | string | The reference of the debit note. |
status | string | The status of the debit note. |
tax_amount | number | The tax amount. |
tax_amount_type | string | Either TAX_INCLUSIVE or TAX_EXCLUSIVE . |
Example
{
"amount": 115.0,
"contact": "co_HS9cspuVZJUHdqVsS9CFfY",
"currency": "AED",
"id": "cn_YEdmVKecVi45RYWcrt2rJe",
"debit_note_date": "2022-10-05",
"debit_note_number": "DN-000100",
"language": "en",
"line_items": [
{
"account": "acc_7jpGSFEGGF9cK39vwoDPBt",
"description": "Line item",
"id": "cnli_Zhf8cUxzjiRRs8Ga7MCgWE",
"line_amount": 115.0,
"quantity": 1.0,
"tax_amount": 15.0,
"tax_rate": "tax_c8TkJLeXZYJmWuSjqGzGzj",
"unit_amount": 100.0
}
],
"reference": "",
"status": "DRAFT",
"tax_amount": 15.0,
"tax_amount_type": "TAX_EXCLUSIVE"
}
Get debit note
Endpoint
GET /v1/debit-notes/:id/
Response sample
{
"amount": 115.0,
"currency": "AED",
"id": "dn_YEdmVKecVi45RYWcrt2rJe",
"debit_note_date": "2022-10-05",
"debit_note_number": "DN-000100",
"language": "en",
"line_items": [
{
"account": "acc_7jpGSFEGGF9cK39vwoDPBt",
"description": "Line item",
"id": "dnli_Zhf8cUxzjiRRs8Ga7MCgWE",
"line_amount": 115.0,
"quantity": 1.0,
"tax_amount": 15.0,
"tax_rate": "tax_c8TkJLeXZYJmWuSjqGzGzj",
"unit_amount": 100.0
}
],
"reference": "",
"status": "DRAFT",
"tax_amount": 15.0,
"tax_amount_type": "TAX_EXCLUSIVE"
}
List debit notes
Endpoint
GET /v1/debit-notes/
Filters
Query param | Type | Description |
---|
contact | string | The id of the contact. |
debit_note_date | string | The debit note date in YYYY-MM-DD e.g. 2021-01-01 . |
Request
curl --location \
--request GET 'https://api.wafeq.com/v1/credit-notes/' \
--header 'Authorization: Api-Key <api_key>' \
--header 'Content-Type: application/json'
Create debit note
Endpoint
POST /v1/debit-notes/
Request body
Attributes | Type | Description |
---|
amount | number | The debit note amount. |
contact | string | The id of the contact. |
currency | string | The currency used in the debit note. |
debit_note_number | string | The debit note number. |
debit_note_date | string | The date of the debit note. |
language | string | The language used in the debit note. |
line_items | array | The line items of the debit note. |
reference | string | The reference of the debit note. |
tax_amount | number | The tax amount. |
tax_amount_type | string | Either TAX_INCLUSIVE or TAX_EXCLUSIVE . |
Request
curl --location \
--request POST 'https://api.wafeq.com/v1/credit-notes/' \
--header 'Authorization: Api-Key <api_key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"contact": "<contact>",
"currency": "SAR",
"credit_note_date": "2022-07-19",
"language": "en",
"line_items": [
{
"account": "<account>",
"description": "Line Item",
"quantity": 1,
"tax_rate": "<tax_rate>",
"unit_amount": 100
}
],
"reference": "A reference to be reused",
"tax_amount_type": "TAX_EXCLUSIVE"
}'
Update debit note
PATCH /v1/debit-notes/:id/
Request body
Attributes | Type | Description |
---|
id | string | The id of the object. |
amount | number | The debit note amount. |
contact | string | The id of the contact. |
currency | string | The currency used in the debit note. |
debit_note_number | string | The debit note number. |
debit_note_date | string | The date of the debit note. |
language | string | The language used in the debit note. |
reference | string | The reference of the debit note. |
tax_amount_type | string | Either TAX_INCLUSIVE or TAX_EXCLUSIVE . |
To update the line items, you need to use the debit notes line items endpoints.
Delete debit note
DELETE /v1/debit-notes/:id/
Download debit note
GET /v1/debit-notes/:id/download/
Debit Note line item object
Attribute | Type | Description |
---|
account | string | The id of the account. |
description | string | The description of the line item. |
id | string | The id of the object. |
line_amount | number | The line amount. |
quantity | number | The quantity. |
tax_amount | number | The tax amount. |
tax_rate | string | The id of the tax rate. |
unit_amount | number | The unit amount. |
Example
{
"account": "acc_7jpGSFEGGF9cK39vwoDPBt",
"description": "Line item",
"id": "dnli_Zhf8cUxzjiRRs8Ga7MCgWE",
"line_amount": 115.0,
"quantity": 1.0,
"tax_amount": 15.0,
"tax_rate": "tax_c8TkJLeXZYJmWuSjqGzGzj",
"unit_amount": 100.0
}
Get debit note line item
Endpoint
POST /v1/debit-notes/:id/line-item/
Response sample
{
"account": "acc_7jpGSFEGGF9cK39vwoDPBt",
"description": "Line item",
"id": "dnli_Zhf8cUxzjiRRs8Ga7MCgWE",
"line_amount": 115.0,
"quantity": 1.0,
"tax_amount": 15.0,
"tax_rate": "tax_c8TkJLeXZYJmWuSjqGzGzj",
"unit_amount": 100.0
}
List debit note line items
Endpoint
GET /v1/debit-notes/:id/line-items/
Filters
Query param | Type | Description |
---|
account | string | The id of the account. |
Create debit note line item
Endpoint
POST /v1/debit-notes/:id/line-items/
Request body
Attributes | Type | Description |
---|
account | string | The id of the account. |
description | string | The description of the line item. |
quantity | number | The quantity. |
tax_rate | string | The id of the tax rate. |
unit_amount | number | The unit amount. |
Update debit note line item
PATCH /v1/debit-notes/:id/line-items/:line_item_id/
Request body
Attributes | Type | Description |
---|
account | string | The id of the account. |
description | string | The description of the line item. |
quantity | number | The quantity. |
tax_rate | string | The id of the tax rate. |
unit_amount | number | The unit amount. |
Delete debit note line item
DELETE /v1/debit-notes/:id/line-items/:line_item_id/