GET /v1/expenses/GET /v1/expenses/:id/POST /v1/expenses/PATCH /v1/expenses/:id/DELETE /v1/expenses/:id/
Expense object
Attributes
Type
Description
id
string
The id of the object.
account
string
The id of the account.
paid_through_account
string
The id of the account used for the payment.
contact
string
The id of the contact.
amount
number
The expense amount.
currency
string
The currency used in the expense.
tax_rate
string
The id of the tax rate.
amount_tax_type
string
Either TAX_INCLUSIVE or TAX_EXCLUSIVE.
description
string
The description attached to it.
date
string
The date of the expense.
reference
string
A reference attached to the expense.
Example
{"account":"acc_ecKYVzRBqRqWhguoWqWqYT","amount_tax_type":"TAX_INCLUSIVE","amount":12.0,"contact":null,"currency":"SAR","date":"2022-07-19","description":"A long description","id":"exp_6E8yfeBkLUM2yi3m7F4aie","paid_through_account":"acc_Xjwoy4VSKtVm6gEYcC9ZKR","reference":"A reference to be reused","tax_rate":"tax_BbdyVvf3kv6uj78nK5772t"}
Get expense
Endpoint
GET /v1/expenses/:id/
Response sample
{"account":"acc_ecKYVzRBqRqWhguoWqWqYT","amount_tax_type":"TAX_INCLUSIVE","amount":12.0,"contact":null,"currency":"SAR","date":"2022-07-19","description":"A long description","id":"exp_6E8yfeBkLUM2yi3m7F4aie","paid_through_account":"acc_Xjwoy4VSKtVm6gEYcC9ZKR","reference":"A reference to be reused","tax_rate":"tax_BbdyVvf3kv6uj78nK5772t"}
The id of the expense account to categorize the expense.
paid_through_account
string
The id of the account used to pay for the expense.
currency
string
The currency used in the expense.
amount
number
The expense amount.
contact
string
(Optional) The id of the contact (vendor).
tax_rate
string
(Optional) The id of the tax rate.
amount_tax_type
string
(Optional) Either TAX_INCLUSIVE or TAX_EXCLUSIVE. Required if tax_rate is provided.
description
string
(Optional) The description attached to it.
reference
string
(Optional) A reference attached to the expense.
Request
curl --location \ --request POST 'https://api.wafeq.com/v1/expenses/'\ --header 'Authorization: Api-Key <api_key>'\ --header 'Content-Type: application/json'\ --data-raw '{ "account": "<account>", "paid_through_account": "<paid_through_account>", "amount": 12, "currency": "SAR", "amount_tax_type": "TAX_INCLUSIVE", "description": "This is a test from the API", "date": "2022-07-19", "reference": "A reference to be reused", "tax_rate": "<tax_rate>"}'
Update expense
PATCH /v1/expenses/:id/
Request body
Attributes
Type
Description
date
string
The date of the expense.
account
string
The id of the expense account to categorize the expense.
paid_through_account
string
The id of the account used to pay for the expense.
currency
string
The currency used in the expense.
amount
number
The expense amount.
contact
string
(Optional) The id of the contact (vendor).
tax_rate
string
(Optional) The id of the tax rate.
amount_tax_type
string
(Optional) Either TAX_INCLUSIVE or TAX_EXCLUSIVE. Required if tax_rate is provided.