Payhawk icon

Payhawk

Interact with the Zitadel API

Actions99

Overview

This node operation retrieves a list of expenses from an external service associated with an account. It is useful for scenarios where you need to fetch and process expense data programmatically, such as generating reports, auditing transactions, or integrating expense data into other workflows.

For example, you might use this node to:

  • Get all expenses for a specific account within a date range.
  • Filter expenses by status or category.
  • Paginate through large sets of expenses using skip and take parameters.
  • Sort expenses by creation date or amount.

Properties

Name Meaning
Account Id Identifier of the account whose expenses you want to retrieve. This is a required string input.
Filter A JSON-stringified and URL-encoded filter expression object that conforms to the IExpenseFilter schema. It allows filtering expenses by various fields such as id, status, dates (createdAt, settledAt, reviewedAt), title, type, category, creator, document details, reconciliation amounts, supplier name, card id, and supports 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 the IExpenseOrderBy schema. It defines how the returned expenses should be ordered.
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. The maximum allowed is 1000. Default is 0 (which may mean no limit or default server behavior).

Output

The node outputs JSON data representing the retrieved expenses. Each item in the output corresponds to an expense object containing fields such as identifiers, status, dates, titles, types, categories, creator information, document details, reconciliation amounts, supplier info, and card details.

If binary data were involved (e.g., attachments or documents), it would be summarized here, but based on the provided code and properties, the output is purely JSON structured expense data.

Dependencies

  • Requires connection to an external API service that manages expenses.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests.
  • The base URL for the API must be set in the node's credential configuration.
  • Uses query parameters to send filters, sorting, pagination options.

Troubleshooting

  • Invalid Filter Format: If the $filter JSON is malformed or does not conform to the expected schema, the API may reject the request. 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/token is correctly configured.
  • Pagination Limits: Setting $take above the maximum allowed (1000) may result in errors or truncated results.
  • Empty Results: If filters are too restrictive or incorrect, the node may return no expenses. Review filter criteria carefully.
  • API Connectivity Issues: Network problems or incorrect base URL settings can prevent successful API calls.

Links and References

  • Refer to the external API documentation for detailed schema definitions of IExpenseFilter and IExpenseOrderBy.
  • Consult your API provider’s guide on authentication and rate limits.
  • n8n documentation on how to configure credentials and use JSON input properties effectively.

Discussion