Expense categories

Shows you how to manage expense categories

post
CREATE

https://api.pesatime.com/v1/expense_categories
Create a new expense category
Request
Response
Request
Form Data Parameters
name
required
string
The name of the category to create
Response
200: OK
Category successfully created.
{
"status": 1,
"message": "Saved",
"data": {
"_id": "5dce4b8a4d44af36f693cd2b"
}
}
302: Found
Error
{
"status": 0,
"message": "Error message here"
}

put
UPDATE

https://api.pesatime.com/v1/expense_categories/:categoryId
Update an expense category
Request
Response
Request
Form Data Parameters
name
optional
string
The new name of the category
Response
200: OK
Success
{
"status": 1,
"message": "Category updated successfully"
}
302: Found
{
"status": 0,
"message": "Error description here"
}

get
RETRIEVE

https://api.pesatime.com/v1/expense_categories/:categoryId
Retrieves the contents of an expense category
Request
Response
Request
Path Parameters
categoryId
required
string
The ID of the category to retrieve details for
Response
200: OK
Success
{
"status": 1,
"data": {
"active": true,
"_id": "5dcc0fc3a9e5e668a62c72e1",
"organization": "5db5a64a6cb3e2060a7b864c",
"user": "5cded7f553ea376e8bba6bfd",
"name": "Salary",
"dateCreated": "2019-11-13T14:14:27.095Z",
"__v": 0
}
}
302: Found
Category not found
{
"status": 0,
"message": "Category not found"
}

delete
DELETE

https://api.pesatime.com/v1/expense_categories/:categoryId
Delete a category
Request
Response
Request
Path Parameters
categoryId
required
string
The ID of the category to delete
Response
200: OK
Success
{
"status": 1,
"message": "Category deleted successfully"
}
302: Found
Error
{
"status": 0,
"message": "Error description here"
}