resources
Monzo API 'transactions' resource.
TransactionsResource
dataclass
Bases: BaseResource
Monzo API 'transactions' resource.
Note
Monzo API docs: https://docs.monzo.com/#transactions
Source code in pymonzo/transactions/resources.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
annotate(transaction_id, metadata)
Annotate transaction with extra metadata.
Note
Monzo API docs: https://docs.monzo.com/#annotate-transaction
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transaction_id |
str
|
The ID of the transaction. |
required |
metadata |
Dict[str, str]
|
Include each key you would like to modify. To delete a key, set its value to an empty string. |
required |
Returns:
| Type | Description |
|---|---|
MonzoTransaction
|
Annotated Monzo transaction. |
Source code in pymonzo/transactions/resources.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
get(transaction_id, *, expand_merchant=False)
Return single transaction.
Note
Monzo API docs: https://docs.monzo.com/#retrieve-transaction
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transaction_id |
str
|
The ID of the transaction. |
required |
expand_merchant |
bool
|
Whether to return expanded merchant information. |
False
|
Returns:
| Type | Description |
|---|---|
MonzoTransaction
|
A Monzo transaction. |
Source code in pymonzo/transactions/resources.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
list(account_id=None, *, expand_merchant=False, since=None, before=None, limit=None)
Return a list of account transactions.
You can only fetch all transactions within 5 minutes of authentication. After that, you can query your last 90 days.
Note
Monzo API docs: https://docs.monzo.com/#list-transactions
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id |
Optional[str]
|
The ID of the account. Can be omitted if user has only one active account. |
None
|
expand_merchant |
bool
|
Whether to return expanded merchant information. |
False
|
since |
Optional[datetime]
|
Filter transactions by start time. |
None
|
before |
Optional[datetime]
|
Filter transactions by end time. |
None
|
limit |
Optional[int]
|
Limits the number of results per-page. Maximum: 100. |
None
|
Returns:
| Type | Description |
|---|---|
List[MonzoTransaction]
|
List of Monzo transactions. |
Raises:
| Type | Description |
|---|---|
CannotDetermineDefaultAccount
|
If no account ID was passed and default account cannot be determined. |
Source code in pymonzo/transactions/resources.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |