Skip to main content

Auto fill expenses using merchant based expense rules

This article covers how to automatically complete expenses based on the merchant towards which the expense was made.

P
Written by Product Team

Introduction to merchant based expense rules

As an admin, you can create smart expense rules to automatically fill expense values based on the merchant of the expense. For example, if the merchant is Starbucks, you can configure a rule to automatically set the category as Food. If the merchant is Sage Expense Management, you can automatically set the category to Software Subscriptions.

Setting up these rules eliminates the need for your employees to fill up expenses, and ensures that all expenses are correctly coded. We strongly recommend setting up expense rules for your most common merchants.

Creating expense rules

To create a new expense rule,

  1. Go to Admin Settings > Workflows > Expense Rules.

  2. Click on Add Expense Rule.

    • Step 1: If

      Enter the characters present in the merchant name. Expense rules use substring matching, which means the text entered in the rule must appear in the merchant name on the expense. For example, if you enter "Amazon", it will match with all merchants containing this string including "Amazon US", "Amazon Services" and "Amazon".

      'OPEN AI INC' will not match an expense with the merchant: 'openaiinc'

    • Step 2: Then Set

      Set the fields you want to set based on the merchant name. This could be Category, Project, Cost Center or any other custom fields.

    • Step 3: Apply this rule to

      Choose whether the rule is applied to all employees or only specific departments.

What happens after an expense rule is created?

  1. Once an expense rule is created, it will be applied on all future expenses. Previously created expenses will not be automatically completed because of the rule.

  2. Whenever a matching merchant is found for an expense rule, the fields on that expense will be automatically coded as per the expense rule.

What happens after an expense rule is created?

  1. Once an expense rule is created, it applies to eligible expenses created after the rule is configured.

  2. When Sage Expense Management finds a matching merchant, the fields configured in the rule are automatically filled on the expense.

Note:

  • Expense rules are processed in the background and may not be applied immediately after an expense is created. They are typically applied quickly, but in some cases it might take a few minutes.

  • Expense rules are not applied retroactively to existing expenses.

  • Similarly, if you modify an existing expense rule, the updated rule is not retroactively applied to older expenses. The new configuration applies going forward when eligible expenses are subsequently created or processed.

When will an expense rule not be applied?

There are certain situations where an expense rule, or individual fields within the rule, may not be applied.

  1. The merchant does not match the rule

    The merchant name on the expense must contain the merchant text configured in the rule. Differences in merchant names, additional or missing text, or unexpected formatting can prevent a match.

    This might happen when an expense is created using receipt extraction or email forwarding. The merchant extracted from the receipt may differ from the merchant name received through a corporate card feed.

    For example:

    Expense rule: RETELL AI INC
    Merchant extracted from receipt: Retellai

    Since the configured text is not present in the merchant name, the rule will not be applied.

  2. The employee manually enters or edits expense details

    Manual input takes precedence over expense rules.

    If an employee manually creates an expense and fills in its details, expense rules will not override those manually entered values.

    Similarly, if the employee edits the merchant name before the expense rule is applied, the expense is treated as having been manually updated and the merchant-based rule will not be applied.

  3. The employee is restricted from using a value

    Employee restrictions take precedence over expense rules.

    If an employee does not have access to a Category, Project, or Cost Center specified by an expense rule, that restricted value will not be filled on the expense.

    Other eligible fields in the same rule can still be applied.

    For example:

    If merchant contains "amaz"

    Then set:

    • Merchant to Amazon.com

    • Category to Office Supplies

    If the employee is not allowed to use the Office Supplies category, the rule can update the merchant to Amazon.com, but the category will remain empty.

  4. A custom field is not available for the selected category

    Category-specific custom field restrictions also take precedence over expense rules.

    If a custom field or custom field value configured in an expense rule is not available for the expense's category, that field will not be set by the rule.

  5. The expense existed before the rule was created

    Expense rules are not retroactively applied to existing expenses.

    Only eligible expenses created after the rule is configured can be automatically coded using that rule.

Best practices for configuring merchant names

Merchant names can vary depending on the bank, card network, receipt, or source from which the expense was created. Keep the following recommendations in mind when creating rules.

  • Use the merchant name received from the bank

    For corporate card expenses, you can configure the rule using the exact merchant name received from the bank.

    For example:

    AT&T MOBILITY EPAY DALLAS USA

    Be careful with spaces and additional characters. Extra characters or spaces in the configured condition can prevent an expense from matching the rule.

  • Use a shorter, consistent portion of the merchant name

    Instead of using the entire merchant name, use a portion that consistently appears across transactions.

    For example: AT&T MOBILITY

    may be more reliable than using the complete merchant description if the location or other parts of the merchant name vary.

    Other examples include:

    • TRACKMYSUBS

    • PP*GOOGLE

    • Amazon

    Entering Amazon, for example, can match Amazon US, Amazon Services, and other merchant names containing Amazon.

    Make sure the keyword is specific enough that it does not unintentionally match unrelated merchants.

  • Use % to account for variable characters

    You can use % as a flexible placeholder for characters that may vary within a merchant name.

    For example: TRACKMYSUBS%AUS

    can match merchant names containing TRACKMYSUBS, followed by varying characters, and then AUS.

How can I check whether an expense rule was applied?

Open the expense and go to its History tab.

The expense history shows when an expense has been automatically coded using an expense rule. This can help you determine whether the rule was applied and distinguish automated changes from manual updates.

Tips & tricks for using expense rules

  • You can use expense rules to clean up raw merchant names you receive from the card feed, by including Merchant as one of the fields you set using an expense rule.

    For example: If merchant contains "HomeDepotOfficial" set merchant to "Home Depot".

  • You can account for variation in merchant names while setting up an expense rule using "%", where % is a flexible placeholder for any characters. For example, "G%Suite" will match with "G Ads Suite", "Google 123 Suite" and any other merchant name containing more letters between "G" and "Suite".

  • Avoid duplicate or conflicting rules. If case any conflicting rules are found, Sage Expense Management applies the most recently created rule.
    For example:
    Rule 1: If merchant contains "Uber" set category to "Taxi"
    Rule 2: If merchant contains "Uber" set category to "Travel"
    Sage Expense Management will apply the rule which was created most recently in the system.

Troubleshooting an expense rule

If an expense was not automatically coded as expected, check the following:

  1. Confirm that the expense was created after the rule was configured.

  2. Compare the merchant on the expense with the merchant condition in the rule.

  3. Check for additional spaces or characters in the rule.

  4. Confirm that the configured merchant text is actually contained within the merchant name on the expense.

  5. Check whether the employee manually entered or edited the expense or merchant.

  6. Check whether the employee has access to the Category, Project, Cost Center, or custom field configured in the rule.

  7. Check whether any configured fields already had a value.

  8. Check the expense History tab to confirm whether automatic coding was applied.

Did this answer your question?