models
#
Lunch Money Python SDK and Associated Objects
AssetsObject
#
Bases: LunchableModel
Manually Managed Asset Objects
Assets in Lunch Money are similar to plaid-accounts
except that they are manually managed.
https://lunchmoney.dev/#assets-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for asset |
required |
type_name |
str
|
Primary type of the asset. Must be one of: [employee compensation, cash, vehicle, loan, cryptocurrency, investment, other, credit, real estate] |
required |
subtype_name |
str | None
|
Optional asset subtype. Examples include: [retirement, checking, savings, prepaid credit card] |
None
|
name |
str
|
Name of the asset |
required |
display_name |
str | None
|
Display name of the asset (as set by user) |
None
|
balance |
float
|
Current balance of the asset in numeric format to 4 decimal places" |
required |
balance_as_of |
datetime | None
|
Date/time the balance was last updated in ISO 8601 extended format |
None
|
closed_on |
date | None
|
The date this asset was closed (optional) |
None
|
currency |
str
|
Three-letter lowercase currency code of the balance in ISO 4217 format |
required |
institution_name |
str | None
|
Name of institution holding the asset |
None
|
exclude_transactions |
bool
|
If true, this asset will not show up as an option for assignment when creating transactions manually |
False
|
created_at |
datetime
|
Date/time the asset was created in ISO 8601 extended format |
required |
Source code in lunchable/models/assets.py
BudgetObject
#
Bases: LunchableModel
Monthly Budget Per Category Object
https://lunchmoney.dev/#budget-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_name |
str
|
Name of the category |
required |
category_id |
int | None
|
Unique identifier for category |
None
|
category_group_name |
str | None
|
Name of the category group, if applicable |
None
|
group_id |
int | None
|
Unique identifier for category group |
None
|
is_group |
bool | None
|
If true, this category is a group |
None
|
is_income |
bool
|
If true, this category is an income category (category properties are set in the app via the Categories page) |
required |
exclude_from_budget |
bool
|
If true, this category is excluded from budget (category properties are set in the app via the Categories page) |
required |
exclude_from_totals |
bool
|
If true, this category is excluded from totals (category properties are set in the app via the Categories page) |
required |
data |
Dict[date, BudgetDataObject]
|
For each month with budget or category spending data, there is a data object with the key set to the month in format YYYY-MM-DD. For properties, see Data object below. |
required |
config |
BudgetConfigObject | None
|
Object representing the category's budget suggestion configuration |
None
|
Source code in lunchable/models/budgets.py
CategoriesObject
#
Bases: LunchableModel
Lunch Money Spending Categories
https://lunchmoney.dev/#categories-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
A unique identifier for the category. |
required |
name |
str
|
The name of the category. Must be between 1 and 40 characters. |
required |
description |
str | None
|
The description of the category. Must not exceed 140 characters. |
None
|
is_income |
bool
|
If true, the transactions in this category will be treated as income. |
required |
exclude_from_budget |
bool
|
If true, the transactions in this category will be excluded from the budget. |
required |
exclude_from_totals |
bool
|
If true, the transactions in this category will be excluded from totals. |
required |
archived |
bool
|
If true, the category is archived and not displayed in relevant areas of the Lunch Money app. |
False
|
archived_on |
datetime | None
|
The date and time of when the category was last archived (in the ISO 8601 extended format). |
None
|
updated_at |
datetime | None
|
The date and time of when the category was last updated (in the ISO 8601 extended format). |
None
|
created_at |
datetime | None
|
The date and time of when the category was created (in the ISO 8601 extended format). |
None
|
is_group |
bool
|
If true, the category is a group that can be a parent to other categories. |
required |
group_id |
int | None
|
The ID of a category group (or null if the category doesn't belong to a category group). |
None
|
order |
int | None
|
Numerical ordering of categories |
None
|
children |
List[Union[CategoriesObject, CategoryChild]] | None
|
For category groups, this will populate with the categories nested within and include id, name, description and created_at fields. |
None
|
Source code in lunchable/models/categories.py
CryptoObject
#
Bases: LunchableModel
Crypto Asset Object
https://lunchmoney.dev/#crypto-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for a manual crypto account (no ID for synced accounts) |
required |
zabo_account_id |
int | None
|
Unique identifier for a synced crypto account (no ID for manual accounts, multiple currencies may have the same zabo_account_id) |
None
|
source |
str
|
|
required |
name |
str
|
Name of the crypto asset |
required |
display_name |
str | None
|
Display name of the crypto asset (as set by user) |
None
|
balance |
float
|
Current balance |
required |
balance_as_of |
datetime | None
|
Date/time the balance was last updated in ISO 8601 extended format |
None
|
currency |
str | None
|
Abbreviation for the cryptocurrency |
None
|
status |
str | None
|
The current status of the crypto account. Either active or in error. |
None
|
institution_name |
str | None
|
Name of provider holding the asset |
None
|
created_at |
datetime
|
Date/time the asset was created in ISO 8601 extended format |
required |
Source code in lunchable/models/crypto.py
LunchableModel
#
Bases: BaseModel
Hashable Pydantic Model
Source code in lunchable/models/_base.py
PlaidAccountObject
#
Bases: LunchableModel
Assets synced from Plaid
Similar to AssetObjects, these accounts are linked to remote sources in Plaid.
https://lunchmoney.dev/#plaid-accounts-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier of Plaid account |
required |
date_linked |
date
|
Date account was first linked in ISO 8601 extended format |
required |
name |
str
|
Name of the account. Can be overridden by the user. Field is originally set by Plaid |
required |
type |
str
|
Primary type of account. Typically one of: [credit, depository, brokerage, cash, loan, investment]. This field is set by Plaid and cannot be altered. |
required |
subtype |
str
|
Optional subtype name of account. This field is set by Plaid and cannot be altered |
required |
mask |
str | None
|
Mask (last 3 to 4 digits of account) of account. This field is set by Plaid and cannot be altered |
None
|
institution_name |
str
|
Name of institution associated with account. This field is set by Plaid and cannot be altered |
required |
status |
str
|
Denotes the current status of the account within Lunch Money. Must be one of: active (Account is active and in good state), inactive (Account marked inactive from user. No transactions fetched or balance update for this account), relink (Account needs to be relinked with Plaid), syncing (Account is awaiting first import of transactions), error (Account is in error with Plaid), not found (Account is in error with Plaid), not supported (Account is in error with Plaid) |
required |
last_import |
datetime | None
|
Date of last imported transaction in ISO 8601 extended format (not necessarily date of last attempted import) |
None
|
balance |
float | None
|
Current balance of the account in numeric format to 4 decimal places. This field is set by Plaid and cannot be altered |
None
|
currency |
str
|
Currency of account balance in ISO 4217 format. This field is set by Plaid and cannot be altered |
required |
balance_last_update |
datetime
|
Date balance was last updated in ISO 8601 extended format. This field is set by Plaid and cannot be altered |
required |
limit |
int | None
|
Optional credit limit of the account. This field is set by Plaid and cannot be altered |
None
|
Source code in lunchable/models/plaid_accounts.py
RecurringExpensesObject
#
Bases: LunchableModel
Recurring Expenses Object
https://lunchmoney.dev/#recurring-expenses-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for recurring expense |
required |
start_date |
date | None
|
Denotes when recurring expense starts occurring in ISO 8601 format. If null, then this recurring expense will show up for all time before end_date |
None
|
end_date |
date | None
|
Denotes when recurring expense stops occurring in ISO 8601 format. If null, then this recurring expense has no set end date and will show up for all months after start_date |
None
|
cadence |
str
|
One of: [monthly, twice a month, once a week, every 3 months, every 4 months, twice a year, yearly] |
required |
payee |
str
|
Payee of the recurring expense |
required |
amount |
float
|
Amount of the recurring expense in numeric format to 4 decimal places |
required |
currency |
str
|
Three-letter lowercase currency code for the recurring expense in ISO 4217 format |
required |
description |
str | None
|
If any, represents the user-entered description of the recurring expense |
None
|
billing_date |
date
|
Expected billing date for this recurring expense for this month in ISO 8601 format |
required |
type |
str
|
This can be one of two values: cleared (The recurring expense has been reviewed by the user), suggested (The recurring expense is suggested by the system; the user has yet to review/clear it) |
required |
original_name |
str | None
|
If any, represents the original name of the recurring expense as denoted by the transaction that triggered its creation |
None
|
source |
str
|
This can be one of three values: manual (User created this recurring expense manually from the Recurring Expenses page), transaction (User created this by converting a transaction from the Transactions page), system (Recurring expense was created by the system on transaction import). Some older recurring expenses may not have a source. |
required |
plaid_account_id |
int | None
|
If any, denotes the plaid account associated with the creation of this " recurring expense (see Plaid Accounts) |
None
|
asset_id |
int | None
|
If any, denotes the manually-managed account (i.e. asset) associated with the creation of this recurring expense (see Assets) |
None
|
category_id |
int | None
|
If any, denotes the unique identifier for the associated category to this recurring expense |
None
|
Source code in lunchable/models/recurring_expenses.py
TagsObject
#
Bases: LunchableModel
Lunchmoney Tags object
https://lunchmoney.dev/#tags-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for tag |
required |
name |
str
|
User-defined name of tag |
required |
description |
str | None
|
User-defined description of tag |
None
|
archived |
bool
|
If true, the tag will not show up when creating or updating transactions in the Lunch Money app |
False
|
Source code in lunchable/models/tags.py
TransactionBaseObject
#
TransactionInsertObject
#
Bases: TransactionBaseObject
Object For Creating New Transactions
https://lunchmoney.dev/#insert-transactions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date
|
Must be in ISO 8601 format (YYYY-MM-DD). |
required |
amount |
float
|
Numeric value of amount. i.e. $4.25 should be denoted as 4.25. |
required |
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account and must not be a category group. |
None
|
payee |
str | None
|
Max 140 characters |
None
|
currency |
str | None
|
Three-letter lowercase currency code in ISO 4217 format. The code sent must exist in our database. Defaults to user account's primary currency. |
None
|
asset_id |
int | None
|
Unique identifier for associated asset (manually-managed account). Asset must be associated with the same account. |
None
|
recurring_id |
int | None
|
Unique identifier for associated recurring expense. Recurring expense must be associated with the same account. |
None
|
notes |
str | None
|
Max 350 characters |
None
|
status |
StatusEnum | None
|
Must be either cleared or uncleared. If recurring_id is provided, the status will automatically be set to recurring or recurring_suggested depending on the type of recurring_id. Defaults to uncleared. |
None
|
external_id |
str | None
|
User-defined external ID for transaction. Max 75 characters. External IDs must be unique within the same asset_id. |
None
|
tags |
List[Union[str, int]] | None
|
Passing in a number will attempt to match by ID. If no matching tag ID is found, an error will be thrown. Passing in a string will attempt to match by string. If no matching tag name is found, a new tag will be created. |
None
|
Source code in lunchable/models/transactions.py
TransactionObject
#
Bases: TransactionBaseObject
Universal Lunch Money Transaction Object
https://lunchmoney.dev/#transaction-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for transaction |
required |
date |
date
|
Date of transaction in ISO 8601 format |
required |
payee |
str | None
|
Name of payee. If recurring_id is not null, this field will show the payee of associated recurring expense instead of the original transaction payee |
None
|
amount |
float
|
Amount of the transaction in numeric format to 4 decimal places |
required |
currency |
str | None
|
Three-letter lowercase currency code of the transaction in ISO 4217 format |
None
|
to_base |
float | None
|
The amount converted to the user's primary currency. If the multicurrency feature is not being used, to_base and amount will be the same. |
None
|
category_id |
int | None
|
Unique identifier of associated category |
None
|
category_name |
str | None
|
Name of category associated with transaction |
None
|
category_group_id |
int | None
|
Unique identifier of associated category group, if any |
None
|
category_group_name |
str | None
|
Name of category group associated with transaction, if any |
None
|
is_income |
bool | None
|
Based on the associated category's property, denotes if transaction is treated as income |
None
|
exclude_from_budget |
bool | None
|
Based on the associated category's property, denotes if transaction is excluded from budget |
None
|
exclude_from_totals |
bool | None
|
Based on the associated category's property, denotes if transaction is excluded from totals |
None
|
created_at |
datetime
|
The date and time of when the transaction was created (in the ISO 8601 extended format). |
required |
updated_at |
datetime
|
The date and time of when the transaction was last updated (in the ISO 8601 extended format). |
required |
status |
str | None
|
One of the following:
|
None
|
is_pending |
bool | None
|
Denotes if transaction is pending (not posted) |
None
|
notes |
str | None
|
User-entered transaction notes If recurring_id is not null, this field will be description of associated recurring expense |
None
|
original_name |
str | None
|
The transactions original name before any payee name updates. For synced transactions, this is the raw original payee name from your bank. |
None
|
recurring_id |
int | None
|
Unique identifier of associated recurring item |
None
|
recurring_payee |
str | None
|
Payee name of associated recurring item |
None
|
recurring_description |
str | None
|
Description of associated recurring item |
None
|
recurring_cadence |
str | None
|
Cadence of associated recurring item (one of |
None
|
recurring_type |
str | None
|
Type of associated recurring (one of |
None
|
recurring_amount |
float | None
|
Amount of associated recurring item |
None
|
recurring_currency |
str | None
|
Currency of associated recurring item |
None
|
parent_id |
int | None
|
Exists if this is a split transaction. Denotes the transaction ID of the original transaction. Note that the parent transaction is not returned in this call. |
None
|
has_children |
bool | None
|
True if this transaction is a parent transaction and is split into 2 or more other transactions |
None
|
group_id |
int | None
|
Exists if this transaction is part of a group. Denotes the parent’s transaction ID |
None
|
is_group |
bool | None
|
True if this transaction represents a group of transactions. If so, amount and currency represent the totalled amount of transactions bearing this transaction’s id as their group_id. Amount is calculated based on the user’s primary currency. |
None
|
asset_id |
int | None
|
Unique identifier of associated manually-managed account (see Assets) Note: plaid_account_id and asset_id cannot both exist for a transaction |
None
|
asset_institution_name |
str | None
|
Institution name of associated manually-managed account |
None
|
asset_name |
str | None
|
Name of associated manually-managed account |
None
|
asset_display_name |
str | None
|
Display name of associated manually-managed account |
None
|
asset_status |
str | None
|
Status of associated manually-managed account (one of |
None
|
plaid_account_id |
int | None
|
Unique identifier of associated Plaid account (see Plaid Accounts) Note: plaid_account_id and asset_id cannot both exist for a transaction |
None
|
plaid_account_name |
str | None
|
Name of associated Plaid account |
None
|
plaid_account_mask |
str | None
|
Mask of associated Plaid account |
None
|
institution_name |
str | None
|
Institution name of associated Plaid account |
None
|
plaid_account_display_name |
str | None
|
Display name of associated Plaid account |
None
|
plaid_metadata |
Dict[str, Any] | None
|
Metadata associated with imported transaction from Plaid |
None
|
source |
str | None
|
Source of the transaction (one of |
None
|
display_name |
str | None
|
Display name for payee for transaction based on whether or not it is
linked to a recurring item. If linked, returns |
None
|
display_notes |
str | None
|
Display notes for transaction based on whether or not it is linked to a
recurring item. If linked, returns |
None
|
account_display_name |
str | None
|
Display name for associated account (manual or Plaid). If this is a synced
account, returns |
None
|
tags |
List[TagsObject] | None
|
Array of Tag objects |
None
|
external_id |
str | None
|
User-defined external ID for any manually-entered or imported transaction. External ID cannot be accessed or changed for Plaid-imported transactions. External ID must be unique by asset_id. Max 75 characters. |
None
|
children |
List[TransactionChildObject] | None
|
Array of Transaction objects. Only exists if this transaction is a parent transaction and is split into 2 or more other transactions. Child transactions do not contain all of the same fields as parent transactions. |
None
|
Source code in lunchable/models/transactions.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
|
get_insert_object()
#
Return a TransactionInsertObject
Return a TransactionInsertObject to update an expense. Simply
change some of the properties and perform an insert_transactions
with
your Lunchable object.
Returns:
Type | Description |
---|---|
TransactionInsertObject
|
|
Source code in lunchable/models/transactions.py
get_update_object()
#
Return a TransactionUpdateObject
Return a TransactionUpdateObject to update an expense. Simply
change one of the properties and perform an update_transaction
with
your Lunchable object.
Returns:
Type | Description |
---|---|
TransactionUpdateObject
|
|
Source code in lunchable/models/transactions.py
to_json(x)
#
Check a result
Source code in lunchable/models/transactions.py
TransactionSplitObject
#
Bases: TransactionBaseObject
Object for Splitting Transactions
https://lunchmoney.dev/#split-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date
|
Must be in ISO 8601 format (YYYY-MM-DD). |
required |
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account. |
None
|
notes |
str | None
|
Transaction Split Notes. |
None
|
amount |
float
|
Individual amount of split. Currency will inherit from parent transaction. All amounts must sum up to parent transaction amount. |
required |
Source code in lunchable/models/transactions.py
TransactionUpdateObject
#
Bases: TransactionBaseObject
Object For Updating Existing Transactions
https://lunchmoney.dev/#update-transaction
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date | None
|
Must be in ISO 8601 format (YYYY-MM-DD). |
None
|
category_id |
int | None
|
Unique identifier for associated category_id. Category must be associated with the same account and must not be a category group. |
None
|
payee |
str | None
|
Max 140 characters |
None
|
amount |
float | None
|
You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
currency |
str | None
|
You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id. Defaults to user account's primary currency. |
None
|
asset_id |
int | None
|
Unique identifier for associated asset (manually-managed account). Asset must be associated with the same account. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
recurring_id |
int | None
|
Unique identifier for associated recurring expense. Recurring expense must be associated with the same account. |
None
|
notes |
str | None
|
Max 350 characters |
None
|
status |
StatusEnum | None
|
Must be either cleared or uncleared. Defaults to uncleared If recurring_id is provided, the status will automatically be set to recurring or recurring_suggested depending on the type of recurring_id. Defaults to uncleared. |
None
|
external_id |
str | None
|
User-defined external ID for transaction. Max 75 characters. External IDs must be unique within the same asset_id. You may only update this if this transaction was not created from an automatic import, i.e. if this transaction is not associated with a plaid_account_id |
None
|
tags |
List[Union[str, int]] | None
|
Passing in a number will attempt to match by ID. If no matching tag ID is found, an error will be thrown. Passing in a string will attempt to match by string. If no matching tag name is found, a new tag will be created. |
None
|
Source code in lunchable/models/transactions.py
UserObject
#
Bases: LunchableModel
The LunchMoney User
object
https://lunchmoney.dev/#user-object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_id |
int
|
Unique identifier for user |
required |
user_name |
str
|
User's' name |
required |
user_email |
str
|
User's' Email |
required |
account_id |
int
|
Unique identifier for the associated budgeting account |
required |
budget_name |
str
|
Name of the associated budgeting account |
required |
api_key_label |
str | None
|
User-defined label of the developer API key used. Returns null if nothing has been set. |
None
|