Payhawk icon

Payhawk

Interact with the Zitadel API

Actions99

Overview

This node operation, Get Expenses, retrieves a list of expense records from an external service based on specified filtering, sorting, and pagination criteria. It is useful for workflows that need to fetch detailed expense data for accounting, auditing, reporting, or integration with other financial systems.

Typical use cases include:

  • Extracting expenses for a specific account within a date range.
  • Filtering expenses by status, category, supplier, or other metadata.
  • Paginating through large sets of expenses to process them in batches.
  • Sorting expenses by creation date, amount, or other fields.

For example, you might use this node to get all approved expenses created in March 2023 for a particular account, sorted by the date they were settled.

Properties

Name Meaning
Account Id Identifier of the account whose expenses are to be retrieved. This is a required string property.
Filter A JSON-stringified and URL-encoded filter expression object conforming to an expense filter schema. It allows complex filtering on various fields such as id, status, createdAt, settledAt, title, type, category.id, createdBy.id, document-related dates and numbers, amounts, supplier name, card id, and supports logical operators like $and and $or. Date filters ignore time parts and compare only by date.
Order By A JSON-stringified and URL-encoded sort expression object defining how to order the returned expenses. The schema supports specifying fields and directions for sorting.
Skip Number of expense objects to skip from the beginning of the result set. Useful for pagination. Default is 0.
Take Maximum number of expense objects to return. Limits the size of the result set, with a maximum allowed value of 1000.

Output

The node outputs an array of expense objects in the json field of the output data. Each expense object contains detailed information about an individual expense, including but not limited to identifiers, status, dates (creation, settlement, review), title, type, category, creator, document details (dates, numbers), reconciliation amounts, supplier information, and associated card IDs.

No binary data output is indicated for this operation.

Dependencies

  • Requires connection to an external API service that manages expense data.
  • Needs an API authentication token or API key credential configured in n8n to authorize requests.
  • The base URL for the API must be configured in the node credentials or environment variables.

Troubleshooting

  • Invalid Filter or OrderBy JSON: If the filter or order by properties contain malformed JSON or invalid schema, the API may reject the request. Ensure JSON strings are properly formatted and URL-encoded.
  • Authentication Errors: Missing or incorrect API credentials will cause authorization failures. Verify that the API key or token is correctly set up.
  • Pagination Limits: Setting Take above the maximum allowed (1000) may result in errors or truncated results. Keep Take within limits.
  • Empty Results: If no expenses match the filter criteria, the output will be an empty array. Adjust filters accordingly.
  • Date Filtering: Date filters ignore time components; ensure date values are correct and in ISO format.

Links and References


If you need further details on other operations or resources, please provide their names.

Discussion