Actions99
- Group Accounts Actions
- Group Account Codes Actions
- Accounts Actions
- Expenses Actions
- Purchase Orders Actions
- Get A List Of Purchase Orders
- Create A New Purchase Order
- Get A Purchase Order
- Update A Purchase Order
- Open A Purchase Order
- Get A List Of Purchase Orders Items For A Specific Purchase Order
- Create A Purchase Order Item
- Get A Purchase Order Item
- Update A Purchase Order Item
- Delete A Purchase Order Item
- Get A List Of Goods Received Notes For A Specific Purchase Order
- Create A Goods Received Note
- Attach A File To A Goods Received Note
- Delete A Goods Received Note
- Suppliers Actions
- Fund Accounts Actions
- Cards Actions
- Expense Categories Actions
- Tax Rates Actions
- Amortizations Actions
- Account Teams Actions
- Account Codes Actions
- External Teams Actions
- Custom Fields Actions
- Get Custom Fields
- Create A New Custom Field
- Get Custom Field
- Update Custom Field
- Delete A Custom Field And All Its Values
- Get Custom Field Values
- Create A Custom Field Value
- Delete Custom Field Values
- Get A Custom Field Value
- Update A Custom Field Value
- Delete A Custom Field Value
- Get Managers For A Specific Custom Field Value
- Adds Managers For A Specific Custom Field Value
- Replaces Managers For A Specific Custom Field Value
- Removes Managers For A Specific Custom Field Value
- Webhook Subscriptions Actions
- Group Teams Actions
Expenses → Get Expenses
AI-generatedOverview
This node operation retrieves a list of expenses from an external service associated with a specified account. It allows users to query and filter expense data based on various criteria such as creation date, status, category, supplier name, and more. This is useful for financial reporting, auditing, or integrating expense data into workflows for further processing or analysis.
Practical examples include:
- Fetching all expenses created on a specific date.
- Retrieving expenses filtered by status or category.
- Paginating through large sets of expenses using skip and take parameters.
- Sorting expenses by date or amount.
Properties
| Name | Meaning |
|---|---|
| Account Id | Identifier of the account whose expenses are to be retrieved. This is a required string input. |
| Filter | A JSON-stringified and URL-encoded filter expression object that conforms to an expense filter schema. It supports filtering by multiple fields such as id, status, createdAt, settledAt, reviewedAt, title, type, category.id, createdBy.id, document-related dates and numbers, reconciliation amounts, supplier name, card id, and logical operators $and and $or. Date filters ignore time and compare only by date part. |
| Order By | A JSON-stringified and URL-encoded sort expression object conforming to an expense order-by schema. It defines how the results should be sorted (e.g., by date ascending or descending). |
| Skip | Number of objects to skip from the beginning of the result set. Useful for pagination. Default is 0. |
| Take | Maximum number of objects to return. The maximum allowed is 1000. Used to limit the size of the returned dataset. Default is 0 (which may mean no limit or default server behavior). |
Output
The output contains a JSON array of expense objects matching the query criteria. Each expense object includes detailed information such as identifiers, status, dates, titles, types, categories, creator info, document details, reconciliation amounts, supplier information, and card details.
If binary data were involved (e.g., attachments), it would be summarized here, but this operation focuses on JSON data representing expenses.
Dependencies
- Requires an API key credential or similar authentication token configured in n8n to access the external expense service.
- The base URL for the API must be configured in the node credentials.
- The node depends on the external service's REST API supporting filtering, sorting, pagination, and returning expense data in JSON format.
Troubleshooting
- Invalid Filter Format: If the filter JSON is malformed or does not conform to the expected schema, the API may return errors or empty results. Ensure the filter is properly JSON-stringified and URL-encoded.
- Authentication Errors: Missing or invalid API credentials will cause authorization failures. Verify that the API key or token is correctly set up in n8n credentials.
- Pagination Issues: Setting
Taketo zero or a value greater than 1000 might lead to unexpected results or API rejections. KeepTakewithin allowed limits. - Empty Results: If no expenses match the filter criteria, the output will be an empty array. Double-check filter conditions for correctness.
- Date Filtering: Since date filters ignore time parts, filtering by exact timestamps may not behave as expected. Use date-only values for filtering.
Links and References
- Refer to the external expense service API documentation for detailed schema definitions of filters and order-by expressions.
- n8n documentation on HTTP Request node for understanding how query parameters are sent.
- JSON Schema standards for constructing valid filter and sort objects.