Expenses
Operational and project expense records.
externalpermissionstable9 procedures
query
expenses.listInferred outputList expenses for the organization with optional filters.
Input
{
status?: "draft" | "pending" | "approved" | "rejected" | "paid" | undefined;
taskId?: string | undefined;
rootTaskId?: string | undefined;
isBillable?: boolean | undefined;
limit?: number | undefined;
offset?: number | undefined;
isInvoiced?: boolean | undefined;
supplierId?: string | undefined;
claimedByResourceId?: string | undefined;
expenseType?: "supplier_invoice" | "staff_claim" | "direct_cost" | undefined;
category?: string | undefined;
dateFrom?: string | undefined;
dateTo?: string | undefined;
includeChildTasks?: boolean | undefined;
}Output
ExpenseListResultquery
expenses.getByIdInferred outputGet a single expense by ID.
Input
{
id: string;
}Output
{
id: string;
status: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
organizationId: string;
taskId: string | null;
rootTaskId: string | null;
date: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
isBillable: boolean | null;
isInvoiced: boolean | null;
invoiceLineId: string | null;
supplierId: string | null;
claimedByResourceId: string | null;
purchaseOrderId: string | null;
purchaseOrderLineId: string | null;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
category: string | null;
amount: string;
currency: string | null;
referenceNumber: string | null;
reimbursementStatus: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
markupPercentage: string | null;
billableAmount: string | null;
} | nullquery
expenses.getSummaryByCategoryInferred outputGet expense summary by category for a date range.
Input
{
dateFrom: string;
dateTo: string;
rootTaskId?: string | undefined;
}Output
Array<ExpenseCategorySummary>mutation
expenses.createInferred outputCreate a new expense.
Input
{
date: string;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
amount: number;
status?: "draft" | "pending" | "approved" | "rejected" | "paid" | undefined;
taskId?: string | undefined;
rootTaskId?: string | undefined;
description?: string | undefined;
tags?: Array<string> | undefined;
isBillable?: boolean | undefined;
supplierId?: string | undefined;
claimedByResourceId?: string | undefined;
purchaseOrderId?: string | undefined;
purchaseOrderLineId?: string | undefined;
category?: string | undefined;
currency?: string | undefined;
referenceNumber?: string | undefined;
reimbursementStatus?: "draft" | "pending" | "approved" | "rejected" | "paid" | undefined;
markupPercentage?: number | undefined;
billableAmount?: number | undefined;
}Output
{
id: string;
status: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
organizationId: string;
taskId: string | null;
rootTaskId: string | null;
date: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
isBillable: boolean | null;
isInvoiced: boolean | null;
invoiceLineId: string | null;
supplierId: string | null;
claimedByResourceId: string | null;
purchaseOrderId: string | null;
purchaseOrderLineId: string | null;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
category: string | null;
amount: string;
currency: string | null;
referenceNumber: string | null;
reimbursementStatus: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
markupPercentage: string | null;
billableAmount: string | null;
}mutation
expenses.updateInferred outputUpdate an expense.
Input
{
id: string;
status?: "draft" | "pending" | "approved" | "rejected" | "paid" | undefined;
taskId?: string | null | undefined;
rootTaskId?: string | null | undefined;
date?: string | undefined;
description?: string | null | undefined;
tags?: Array<string> | undefined;
isBillable?: boolean | undefined;
supplierId?: string | null | undefined;
claimedByResourceId?: string | null | undefined;
purchaseOrderId?: string | null | undefined;
purchaseOrderLineId?: string | null | undefined;
expenseType?: "supplier_invoice" | "staff_claim" | "direct_cost" | undefined;
category?: string | null | undefined;
amount?: number | undefined;
currency?: string | undefined;
referenceNumber?: string | null | undefined;
reimbursementStatus?: "draft" | "pending" | "approved" | "rejected" | "paid" | null | undefined;
markupPercentage?: number | undefined;
billableAmount?: number | null | undefined;
}Output
{
id: string;
status: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
organizationId: string;
taskId: string | null;
rootTaskId: string | null;
date: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
isBillable: boolean | null;
isInvoiced: boolean | null;
invoiceLineId: string | null;
supplierId: string | null;
claimedByResourceId: string | null;
purchaseOrderId: string | null;
purchaseOrderLineId: string | null;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
category: string | null;
amount: string;
currency: string | null;
referenceNumber: string | null;
reimbursementStatus: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
markupPercentage: string | null;
billableAmount: string | null;
} | nullmutation
expenses.deleteInferred outputSoft delete an expense.
Input
{
id: string;
}Output
{
success: boolean;
error: string;
} | {
success: boolean;
error?: undefined;
}mutation
expenses.approveInferred outputApprove an expense.
Input
{
id: string;
}Output
{
id: string;
status: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
organizationId: string;
taskId: string | null;
rootTaskId: string | null;
date: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
isBillable: boolean | null;
isInvoiced: boolean | null;
invoiceLineId: string | null;
supplierId: string | null;
claimedByResourceId: string | null;
purchaseOrderId: string | null;
purchaseOrderLineId: string | null;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
category: string | null;
amount: string;
currency: string | null;
referenceNumber: string | null;
reimbursementStatus: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
markupPercentage: string | null;
billableAmount: string | null;
} | nullmutation
expenses.rejectInferred outputReject an expense.
Input
{
id: string;
}Output
{
id: string;
status: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
organizationId: string;
taskId: string | null;
rootTaskId: string | null;
date: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
description: string | null;
tags: Array<string> | null;
isBillable: boolean | null;
isInvoiced: boolean | null;
invoiceLineId: string | null;
supplierId: string | null;
claimedByResourceId: string | null;
purchaseOrderId: string | null;
purchaseOrderLineId: string | null;
expenseType: "supplier_invoice" | "staff_claim" | "direct_cost";
category: string | null;
amount: string;
currency: string | null;
referenceNumber: string | null;
reimbursementStatus: "draft" | "pending" | "approved" | "rejected" | "paid" | null;
markupPercentage: string | null;
billableAmount: string | null;
} | nullmutation
expenses.markAsInvoicedInferred outputMark expenses as invoiced.
Input
{
invoiceLineId: string;
ids: Array<string>;
}Output
{
updatedCount: number;
}