create_transaction
Type: mutation
Creates a transaction with the given parameters
Signature
async def create_transaction(
date: str,
account_id: str,
amount: float,
merchant_name: str,
category_id: str,
notes: str = "",
update_balance: bool = False
) -> Dict[str, Any]
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
date | str | Yes | - |
account_id | str | Yes | - |
amount | float | Yes | - |
merchant_name | str | Yes | - |
category_id | str | Yes | - |
notes | str | No | - |
update_balance | bool | No | - |
Example
from monarchmoney import MonarchMoney
mm = MonarchMoney()
await mm.login(email, password)
result = await mm.create_transaction("example_date", "example_account_id", 100.0, "example_merchant_name", "example_category_id")
print(result)
GraphQL Operation
Operation Name: Common_CreateTransactionMutation
GraphQL Query
mutation Common_CreateTransactionMutation($input: CreateTransactionMutationInput!) {
createTransaction(input: $input) {
errors {
...PayloadErrorFields
__typename
}
transaction {
id
}
__typename
}
}
fragment PayloadErrorFields on PayloadError {
fieldErrors {
field
messages
__typename
}
message
code
__typename
}
Try It Out
To test this API method locally:
- Install the package:
pip install monarchmoney - Create a Python script with the example code above
- Replace
emailandpasswordwith your Monarch Money credentials - Run the script
See the Authentication Guide for details on logging in.