API Reference

Accounts

Represents an account from your Chart of Accounts.

Endpoints

GET /v1/accounts/
GET /v1/accounts/:id/
POST /v1/accounts/
PATCH /v1/accounts/:id/
DELETE /v1/accounts/:id/

The account object

AttributesTypeDescription
idstringid of the object.
account_codestringThe account code.
name_enstringThe name of the account in English.
name_arstringThe name of the account in Arabic.
classificationstringOne of REVENUE, EXPENSE, ASSET, LIABILITY, EQUITY.
sub_classificationstringOne of INCOME, OTHER_INCOME, COGS, OPERATING_EXPENSE, NON_OPERATING_EXPENSE, CASH_EQUIVALENTS, CURRENT_ASSET, NON_CURRENT_ASSET, FIXED_ASSET, CURRENT_LIABILITY, NON_CURRENT_LIABILITY, PAID_IN_CAPITAL, RETAINED_EARNINGS, ACCUMULATED_OTHER_COMPREHENSIVE_INCOME, TREASURY_STOCK, OPENING_BALANCE_EQUITY, OWNERS_EQUITY.
is_payment_enabledtrue, falsetrue if the account is allowed to be set on a paid_through_account field, false otherwise.
is_systemtrue, falsetrue if the account is a system account.

Example

{
    "id": "acc_x908asdlmn298123lnm",
    "account_code": "200",
    "name_en": "Sales",
    "name_ar": "مبيعات",
    "is_system": false,
    "classification": "REVENUE",
    "sub_classification": "INCOME",
    "is_payment_enabled": false
}

List accounts

GET /v1/accounts/

Request

curl --location \
    --request GET 'https://api.wafeq.com/v1/accounts/' \
    --header 'Authorization: Api-Key <api_key>' \
    --header 'Content-Type: application/json'

Filters

Query paramPossible valuesDescription
classificationOne of REVENUE, EXPENSE, ASSET, LIABILITY, EQUITYThe classification of the account.
include_systemtrue, falsetrue if you want to include system accounts in the response, false otherwise. Defaults to false.
is_payment_enabledtrue, falsetrue if the account is allowed to be set on a paid_through_account field, false otherwise.

Request

curl --location \
    --request GET 'https://api.wafeq.com/v1/accounts/?is_payment_enabled=true' \
    --header 'Authorization: Api-Key <api_key>' \
    --header 'Content-Type: application/json'

Create account

POST /v1/accounts/

Request body

AttributesTypeDescription
name_enstringThe name of the account in English.
name_arstringThe name of the account in Arabic.
sub_classificationstringOne of INCOME, OTHER_INCOME, COGS, OPERATING_EXPENSE, NON_OPERATING_EXPENSE, CASH_EQUIVALENTS, CURRENT_ASSET, NON_CURRENT_ASSET, FIXED_ASSET, CURRENT_LIABILITY, NON_CURRENT_LIABILITY, PAID_IN_CAPITAL, RETAINED_EARNINGS, ACCUMULATED_OTHER_COMPREHENSIVE_INCOME, TREASURY_STOCK, OPENING_BALANCE_EQUITY, OWNERS_EQUITY.
account_codestring(Optional) The account code.

Request

curl --location \
    --request POST 'https://api.wafeq.com/v1/accounts/' \
    --header 'Authorization: Api-Key <api_key>' \
    --header 'Content-Type: application/json' \
      --data-raw '{
	"name_en": "Test account from API",
	"name_ar": "حساب تجريبي من الAPI",
	"sub_classification": "OPERATING_EXPENSE",
	"account_code": "1234",
	"is_payment_enabled": true
}'

Update account

PATCH /v1/accounts/:id/

If the account is already tied to a journal, you can only modify is_payment_enabled and account_code.

Request body

AttributesTypeDescription
name_enstringThe name of the account in English.
name_arstringThe name of the account in Arabic.
sub_classificationstringOne of INCOME, OTHER_INCOME, COGS, OPERATING_EXPENSE, NON_OPERATING_EXPENSE, CASH_EQUIVALENTS, CURRENT_ASSET, NON_CURRENT_ASSET, FIXED_ASSET, CURRENT_LIABILITY, NON_CURRENT_LIABILITY, PAID_IN_CAPITAL, RETAINED_EARNINGS, ACCUMULATED_OTHER_COMPREHENSIVE_INCOME, TREASURY_STOCK, OPENING_BALANCE_EQUITY, OWNERS_EQUITY.
account_codestringThe account code.
is_payment_enabledtrue, falsetrue if the account is allowed to be set on a paid_through_account field, false otherwise.

Delete account

Delete an account for your organization. However you cannot delete an account that has been used to book an invoice or an expense.

DELETE /v1/accounts/:id/
Previous
Organization