API Reference

Credit Notes

Endpoints

GET /v1/credit-notes/
GET /v1/credit-notes/:id/
POST /v1/credit-notes/
PATCH /v1/credit-notes/:id/
DELETE /v1/credit-notes/:id/
GET /v1/credit-notes/:id/download/
GET /v1/credit-notes/:id/line-items/
POST /v1/credit-notes/:id/line-items/:line_item_id/
PATCH /v1/credit-notes/:id/line-items/:line_item_id/
DELETE /v1/credit-notes/:id/line-items/:line_item_id/

Credit Note object

AttributesTypeDescription
idstringThe id of the object.
amountnumberThe credit note amount.
contactstringThe id of the contact.
currencystringThe currency used in the credit note.
credit_note_numberstringThe credit note number.
credit_note_datestringThe date of the credit note.
languagestringThe language used in the credit note.
line_itemsarrayThe line items of the credit note.
place_of_supplystringOnly required if your organization is in the UAE: one of ABU_DHABI, AJMAN, DUBAI, FUJAIRAH, RAS_AL_KHAIMAH, SHARJAH, UMM_AL_QUWAIN or OUTSIDE_UAE
referencestringThe reference of the credit note.
statusstringThe status of the credit note.
tax_amountnumberThe tax amount.
tax_amount_typestringEither TAX_INCLUSIVE or TAX_EXCLUSIVE.

Example

{
    "amount": 115.0,
    "contact": "co_HS9cspuVZJUHdqVsS9CFfY",
    "currency": "AED",
    "id": "cn_YEdmVKecVi45RYWcrt2rJe",
    "credit_note_date": "2022-10-05",
    "credit_note_number": "CN-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
        }
    ],
    "place_of_supply": "SHARJAH",
    "reference": "",
    "status": "DRAFT",
    "tax_amount": 15.0,
    "tax_amount_type": "TAX_EXCLUSIVE"
}

Get credit note

Endpoint

GET /v1/credit-notes/:id/

Response sample

{
    "amount": 115.0,
    "contact": "co_HS9cspuVZJUHdqVsS9CFfY",
    "currency": "AED",
    "id": "cn_YEdmVKecVi45RYWcrt2rJe",
    "credit_note_date": "2022-10-05",
    "credit_note_number": "CN-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"
}

List credit notes

Endpoint

GET /v1/credit-notes/

Filters

Query paramTypeDescription
contactstringThe id of the contact.
credit_note_datestringThe credit 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 credit note

Endpoint

POST /v1/credit-notes/

Request body

AttributesTypeDescription
amountnumberThe credit note amount. (Required)
contactstringThe id of the contact. (Required)
currencystringThe currency used in the credit note. (Required)
credit_note_numberstringThe credit note number. (Required)
credit_note_datestringThe date of the credit note. (Required)
languagestringThe language used in the credit note.
line_itemsarrayThe line items of the credit note. (Required)
place_of_supplystringThe place of supply in the UAE (Required if and only if the organization is in the UAE)
referencestringThe reference of the credit note.
tax_amountnumberThe tax amount.
tax_amount_typestringEither 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 credit note

PATCH /v1/credit-notes/:id/

Request body

AttributesTypeDescription
idstringThe id of the object.
amountnumberThe credit note amount.
contactstringThe id of the contact.
currencystringThe currency used in the credit note.
credit_note_numberstringThe credit note number.
credit_note_datestringThe date of the credit note.
languagestringThe language used in the credit note.
place_of_supplystringThe place of supply in the UAE
referencestringThe reference of the credit note.
tax_amount_typestringEither TAX_INCLUSIVE or TAX_EXCLUSIVE.

To update the line items, you need to use the credit notes line items endpoints.

Delete credit note

DELETE /v1/credit-notes/:id/

Download credit note

GET /v1/credit-notes/:id/download/

Credit Note line item object

AttributeTypeDescription
accountstringThe id of the account.
descriptionstringThe description of the line item.
idstringThe id of the object.
line_amountnumberThe line amount.
quantitynumberThe quantity.
tax_amountnumberThe tax amount.
tax_ratestringThe id of the tax rate.
unit_amountnumberThe unit amount.

Example

{
    "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
}

Get credit note line item

Endpoint

POST /v1/credit-notes/:id/line-item/

Response sample

{
    "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
}

List credit note line items

Endpoint

GET /v1/credit-notes/:id/line-items/

Filters

Query paramTypeDescription
accountstringThe id of the account.

Create credit note line item

Endpoint

POST /v1/credit-notes/:id/line-items/

Request body

AttributesTypeDescription
accountstringThe id of the account.
descriptionstringThe description of the line item.
quantitynumberThe quantity.
tax_ratestringThe id of the tax rate.
unit_amountnumberThe unit amount.

Update credit note line item

PATCH /v1/credit-notes/:id/line-items/:line_item_id/

Request body

AttributesTypeDescription
accountstringThe id of the account.
descriptionstringThe description of the line item.
quantitynumberThe quantity.
tax_ratestringThe id of the tax rate.
unit_amountnumberThe unit amount.

Delete credit note line item

DELETE /v1/credit-notes/:id/line-items/:line_item_id/