Skip to main content
Version: 0.1.21 (Current)

create_transaction_category

Type: mutation

Creates a new transaction category

Signature

async def create_transaction_category(
group_id: str,
transaction_category_name: str,
rollover_start_month: datetime = datetime.today().replace(day=1),
icon: str = "\U00002753",
rollover_enabled: bool = False,
rollover_type: str = "monthly",
rollover_frequency: str = "monthly",
rollover_starting_balance: float = 0
) -> Dict[str, Any]

Parameters

ParameterTypeRequiredDescription
group_idstrYesThe transaction category group id
transaction_category_namestrYesThe name of the transaction category being created
rollover_start_monthdatetimeNoThe datetime of the rollover start month
iconstrNoThe icon of the transaction category. This accepts the unicode string or emoji.
rollover_enabledboolNoA bool whether the transaction category should be rolled over or not
rollover_typestrNoThe budget roll over type
rollover_frequencystrNoThe rollover frequency, e.g. "monthly" (default: "monthly")
rollover_starting_balancefloatNoThe starting balance for rollover (default: 0)

Example

from monarchmoney import MonarchMoney

mm = MonarchMoney()
await mm.login(email, password)

result = await mm.create_transaction_category("example_group_id", "example_transaction_category_name")
print(result)

GraphQL Operation

Operation Name: Web_CreateCategory

GraphQL Query

mutation Web_CreateCategory($input: CreateCategoryInput!) {
createCategory(input: $input) {
errors {
...PayloadErrorFields
__typename
}
category {
id
...CategoryFormFields
__typename
}
__typename
}
}
fragment PayloadErrorFields on PayloadError {
fieldErrors {
field
messages
__typename
}
message
code
__typename
}
fragment CategoryFormFields on Category {
id
order
name
systemCategory
systemCategoryDisplayName
budgetVariability
isSystemCategory
isDisabled
group {
id
type
groupLevelBudgetingEnabled
__typename
}
rolloverPeriod {
id
startMonth
startingBalance
__typename
}
__typename
}

Try It Out

To test this API method locally:

  1. Install the package: pip install monarchmoney
  2. Create a Python script with the example code above
  3. Replace email and password with your Monarch Money credentials
  4. Run the script

See the Authentication Guide for details on logging in.