# Create Expense Create a new expense in your workspace. Requires expense_name, date, amount, and category_id. Endpoint: POST /expenses Version: 2.0.0 Security: oauth2, apiKey ## Request fields (application/json): - `workspace_id` (integer, required) ID of the workspace (Team.id from owner_user_rel table) Example: 1 - `expense_name` (string, required) Example: "Office Supplies" - `date` (string, required) Example: "2024-01-15" - `amount` (number, required) Example: 150.5 - `category_id` (string, required) UUID of the expense category Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `project_id` (integer) ID of the project (optional) Example: 100 - `note` (string) Additional notes about the expense Example: "Purchased office supplies for Q1" - `is_billable` (boolean) Whether the expense is billable Example: true ## Response 201 fields (application/json): - `success` (boolean) Example: true - `data` (object) - `data.id` (string, required) UUID of the expense Example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - `data.member` (string,null) Full name of the member who created the expense Example: "John Doe" - `data.expense_date` (string,null) Date of the expense (formatted) Example: "Jan 15, 2024" - `data.expense_name` (string) Name/description of the expense Example: "Office Supplies" - `data.project` (string,null) Name of the project (if assigned) Example: "Marketing Campaign Q1" - `data.category` (string,null) Name of the expense category Example: "Office Supplies" - `data.amount` (number) Amount of the expense Example: 150.5 - `data.note` (string,null) Additional notes about the expense Example: "Purchased office supplies for Q1" - `data.type` (string) Whether the expense is billable Enum: "billable", "non-billable" - `data.added_dte` (string,null) Date when expense was added (formatted) Example: "Jan 15, 2024" - `message` (string) Example: "Expense created successfully" - `meta` (object) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 400 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 401 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 403 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 422 fields (application/json): - `success` (boolean, required) - `message` (string, required) Example: "Validation failed" - `errors` (object, required) Object containing validation error messages for each field Example: {"email":["The email field is required.","The email must be a valid email address."],"firstname":["The firstname field is required."],"role":["The selected role is invalid."]} - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 500 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string)