match_description), a category that the transactions will be put into (category_guid), and an optional description that overwrites the transaction’s original description.
This guide will take you through the process of creating, updating, and deleting a transaction rule.
1. Create a Rule
First, you’ll need to create a new transaction rule — but keep a few things in mind:- When an end user creates a rule, the MX Platform will find all past and future transactions that match the
match_descriptionyou provide. The category and description of all matching transactions will then change to those provided by the end user. - The end user will decide on the category and optional description.. The category can be either a default MX category (accessible through the list default categories endpoint) or a custom category created by the end user (accessible through the list all categories endpoint). You must determine the best
match_description. - Matching is always performed between the
match_descriptionand the current transaction description. If a transaction’s description has been changed, it’s the current transaction description that will be compared, not any previous or original description. If a rule updates the description of a transaction, and then you create another rule that matches the updated transaction description, that transaction will be associated with the newer rule — including updating to whatever the new rule’s description specifies. - If you try to create a rule that has the same
match_descriptionas an existing rule on the sameuserobject, a409 Conflicterror will be returned.
Endpoint: POST /users/{user_guid}/transaction_rules
Automatic Creation
The MX system automatically creates rules under certain conditions. An automatic rule won’t be created if the transaction is already associated with an existing rule.- If the end user changes either the category or description of similar transactions three times, a rule will be created with the following attributes:
match_descriptionwill be set to the original transaction description.category_guidwill be the category set by the end user.descriptionwill be the one set by the end user, if applicable.
2. Update a Rule
End users may want to change something about their rule, such as the category or description. The update transaction rule endpoint accomplishes this. When updating a rule:- When the
category_guidordescriptionis updated, all transactions associated with the rule (past and future) will have the change applied. - However, updating the
match_descriptionhas no effect on existing associated transactions; instead, the rule will be applied to future transactions according to the newmatch_description.
Endpoint: PUT /users/{user_guid}/transaction_rules/{transaction_rule_guid}
3. Delete a Rule
To delete a transaction rule, use the delete transaction rule endpoint.Endpoint: DELETE /users/{user_guid}/transaction_rules/{transaction_rule_guid}

