Create Transaction
ynab_create_transactionCreate a new transaction in a YNAB plan by specifying date and amount, using account and category names or IDs; split it across multiple categories when needed.
Instructions
Creates a new transaction in your YNAB plan. The account can be given as accountId or accountName, and the category as categoryId or categoryName - names are fuzzy-matched against the plan. Either payeeId or payeeName must also be provided. To split the transaction across categories, pass subtransactions instead of a category; their amounts must add up to the transaction amount.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | The date of the transaction in ISO format (e.g. 2024-03-24) | |
| memo | No | A memo/note for the transaction (optional) | |
| amount | Yes | The amount in dollars (e.g. -10.99 for money spent, 10.99 for money received) | |
| planId | No | The plan ID (optional, defaults to YNAB_PLAN_ID; budgetId is a deprecated alias) | |
| cleared | No | The cleared status of the transaction (optional, defaults to uncleared) | |
| payeeId | No | The id of the payee (optional if payeeName is provided) | |
| approved | No | Whether the transaction is approved (optional, defaults to false) | |
| budgetId | No | Deprecated alias of planId (still accepted) | |
| accountId | No | The id of the account to create the transaction in (optional if accountName is provided) | |
| flagColor | No | The transaction flag color, or an empty string to clear the flag (optional) | |
| payeeName | No | The name of the payee (optional if payeeId is provided). YNAB creates the payee if it does not exist. | |
| categoryId | No | The category id for the transaction (optional) | |
| accountName | No | The name of the account, matched loosely against your accounts (e.g. 'ally checking'). Optional if accountId is provided. | |
| categoryName | No | The name of the category, matched loosely against your categories (e.g. 'groceries'). Optional; ignored if categoryId is provided. | |
| subtransactions | No | Splits the transaction across categories, in the same shape ynab_get_transactions returns. Needs at least two entries whose amounts sum to amount; omit categoryId/categoryName when splitting. |