Actions22
- Accounts Actions
- Categories Actions
- Payees Actions
- Payee Locations Actions
- Months Actions
- Transactions Actions
- Scheduled Transactions Actions
Overview
This node operation updates an existing transaction in a YNAB (You Need A Budget) budget. It allows users to modify various details of a transaction such as the amount, account, date, payee, category, memo, cleared status, and subtransactions. This is useful for keeping financial records accurate and up-to-date when changes occur after the initial transaction entry.
Practical examples include:
- Correcting the amount or date of a previously recorded transaction.
- Changing the account associated with a transaction if it was initially assigned incorrectly.
- Adding or updating payee information to better categorize spending.
- Splitting a transaction into multiple subtransactions for detailed budgeting.
Properties
| Name | Meaning |
|---|---|
| Transaction ID | The unique identifier of the transaction to update. |
| Amount | The new amount for the transaction. Must be a number with up to two decimal places. |
| Account ID | The identifier of the account used for the transaction. |
| Date | The date of the transaction. Cannot be set to a future date. |
| Additional Fields | A collection of optional fields to further specify transaction details: |
| - Payee ID | Identifier of the payee associated with the transaction. |
| - Payee Name | If Payee ID is not provided, this name will be used to resolve or create a payee. |
| - Category ID | The category for the transaction. Leave empty to configure split transactions via subtransactions. |
| - Cleared | Status of the transaction; options are "Cleared", "Uncleared", or "Reconciled". |
| - Memo | Additional notes or description for the transaction. |
| - Sub Transactions | Multiple subtransactions can be added here. Each subtransaction requires amount, payee ID or name, category ID, and optionally a memo. The sum of subtransaction amounts must equal the main transaction amount. |
Output
The output JSON contains the updated transaction object returned from the YNAB API. This includes all the updated fields such as amount (in milliunits), date, account ID, payee info, category, memo, cleared status, and any subtransactions.
If the node supports binary data output, it is not applicable here since this operation deals exclusively with JSON transaction data.
Dependencies
- Requires an authenticated connection to the YNAB API using an API key credential.
- The node expects a valid budget ID configured in credentials or environment variables to construct the API base URL.
- Uses the
luxonlibrary internally for date formatting. - HTTP requests are made with authentication handled by n8n's helper methods.
Troubleshooting
- Invalid Transaction ID: If the transaction ID does not exist or is incorrect, the API will return an error. Verify the transaction ID before updating.
- Amount Mismatch in Subtransactions: The sum of subtransaction amounts must exactly match the main transaction amount (after conversion to milliunits). Otherwise, subtransactions will be ignored.
- Future Date Error: Setting a transaction date in the future is not allowed and will cause an error. Ensure the date is today or earlier.
- Authentication Errors: Ensure the API key credential is valid and has access to the specified budget.
- Missing Required Fields: Transaction ID is mandatory. Other fields are optional but at least one field to update should be provided.
- API Rate Limits: Frequent updates may hit API rate limits; handle errors accordingly and consider retry logic.