Expand description
A Rust client for the YNAB API.
§Quick Start
use rust_ynab::{Client, PlanId};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(&std::env::var("YNAB_TOKEN")?)?;
let plans = client.get_plans().include_accounts().send().await?;
for plan in plans {
println!("{}", plan.name);
}
Ok(())
}Structs§
- Account
- A plan account. Amounts are in milliunits (divide by 1000 for display).
- ApiError
- Category
- A budget category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC) and are in milliunits (divide by 1000 for display).
- Category
Group - A group of budget categories.
- Client
- Client is the YNAB API client. Use Client::new() to create one.
- Currency
Format - Date
Format - Existing
Transaction - Request body for updating an existing transaction (PUT single).
- Money
Movement - A movement of money between categories. Amounts are in milliunits (divide by 1000 for display).
- Money
Movement Group - A group of related money movements.
- Month
- A plan month. This is where Ready to Assign, Age of Money, and category amounts (assigned, activity, available) are available. Amounts are in milliunits (divide by 1000 for display).
- NewCategory
- The category to create.
- NewTransaction
- Request body for creating a new transaction.
- Payee
- A payee for a plan.
- Payee
Location - A GPS location stored when a transaction is entered on a mobile device. Locations will not be available for all payees.
- Plan
- Summary information for a plan.
- Plan
Settings - Date and currency format settings for a plan.
- Post
Payee - Request body for creating a new payee. Name is required and must not exceed 500 characters.
- Save
Account - The account to create.
- Save
Category - The category to update. Only specified (non-
None) fields will be changed. - Save
Category Group - The category group to create or update.
- Save
Month Category - The month category to update. Only
budgeted(assigned) can be changed. - Save
Payee - Request body for updating an existing payee. All fields are optional; omitted fields are not changed.
- Save
Scheduled Transaction - Request body for creating or updating a scheduled transaction.
- Save
SubTransaction - A subtransaction within a split transaction to be created or updated.
- Save
Transaction With IdOr Import Id - Request body for a single transaction within a batch update (PATCH).
Either
idorimport_idmust be specified to identify the transaction. - Save
Transactions Response - Response from creating or batch-updating transactions.
- Scheduled
Subtransaction - A line item within a split scheduled transaction. Amounts are in milliunits (divide by 1000 for display).
- Scheduled
Transaction - A scheduled transaction. Amounts are in milliunits (divide by 1000 for display).
- Subtransaction
- A line item within a split transaction. Amounts are in milliunits (divide by 1000 for display).
- Transaction
- A plan transaction, excluding any pending transactions. Amounts are in milliunits (divide by 1000 for display).
- User
- The authenticated YNAB user.
Enums§
- Account
Type - The type of account.
- Cleared
Status - The cleared status of a transaction.
- Error
- Flag
Color - The color of a transaction flag.
- Frequency
- The recurrence frequency of a scheduled transaction.
- Goal
Type - The type of savings or spending goal assigned to a category.
- PlanId
- Identifies a plan for use in API requests.
- Save
Account Type - The type of account to create or update.
- Transaction
Type
Functions§
- milliunits_
to_ amount - Converts a YNAB milliunit amount to a dollar amount.
- print_
transaction_ table