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
Attributes | Type | Description |
---|---|---|
id | string | id of the object. |
account_code | string | The account code. |
name_en | string | The name of the account in English. |
name_ar | string | The name of the account in Arabic. |
classification | string | One of REVENUE , EXPENSE , ASSET , LIABILITY , EQUITY . |
sub_classification | string | One 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_enabled | true , false | true if the account is allowed to be set on a paid_through_account field, false otherwise. |
is_system | true , false | true 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 param | Possible values | Description |
---|---|---|
classification | One of REVENUE , EXPENSE , ASSET , LIABILITY , EQUITY | The classification of the account. |
include_system | true , false | true if you want to include system accounts in the response, false otherwise. Defaults to false . |
is_payment_enabled | true , false | true 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
Attributes | Type | Description |
---|---|---|
name_en | string | The name of the account in English. |
name_ar | string | The name of the account in Arabic. |
sub_classification | string | One 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_code | string | (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
Attributes | Type | Description |
---|---|---|
name_en | string | The name of the account in English. |
name_ar | string | The name of the account in Arabic. |
sub_classification | string | One 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_code | string | The account code. |
is_payment_enabled | true , false | true 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/