Actions22
- Accounts Actions
- Categories Actions
- Payees Actions
- Payee Locations Actions
- Months Actions
- Transactions Actions
- Scheduled Transactions Actions
Overview
This node integrates with the YNAB (You Need A Budget) API to automate financial budgeting tasks. Specifically, the "Create Transaction" operation under the "Transactions" resource allows users to add new transactions to their YNAB budget. This is useful for automating expense tracking, income recording, or managing split transactions programmatically.
Practical examples include:
- Automatically logging purchases from an e-commerce platform.
- Recording salary deposits on payday.
- Creating split transactions where a single payment covers multiple categories (e.g., groceries and household supplies).
Properties
| Name | Meaning |
|---|---|
| Amount | The total amount of the transaction. Must be a number with up to two decimal places. |
| Account ID | Identifier of the account used for the transaction. |
| Date | Date of the transaction in ISO format. Cannot be a future date. |
| Additional Fields | Optional extra details for the transaction: |
| - Payee ID | Identifier of the payee associated with the transaction. |
| - Payee Name | Name of the payee. If Payee ID is not provided, this name will be used to find or create a payee. |
| - Category ID | Category identifier for the transaction. Leave empty if creating a split transaction with subtransactions. |
| - Cleared | Status of the transaction: one of "Cleared", "Uncleared", or "Reconciled". Defaults to "Cleared". |
| - Memo | Optional note or description for the transaction. |
| - Sub Transactions | Allows defining multiple subtransactions for split transactions. Each subtransaction includes: |
| - Amount | Amount for the subtransaction (must sum to the main Amount). |
| - Payee ID | Payee identifier for the subtransaction. |
| - Payee Name | Payee name for the subtransaction; used to resolve or create payee if Payee ID is missing. |
| - Category ID | Category for the subtransaction. Note that credit card payment categories are not allowed and will be ignored. |
| - Memo | Optional memo for the subtransaction. |
Output
The node outputs a JSON object representing the created transaction as returned by the YNAB API. This includes all transaction details such as:
id: Unique identifier of the transaction.date: Transaction date.amount: Amount in milliunits (the API uses amounts multiplied by 1000).account_id: Associated account.payee_id/payee_name: Payee information.category_id: Category assigned.memo: Any notes.cleared: Cleared status.subtransactions: Array of subtransaction objects if applicable.
No binary data output is produced by this node.
Dependencies
- Requires an active YNAB API key credential configured in n8n for authentication.
- The node dynamically constructs API URLs using the configured budget ID.
- Uses the Luxon library for date formatting to ensure correct API date formats.
- Requires internet access to communicate with the YNAB REST API endpoint.
Troubleshooting
- Invalid Date Error: The date must not be in the future and must be formatted correctly (ISO 8601). Ensure the input date meets these criteria.
- Amount Mismatch in Subtransactions: If subtransactions are provided, their summed amounts must exactly equal the main transaction amount (after multiplying by 1000). Otherwise, the API ignores subtransactions.
- Missing Required Fields: Amount, Account ID, and Date are mandatory. Omitting any will cause errors.
- Payee Resolution Issues: If both Payee ID and Payee Name are missing or incorrect, the transaction may fail or associate incorrectly.
- API Authentication Failures: Verify that the API key credential is valid and has access to the specified budget.
- Category Restrictions: Credit Card Payment categories are disallowed in subtransactions and will be ignored silently; ensure categories are valid.