CREATE
POST
https://api.pesatime.com/v1/income
Record a new sale
Request Body
{
"status": 1,
"message": "Saved",
"data": {
"_id": "5dce4b8a4d44af36f693cd2b"
}
}
{
"status": 0,
"message": "Error message here"
}
UPDATE
PUT
https://api.pesatime.com/v1/income/:incomeId
Update an income
Path Parameters
Request Body
{
"status": 1,
"message": "Expense updated successfully"
}
{
"status": 0,
"message": "Error description here"
}
DELETE
DELETE
https://api.pesatime.com/v1/income/:incomeId
Delete a sale
Path Parameters
{
"status": 1,
"message": "Expense deleted successfully"
}
{
"status": 0,
"message": "Error description here"
}
RETRIEVE - All
GET
https://api.pesatime.com/v1/income
Retrieve all sales made
Query Parameters
{
"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
},
.......
]
}
RETRIEVE - single item
GET
https://api.pesatime.com/v1/income/:incomeId
Retrieve contents of one sale item
Query Parameters
{
"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
}
}