Income

Manage income

CREATE

POST https://api.pesatime.com/v1/income

Record a new sale

Request Body

NameTypeDescription

category

string

Category ID

amount

number

Amount

date

string

The date this sale was made YYYY-MM-DD e.g. 2019-11-03

description

string

Add any notes

{
  "status": 1,
  "message": "Saved",
  "data": {
    "_id": "5dce4b8a4d44af36f693cd2b"
  }
}

UPDATE

PUT https://api.pesatime.com/v1/income/:incomeId

Update an income

Path Parameters

NameTypeDescription

incomeId

string

The ID of the income

Request Body

NameTypeDescription

date

string

Date in format YYYY-MM-DD

description

string

The new description

amount

number

The new amount

category

number

New category ID

{
  "status": 1,
  "message": "Expense updated successfully"
}

DELETE

DELETE https://api.pesatime.com/v1/income/:incomeId

Delete a sale

Path Parameters

NameTypeDescription

incomeId

string

ID of the sale to delete

{
  "status": 1,
  "message": "Expense deleted successfully"
}

RETRIEVE - All

GET https://api.pesatime.com/v1/income

Retrieve all sales made

Query Parameters

NameTypeDescription

category

string

Category ID

description

string

Contains any of what is put here

date_from

string

The date this sale was made

date_from

string

The date this sale was made

{
  "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

NameTypeDescription

incomeId

string

The ID of the item to pull

{
  "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
  }
}

Last updated