Income

Manage income

post
CREATE

https://api.pesatime.com/v1/income
Record a new sale
Request
Response
Request
Form Data Parameters
category
optional
string
Category ID
amount
required
number
Amount
date
required
string
The date this sale was made YYYY-MM-DD e.g. 2019-11-03
description
optional
string
Add any notes
Response
200: OK
Success
{
"status": 1,
"message": "Saved",
"data": {
"_id": "5dce4b8a4d44af36f693cd2b"
}
}
302: Found
Error
{
"status": 0,
"message": "Error message here"
}

put
UPDATE

https://api.pesatime.com/v1/income/:incomeId
Update an income
Request
Response
Request
Path Parameters
incomeId
optional
string
The ID of the income
Form Data Parameters
date
optional
string
Date in format YYYY-MM-DD
description
optional
string
The new description
amount
optional
number
The new amount
category
optional
number
New category ID
Response
200: OK
SUCCESS
{
"status": 1,
"message": "Expense updated successfully"
}
302: Found
Error
{
"status": 0,
"message": "Error description here"
}

delete
DELETE

https://api.pesatime.com/v1/income/:incomeId
Delete a sale
Request
Response
Request
Path Parameters
incomeId
optional
string
ID of the sale to delete
Response
200: OK
Success
{
"status": 1,
"message": "Expense deleted successfully"
}
302: Found
Error
{
"status": 0,
"message": "Error description here"
}

get
RETRIEVE - All

https://api.pesatime.com/v1/income
Retrieve all sales made
Request
Response
Request
Query Parameters
category
optional
string
Category ID
description
optional
string
Contains any of what is put here
date_from
required
string
The date this sale was made
date_from
required
string
The date this sale was made
Response
200: OK
{
"status": 1,
"data": [
{
"amount": 10001,
"active": true,
"_id": "5dce51d0bf6c524c59a75c96",
"organization": "5db5a64a6cb3e2060a7b864c",
"user": "5cded7f553ea376e8bba6bfd",
"category": {
"_id": "5cdfb75bb8f2b84e5fb55ce6",
"name": "Marketing"
},
"description": "New marketing deal",
"date": "2019-01-23T00:00:00.000Z",
"attachments": [],
"dateCreated": "2019-11-15T07:20:48.818Z",
"__v": 0
},
.......
]
}

get
RETRIEVE - single item

https://api.pesatime.com/v1/income/:incomeId
Retrieve contents of one sale item
Request
Response
Request
Query Parameters
incomeId
optional
string
The ID of the item to pull
Response
200: OK
{
"status": 1,
"data": {
"amount": 10001,
"active": true,
"_id": "5dce51d0bf6c524c59a75c96",
"organization": "5db5a64a6cb3e2060a7b864c",
"user": "5cded7f553ea376e8bba6bfd",
"category": {
"_id": "5cdfb75bb8f2b84e5fb55ce6",
"name": "Marketing"
},
"description": "Description here",
"date": "2019-01-23T00:00:00.000Z",
"attachments": [],
"dateCreated": "2019-11-15T07:20:48.818Z",
"__v": 0
}
}