transactions
#
Lunch Money - Transactions
https://lunchmoney.dev/#transactions
FullStatusEnum
#
Status Options
Source code in lunchable/models/transactions.py
TransactionBaseObject
#
TransactionChildObject
#
Bases: TransactionBaseObject
Child Transaction Object for Transaction Groups
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
Unique identifier for transaction |
required |
amount |
float
|
Amount of the transaction in numeric format to 4 decimal places |
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
|
date |
date
|
Date of transaction in ISO 8601 format |
required |
formatted_date |
str | None
|
Date of transaction in user's preferred format |
None
|
notes |
str | None
|
User-entered transaction notes If recurring_id is not null, this field will be description of associated recurring expense |
None
|
currency |
str | None
|
Three-letter lowercase currency code of the transaction in ISO 4217 format |
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
|
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
|
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
|
Source code in lunchable/models/transactions.py
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
TransactionsClient
#
Bases: LunchMoneyAPIClient
Lunch Money Transactions Interactions
Source code in lunchable/models/transactions.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 |
|
get_transaction(transaction_id, debit_as_negative=None)
#
Get a Transaction by ID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction_id |
int
|
Lunch Money Transaction ID |
required |
debit_as_negative |
Optional[bool]
|
Pass in true if you'd like expenses to be returned as negative amounts and credits as positive amounts. Defaults to false. |
None
|
Returns:
Type | Description |
---|---|
TransactionObject
|
|
Examples:
Retrieve a single transaction by its ID
from lunchable import LunchMoney
lunch = LunchMoney(access_token="xxxxxxx")
transaction = lunch.get_transaction(transaction_id=1234)
The above code returns a TransactionObject with ID # 1234 (assuming it exists)
Source code in lunchable/models/transactions.py
get_transaction_group(transaction_id)
#
Get a Transaction Group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction_id |
int
|
Transaction ID of either the parent or any of the children in the transaction group |
required |
Returns:
Type | Description |
---|---|
TransactionObject
|
The transaction group as a |
Source code in lunchable/models/transactions.py
get_transactions(start_date=None, end_date=None, tag_id=None, recurring_id=None, plaid_account_id=None, category_id=None, asset_id=None, group_id=None, is_group=None, status=None, offset=None, limit=None, debit_as_negative=None, pending=None, params=None)
#
Get Transactions Using Criteria
Use this to retrieve all transactions between a date range (this method handles pagination automatically unless you specify a limit / offset argument). Returns list of Transaction objects. If no query parameters are set, this will return transactions for the current calendar month. If either start_date or end_date are datetime.datetime objects, they will be reduced to dates. If a string is provided, it will be attempted to be parsed as YYYY-MM-DD format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_date |
Optional[Union[date, datetime, str]]
|
Denotes the beginning of the time period to fetch transactions for. Defaults to beginning of current month. Required if end_date exists. Format: YYYY-MM-DD. |
None
|
end_date |
Optional[Union[date, datetime, str]]
|
Denotes the end of the time period you'd like to get transactions for. Defaults to end of current month. Required if start_date exists. |
None
|
tag_id |
Optional[int]
|
Filter by tag. Only accepts IDs, not names. |
None
|
recurring_id |
Optional[int]
|
Filter by recurring expense |
None
|
plaid_account_id |
Optional[int]
|
Filter by Plaid account |
None
|
category_id |
Optional[int]
|
Filter by category. Will also match category groups. |
None
|
asset_id |
Optional[int]
|
Filter by asset |
None
|
group_id |
Optional[int]
|
Filter by group_id (if the transaction is part of a specific group) |
None
|
is_group |
Optional[bool]
|
Filter by group (returns transaction groups) |
None
|
status |
Optional[str]
|
Filter by status (Can be cleared or uncleared. For recurring transactions, use recurring) |
None
|
offset |
Optional[int]
|
Sets the offset for the records returned (disables automatic pagination) |
None
|
limit |
Optional[int]
|
Sets the maximum number of records to return. Defaults to 1000 (disables automatic pagination) |
None
|
debit_as_negative |
Optional[bool]
|
Pass in true if you'd like expenses to be returned as negative amounts and credits as positive amounts. Defaults to false. |
None
|
pending |
Optional[bool]
|
Pass in true if you'd like to include imported transactions with a pending status. |
None
|
params |
Optional[Dict[str, Any]]
|
Additional Query String Params |
None
|
Returns:
Type | Description |
---|---|
List[TransactionObject]
|
A list of transactions |
Examples:
Retrieve a list of TransactionObject
from lunchable import LunchMoney
lunch = LunchMoney(access_token="xxxxxxx")
transactions = lunch.get_transactions(start_date="2020-01-01",
end_date="2020-01-31")
Source code in lunchable/models/transactions.py
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
|
insert_transaction_group(date, payee, transactions, category_id=None, notes=None, tags=None)
#
Create a Transaction Group of Two or More Transactions
Returns the ID of the newly created transaction group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
date
|
Date for the grouped transaction |
required |
payee |
str
|
Payee name for the grouped transaction |
required |
category_id |
Optional[int]
|
Category for the grouped transaction |
None
|
notes |
Optional[str]
|
Notes for the grouped transaction |
None
|
tags |
Optional[List[int]]
|
Array of tag IDs for the grouped transaction |
None
|
transactions |
List[int]
|
Array of transaction IDs to be part of the transaction group |
required |
Returns:
Type | Description |
---|---|
int
|
|
Source code in lunchable/models/transactions.py
insert_transactions(transactions, apply_rules=None, skip_duplicates=None, debit_as_negative=None, check_for_recurring=None, skip_balance_update=None)
#
Create One or Many Lunch Money Transactions
Use this endpoint to insert many transactions at once. Also accepts a single transaction as well. If a TransactionObject is provided it will be converted into a TransactionInsertObject.
https://lunchmoney.dev/#insert-transactions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transactions |
ListOrSingleTransactionInsertObject
|
Transactions to insert. Either a single TransactionInsertObject object or a list of them |
required |
apply_rules |
Optional[bool]
|
If true, will apply account's existing rules to the inserted transactions. Defaults to false. |
None
|
skip_duplicates |
Optional[bool]
|
If true, the system will automatically dedupe based on transaction date, payee and amount. Note that deduping by external_id will occur regardless of this flag. |
None
|
check_for_recurring |
Optional[bool]
|
if true, will check new transactions for occurrences of new monthly expenses. Defaults to false. |
None
|
debit_as_negative |
Optional[bool]
|
If true, will assume negative amount values denote expenses and positive amount values denote credits. Defaults to false. |
None
|
skip_balance_update |
Optional[bool]
|
If false, will skip updating balance if an asset_id is present for any of the transactions. |
None
|
Returns:
Type | Description |
---|---|
List[int]
|
|
Examples:
Create a new transaction with a TransactionInsertObject
from lunchable import LunchMoney, TransactionInsertObject
lunch = LunchMoney(access_token="xxxxxxx")
new_transaction = TransactionInsertObject(payee="Example Restaurant",
amount=120.00,
notes="Saturday Dinner")
new_transaction_ids = lunch.insert_transactions(transactions=new_transaction)
Source code in lunchable/models/transactions.py
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 |
|
remove_transaction_group(transaction_group_id)
#
Delete a Transaction Group
Use this method to delete a transaction group. The transactions within the group will not be removed.
Returns the IDs of the transactions that were part of the deleted group
https://lunchmoney.dev/#delete-transaction-group
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction_group_id |
int
|
Transaction Group Identifier |
required |
Returns:
Type | Description |
---|---|
List[int]
|
|
Source code in lunchable/models/transactions.py
unsplit_transactions(parent_ids, remove_parents=None)
#
Unsplit Transactions
Use this endpoint to unsplit one or more transactions.
Returns an array of IDs of deleted transactions
https://lunchmoney.dev/#unsplit-transactions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_ids |
List[int]
|
Array of transaction IDs to unsplit. If one transaction is unsplittable, no transaction will be unsplit. |
required |
remove_parents |
Optional[bool]
|
If true, deletes the original parent transaction as well. Note, this is unreversable! |
None
|
Returns:
Type | Description |
---|---|
List[int]
|
|
Source code in lunchable/models/transactions.py
update_transaction(transaction_id, transaction=None, split=None, debit_as_negative=None, skip_balance_update=None)
#
Update a Transaction
Use this endpoint to update a single transaction. You may also use this to split an existing transaction. If a TransactionObject is provided it will be converted into a TransactionUpdateObject.
PUT https://dev.lunchmoney.app/v1/transactions/:transaction_id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transaction_id |
int
|
Lunch Money Transaction ID |
required |
transaction |
ListOrSingleTransactionUpdateObject
|
Object to update with |
None
|
split |
Optional[List[TransactionSplitObject]]
|
Defines the split of a transaction. You may not split an already-split transaction, recurring transaction, or group transaction. |
None
|
debit_as_negative |
Optional[bool]
|
If true, will assume negative amount values denote expenses and positive amount values denote credits. Defaults to false. |
None
|
skip_balance_update |
Optional[bool]
|
If false, will skip updating balance if an asset_id is present for any of the transactions. |
None
|
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
|
Examples:
Update a transaction with a TransactionUpdateObject
from datetime import datetime
from lunchable import LunchMoney, TransactionUpdateObject
lunch = LunchMoney(access_token="xxxxxxx")
transaction_note = f"Updated on {datetime.now()}"
notes_update = TransactionUpdateObject(notes=transaction_note)
response = lunch.update_transaction(transaction_id=1234,
transaction=notes_update)
Update a TransactionObject with itself
from datetime import datetime, timedelta
from lunchable import LunchMoney
lunch = LunchMoney(access_token="xxxxxxx")
transaction = lunch.get_transaction(transaction_id=1234)
transaction.notes = f"Updated on {datetime.now()}"
transaction.date = transaction.date + timedelta(days=1)
response = lunch.update_transaction(transaction_id=transaction.id,
transaction=transaction)
Source code in lunchable/models/transactions.py
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
|