انتقل إلى المحتوى الرئيسي

Expense Endpoints

API endpoints for expense tracking, income management, and recurring expenses.

Expenses

List Expenses

GET /api/expense?take=20&skip=0&startDate=2024-01-01&endDate=2024-01-31
Authorization: Bearer {token}

Response (200 OK):

{
"items": [
{
"id": "...",
"amount": 250.0,
"currency": "USD",
"valueDate": "2024-01-15T00:00:00.000Z",
"notes": "Office supplies",
"purpose": "Office",
"vendor": { "name": "Office Depot" },
"category": { "name": "Supplies" },
"status": "REPORTED",
"organizationId": "..."
}
],
"total": 30
}

Create Expense

POST /api/expense
Authorization: Bearer {token}
Content-Type: application/json

{
"amount": 250.00,
"currency": "USD",
"valueDate": "2024-01-15",
"notes": "Office supplies",
"purpose": "Office",
"typeOfExpense": "BILLABLE_TO_CONTACT",
"categoryId": "category-uuid",
"vendorId": "vendor-uuid",
"organizationId": "org-uuid"
}

Expense Statuses

StatusDescription
REPORTEDExpense reported
INVOICEDIncluded in an invoice
PAIDReimbursed

Expense Types

TypeDescription
BILLABLE_TO_CONTACTBill to client
NON_BILLABLEInternal expense
TAX_DEDUCTIBLETax-deductible expense

Income

List Income

GET /api/income?take=20&skip=0
Authorization: Bearer {token}

Create Income

POST /api/income
Authorization: Bearer {token}
Content-Type: application/json

{
"amount": 5000.00,
"currency": "USD",
"valueDate": "2024-01-15",
"notes": "Client payment for January",
"clientId": "contact-uuid",
"organizationId": "org-uuid"
}

Expense Categories

List Categories

GET /api/expense-categories
Authorization: Bearer {token}

Create Category

POST /api/expense-categories
Authorization: Bearer {token}
Content-Type: application/json

{
"name": "Travel",
"organizationId": "org-uuid"
}

Organization Recurring Expenses

List Recurring Expenses

GET /api/organization-recurring-expense?where[organizationId]={org-id}
Authorization: Bearer {token}

Create Recurring Expense

POST /api/organization-recurring-expense
Authorization: Bearer {token}
Content-Type: application/json

{
"categoryName": "Cloud Hosting",
"value": 500,
"currency": "USD",
"startDate": "2024-01-01",
"organizationId": "org-uuid"
}