Payhawk icon

Payhawk

Interact with the Zitadel API

Actions99

Overview

This node operation is designed to update an existing expense by removing its bank payment details and marking the expense as unpaid. It is useful in scenarios where a payment recorded against an expense needs to be reversed or corrected, such as when a payment was made in error or needs to be reprocessed.

Practical examples include:

  • Correcting bookkeeping errors by clearing payment information from an expense.
  • Preparing an expense for re-payment after a failed transaction.
  • Managing refunds or cancellations where the original payment should no longer be considered valid.

Properties

Name Meaning
Account Id Identifier of the account associated with the expense.
Expense Id Identifier of the specific expense record from which bank payment details will be removed and marked as unpaid.

Output

The node outputs JSON data representing the updated expense object after removal of bank payment details and marking it as unpaid. This typically includes the expense's current state, reflecting that it no longer has associated bank payment information and its payment status is set accordingly.

If the node supports binary data output (not indicated here), it would generally relate to any attachments or documents linked to the expense, but this is not evident from the provided code.

Dependencies

  • Requires an API key credential for authenticating requests to the external service managing expenses.
  • The node interacts with an external API endpoint related to expense management; thus, proper configuration of the base URL and authentication credentials within n8n is necessary.
  • No additional external libraries beyond those bundled are explicitly required for this operation.

Troubleshooting

  • Common Issues:

    • Invalid or missing Account Id or Expense Id can cause the operation to fail.
    • Insufficient permissions or invalid API credentials may result in authorization errors.
    • Network connectivity issues could prevent successful API communication.
  • Error Messages:

    • Errors indicating "Expense not found" suggest the provided Expense Id does not exist or is incorrect.
    • Authentication errors imply problems with the API key or credential setup.
    • Validation errors may occur if required properties are missing or malformed.
  • Resolutions:

    • Verify that both Account Id and Expense Id are correct and correspond to existing records.
    • Ensure API credentials are correctly configured and have sufficient permissions.
    • Check network connectivity and API endpoint availability.

Links and References

  • Refer to the external expense management API documentation for detailed information on expense updates and payment status handling.
  • Consult n8n documentation on setting up API credentials and configuring HTTP request nodes for similar integrations.

Discussion