ynab_create_transaction
Create a single transaction in YNAB with support for splits, custom payees, and preview before saving.
Instructions
Create a single transaction in YNAB.
Args:
budget_id (string, optional): Budget UUID. Omit to use the default budget.
account_id (string, required): Account UUID.
amount_decimal (number, preferred): Amount in decimal currency units (for example, -50.00). Negative for expenses.
amount_milliunits (int, alternative): Explicit raw YNAB milliunits (for example, -50000).
amount (int, deprecated): Backward-compatible alias for amount_milliunits. Values are never guessed by magnitude.
date (string, required): ISO date YYYY-MM-DD.
payee_name (string, optional): Payee name (creates new payee if not found).
payee_id (string, optional): Existing payee UUID (alternative to payee_name).
category_id (string, optional): Category UUID.
memo (string, optional): Memo text.
cleared (string, optional): "cleared", "uncleared", or "reconciled". Default: "uncleared".
approved (boolean, optional): Mark as approved. Default: false.
flag_color (string, optional): Transaction flag color ("red", "orange", "yellow", "green", "blue", "purple").
dry_run (boolean, optional): Preview without saving. Default: false.
subtransactions (array, optional): Manual split lines. Each entry uses exactly one of amount_decimal, amount_milliunits, or deprecated amount, plus optional "memo", "category_id", "payee_id", and "payee_name".
Use "subtransactions" for manual split transactions. Use "ynab_create_receipt_split_transaction" when you have itemized receipt data and want proportional tax allocation handled for you. Advanced: "import_id" is supported, but it is intentionally not part of normal guidance. Usually omit it if you want the transaction to remain eligible for later bank-import matching.
Returns: created transaction with account_balance.
Examples:
$50 expense: set amount_decimal=-50.00
Already-converted data: set amount_milliunits=-50000
Write safety: call without confirmation_token to preview. Execute the identical validated request with the short-lived confirmation_token returned by that preview.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| memo | No | ||
| amount | No | Deprecated legacy alias for amount_milliunits. Use amount_decimal for currency input or amount_milliunits for raw YNAB values. | |
| cleared | No | ||
| dry_run | No | ||
| approved | No | ||
| payee_id | No | ||
| budget_id | No | ||
| import_id | No | ||
| account_id | Yes | ||
| flag_color | No | ||
| payee_name | No | ||
| category_id | No | ||
| amount_decimal | No | Preferred: amount in decimal currency units (for example, -12.34). Rounded exactly to the nearest YNAB milliunit. | |
| subtransactions | No | ||
| amount_milliunits | No | Raw YNAB milliunits. Use only when the value is already converted. | |
| confirmation_token | No | Short-lived, single-use token returned by the immediately preceding preview of this exact validated request. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||