Skip to main content

Update Income (v1)

Method & Path

PATCH /api/v1/client/workspace/:workspaceId/incomes/:incomeId

Description

Update an existing income record. All fields are optional, but at least one field must be provided.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with financial permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
incomeIdstringYesIncome identifier

Request Body

All fields are optional, but at least one field must be provided:

{
"amount": 600.00,
"date": "2025-01-16T10:30:00.000Z",
"time": "11:00",
"description": "Updated payment description",
"paymentMethod": "bank-transfer",
"source": "manual",
"sourceId": null,
"notes": "Updated notes"
}

Request Body Schema

FieldTypeRequiredDescription
amountnumberNoIncome amount (min: 0)
datedateNoIncome date (ISO 8601 format)
timestringNoIncome time in HH:MM format (24-hour format)
descriptionstringNoIncome description (min length: 1 if provided)
paymentMethodstringNoPayment method (cash, bank-transfer, card, check, other)
sourcestringNoIncome source (manual, invoice, order, other)
sourceIdstringNoID of the source entity. Can be null
notesstringNoAdditional notes about the income

Response 200 OK

{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"amount": 600.00,
"date": "2025-01-16T10:30:00.000Z",
"time": "11:00",
"description": "Updated payment description",
"paymentMethod": "bank-transfer",
"source": "manual",
"sourceId": null,
"receiptImage": null,
"notes": "Updated notes",
"createdBy": "507f1f77bcf86cd799439014",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-16T11:00:00.000Z"
}

Common Errors

400 Bad Request: Invalid request body (e.g., no fields provided, invalid amount, invalid time format)

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have permission to update income records

404 Not Found: Income or workspace not found

422 Unprocessable Entity: Validation error (e.g., invalid payment method or source enum value)

500 Internal Server Error: Server error occurred while processing the request