Income

These endpoints are used to manage income entries for your business.


List Income Entries

GET /api/income

Description: Retrieves a paginated list of income entries with optional filtering.

Authorization: API Key (Bearer Token) required.

Query Parameters:

  • Name
    page
    Type
    integer
    Description

    Page number for pagination (default: 1).

  • Name
    limit
    Type
    integer
    Description

    Number of items per page (default: 10).

  • Name
    categoryId
    Type
    string
    Description

    Filter by category ID.

  • Name
    startDate
    Type
    string
    Description

    Filter by income on or after this date (YYYY-MM-DD).

  • Name
    endDate
    Type
    string
    Description

    Filter by income on or before this date (YYYY-MM-DD).

Request

curl -X GET "https://your-summit-instance.com/api/income?page=1&limit=10&categoryId=1" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response (Success: 200 OK)

{
  "data": [
    {
      "income": {
        "id": 1,
        "companyId": 1,
        "categoryId": 1,
        "clientId": 2,
        "invoiceId": null,
        "source": "Consulting Services",
        "description": "Monthly retainer",
        "amount": 5000.00,
        "currency": "USD",
        "incomeDate": "2023-10-15",
        "recurring": "monthly",
        "nextDueDate": "2023-11-15",
        "createdAt": "2023-10-15T10:30:00.000Z",
        "updatedAt": "2023-10-15T10:30:00.000Z",
        "softDelete": false
      },
      "category": {
        "id": 1,
        "name": "Consulting Services"
      },
      "client": {
        "id": 2,
        "name": "Acme Corporation"
      }
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "limit": 10,
    "totalPages": 1
  }
}

Create Income Entry

POST /api/income

Description: Creates a new income entry.

Authorization: API Key (Bearer Token) required.

Request Body: application/json

  • Name
    categoryId
    Type
    integer
    Description

    ID of the income category.

  • Name
    clientId
    Type
    integer
    Description

    ID of the client (optional).

  • Name
    invoiceId
    Type
    integer
    Description

    ID of the associated invoice (optional).

  • Name
    source
    Type
    string
    Description

    Source of the income.

  • Name
    description
    Type
    string
    Description

    Description of the income.

  • Name
    amount
    Type
    number
    Description

    Amount of the income.

  • Name
    currency
    Type
    string
    Description

    Currency code (e.g., USD, EUR).

  • Name
    incomeDate
    Type
    string
    Description

    Date of the income (YYYY-MM-DD).

  • Name
    recurring
    Type
    string
    Description

    Recurring frequency: 'none', 'daily', 'weekly', 'monthly', or 'yearly'.

  • Name
    nextDueDate
    Type
    string
    Description

    Next due date for recurring income (YYYY-MM-DD).

Request

curl -X POST "https://your-summit-instance.com/api/income" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "categoryId": 1,
       "clientId": 2,
       "source": "Project completion fee",
       "description": "Final payment for website redesign",
       "amount": 2500.00,
       "currency": "USD",
       "incomeDate": "2023-10-20",
       "recurring": "none"
     }'

Response (Success: 201 Created)

{
  "id": 2,
  "companyId": 1,
  "categoryId": 1,
  "clientId": 2,
  "invoiceId": null,
  "source": "Project completion fee",
  "description": "Final payment for website redesign",
  "amount": 2500.00,
  "currency": "USD",
  "incomeDate": "2023-10-20",
  "recurring": "none",
  "nextDueDate": null,
  "createdAt": "2023-10-27T13:00:00.000Z",
  "updatedAt": "2023-10-27T13:00:00.000Z",
  "softDelete": false
}

Get Income Details

GET /api/income/{incomeId}

Description: Retrieves details for a specific income entry.

Authorization: API Key (Bearer Token) required.

Path Parameters:

  • Name
    incomeId
    Type
    integer
    Description

    ID of the income entry to retrieve.

Request

curl -X GET "https://your-summit-instance.com/api/income/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response (Success: 200 OK)

{
  "income": {
    "id": 2,
    "companyId": 1,
    "categoryId": 1,
    "clientId": 2,
    "invoiceId": null,
    "source": "Project completion fee",
    "description": "Final payment for website redesign",
    "amount": 2500.00,
    "currency": "USD",
    "incomeDate": "2023-10-20",
    "recurring": "none",
    "nextDueDate": null,
    "createdAt": "2023-10-27T13:00:00.000Z",
    "updatedAt": "2023-10-27T13:00:00.000Z",
    "softDelete": false
  },
  "category": {
    "id": 1,
    "name": "Consulting Services"
  },
  "client": {
    "id": 2,
    "name": "Acme Corporation"
  }
}

Update Income Entry

PUT /api/income/{incomeId}

Description: Updates an existing income entry.

Authorization: API Key (Bearer Token) required.

Path Parameters:

  • Name
    incomeId
    Type
    integer
    Description

    ID of the income entry to update.

Request Body: application/json

  • Name
    categoryId
    Type
    integer
    Description

    ID of the income category.

  • Name
    clientId
    Type
    integer
    Description

    ID of the client.

  • Name
    invoiceId
    Type
    integer
    Description

    ID of the associated invoice.

  • Name
    source
    Type
    string
    Description

    Source of the income.

  • Name
    description
    Type
    string
    Description

    Description of the income.

  • Name
    amount
    Type
    number
    Description

    Amount of the income.

  • Name
    currency
    Type
    string
    Description

    Currency code (e.g., USD, EUR).

  • Name
    incomeDate
    Type
    string
    Description

    Date of the income (YYYY-MM-DD).

  • Name
    recurring
    Type
    string
    Description

    Recurring frequency: 'none', 'daily', 'weekly', 'monthly', or 'yearly'.

  • Name
    nextDueDate
    Type
    string
    Description

    Next due date for recurring income (YYYY-MM-DD).

Request

curl -X PUT "https://your-summit-instance.com/api/income/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "amount": 3000.00,
       "description": "Final payment for website redesign and additional features"
     }'

Response (Success: 200 OK)

{
  "id": 2,
  "companyId": 1,
  "categoryId": 1,
  "clientId": 2,
  "invoiceId": null,
  "source": "Project completion fee",
  "description": "Final payment for website redesign and additional features",
  "amount": 3000.00,
  "currency": "USD",
  "incomeDate": "2023-10-20",
  "recurring": "none",
  "nextDueDate": null,
  "createdAt": "2023-10-27T13:00:00.000Z",
  "updatedAt": "2023-10-27T14:30:00.000Z",
  "softDelete": false
}

Delete Income Entry

DELETE /api/income/{incomeId}

Description: Soft deletes an income entry.

Authorization: API Key (Bearer Token) required.

Path Parameters:

  • Name
    incomeId
    Type
    integer
    Description

    ID of the income entry to delete.

Request

curl -X DELETE "https://your-summit-instance.com/api/income/2" \
     -H "Authorization: Bearer <YOUR_API_TOKEN>"

Response (Success: 200 OK)

{
  "message": "Income entry deleted successfully"
}

Was this page helpful?