{
  "version": 1,
  "min_app_version": "2.0.0",
  "patterns": [
    {
      "id": "bmo_cc_alert.v1",
      "category": "credit_card_purchase",
      "senders": [
        "bmoalerts@bmo.com"
      ],
      "match": {
        "subject": {
          "equals": "bmo credit card alert"
        }
      },
      "extract": {
        "amount": {
          "re": "Amount:\\s*\\$([0-9,]+\\.\\d{2})",
          "as": "money"
        },
        "card_last4": {
          "re": "Ending in\\s*(\\d{4})",
          "flags": "i"
        },
        "merchant": {
          "re": "\\bAt:\\s*(.{0,200}?)\\s+Sign in",
          "flags": "i"
        }
      },
      "constants": {
        "bank": "BMO",
        "currency": "CAD",
        "kind": "authorization"
      },
      "required": [
        "amount",
        "card_last4",
        "merchant"
      ],
      "fixtures": [
        {
          "body": "BMO CC Authorization Alert New activity on your credit card There's been a transaction on your credit card for: Amount: $96.63 Credit card: Ending in 1390 At: SHELL C80216 Sign in to review your updated balance SIGN IN",
          "expect": {
            "amount": 96.63,
            "card_last4": "1390",
            "merchant": "SHELL C80216",
            "bank": "BMO"
          }
        },
        {
          "body": "BMO Withdrawal Alert. A withdrawal of $40.00 was made.",
          "expect": null
        },
        {
          "sender": "bmoalerts@bmo.com.evil.example",
          "subject": "bmo credit card alert",
          "expect": null
        }
      ]
    },
    {
      "id": "cibc_cc_purchase.v1",
      "category": "credit_card_purchase",
      "senders": [
        "mailbox.noreply@cibc.com"
      ],
      "match": {
        "subject": {
          "equals": "new purchase on your credit card"
        }
      },
      "extract": {
        "amount": {
          "re": "\\bfor\\s+\\$([0-9,]+\\.\\d{2})",
          "as": "money"
        },
        "card_last4": {
          "re": "ending in\\s+(\\d{4})",
          "flags": "i"
        },
        "card_name": {
          "re": "with your\\s+(.{0,120}?)\\s+ending in",
          "flags": "i"
        },
        "merchant": {
          "re": "\\bat\\s+(.{0,200}?)\\.\\s+You can sign on",
          "flags": "i"
        }
      },
      "constants": {
        "bank": "CIBC",
        "currency": "CAD",
        "kind": "authorization"
      },
      "required": [
        "amount",
        "card_last4",
        "merchant"
      ],
      "fixtures": [
        {
          "body": "Dear Rick, You've recently made a purchase with your CIBC Costco World Mastercard ending in 6894 for $54.77 at SUBWAY 12842. You can sign on to your CIBC Online or Mobile Banking to view more details about this transaction.",
          "expect": {
            "amount": 54.77,
            "card_last4": "6894",
            "merchant": "SUBWAY 12842",
            "card_name": "CIBC Costco World Mastercard",
            "bank": "CIBC"
          }
        },
        {
          "body": "BMO Withdrawal Alert. A withdrawal of $40.00 was made.",
          "expect": null
        },
        {
          "sender": "mailbox.noreply@cibc.com.evil.example",
          "subject": "new purchase on your credit card",
          "expect": null
        }
      ]
    },
    {
      "id": "amazon_mbna_proxy.v1",
      "category": "credit_card_purchase",
      "enabled": false,
      "senders": [
        "amazon.ca",
        "amazon.com"
      ],
      "domainSenders": true,
      "match": {
        "subject": {
          "startsWith": "shipped:"
        }
      },
      "extract": {
        "amount": {
          "re": "Total\\s*\\$([0-9]{1,3}(?:,[0-9]{3})*\\.[0-9]{2})",
          "as": "money"
        },
        "order_no": {
          "re": "Order\\s*#\\s*([0-9]{3}-[0-9]{7}-[0-9]{7})"
        }
      },
      "constants": {
        "bank": "MBNA",
        "currency": "CAD",
        "kind": "proxy",
        "retailer": "Amazon"
      },
      "required": [
        "amount"
      ],
      "fixtures": [
        {
          "body": "Your package is on the way Order # 111-2222222-3333333 Track package Cool Widget Quantity: 1 $ 19 99 USB-C Cable Quantity: 2 $ 6 00 Total $31.99 Thanks for shopping",
          "expect": {
            "amount": 31.99,
            "order_no": "111-2222222-3333333",
            "bank": "MBNA",
            "kind": "proxy"
          }
        },
        {
          "body": "Your package is on the way Order # 111-2222222-3333333 Track package Cool Widget Quantity: 1 $ 19 99 Thanks for shopping",
          "expect": null
        },
        {
          "sender": "ship-confirm@amazon.ca.evil.example",
          "subject": "shipped: your order",
          "expect": null
        }
      ]
    },
    {
      "id": "scotia_cc_auth.v1",
      "category": "credit_card_purchase",
      "enabled": false,
      "senders": [
        "infoalerts@scotiabank.com"
      ],
      "extract": {
        "amount": {
          "re": "present\\s+for\\s*\\$([0-9,]+\\.[0-9]{2})\\s+at",
          "as": "money"
        },
        "card_last4": {
          "re": "on\\s+account\\s*([0-9*]{8,24})\\s+at"
        },
        "merchant": {
          "re": "\\$[0-9,]+\\.[0-9]{2}\\s+at\\s*([^:]{1,60})\\s+on"
        }
      },
      "constants": {
        "bank": "Scotiabank",
        "currency": "CAD",
        "kind": "authorization"
      },
      "required": [
        "amount"
      ],
      "fixtures": [
        {
          "body": "Authorization without credit card present Hi FIRSTNAME, There was an authorization without the credit card present for $1,234.56 at TEST MERCHANT & CO. 7 on account 1234*****567**** at 8:05 am ET. If you didn't do this, please call 1-800-000-0000. See your transactions, pay bills, transfer funds, send money, and more via Scotia OnLine or Mobile Banking. You are receiving this email from The Bank of Nova Scotia (Carrying on business as \"Scotiabank\") Scotiabank, 44 King Street West, Toronto, ON M5H 1H1 www.scotiabank.com/contactus To change your notification preferences or unsubscribe from InfoAlerts, sign in to Scotia OnLine. Then, go to Manage My Accounts > Alerts > Maintain Alerts. Please do not reply to this e-mail, as it is auto-generated and you will not receive a response. Scotiabank will never send you unsolicited emails asking for confidential information, such as your password, PIN, Access Code, credit card, or account numbers. We will never ask you to validate or restore your account access through email or pop-up windows.",
          "expect": {
            "bank": "Scotiabank",
            "currency": "CAD",
            "kind": "authorization",
            "amount": 1234.56,
            "card_last4": "1234*****567****",
            "merchant": "TEST MERCHANT & CO. 7"
          }
        },
        {
          "body": "Authorization without credit card present Hi FIRSTNAME, There was an authorization without the credit card present for unavailable at TEST MERCHANT & CO. 7 on account 1234*****567**** at 8:05 am ET. If you didn't do this, please call 1-800-000-0000. See your transactions, pay bills, transfer funds, send money, and more via Scotia OnLine or Mobile Banking. You are receiving this email from The Bank of Nova Scotia (Carrying on business as \"Scotiabank\") Scotiabank, 44 King Street West, Toronto, ON M5H 1H1 www.scotiabank.com/contactus To change your notification preferences or unsubscribe from InfoAlerts, sign in to Scotia OnLine. Then, go to Manage My Accounts > Alerts > Maintain Alerts. Please do not reply to this e-mail, as it is auto-generated and you will not receive a response. Scotiabank will never send you unsolicited emails asking for confidential information, such as your password, PIN, Access Code, credit card, or account numbers. We will never ask you to validate or restore your account access through email or pop-up windows.",
          "expect": null
        },
        {
          "sender": "infoalerts@scotiabank.com.evil.example",
          "expect": null
        }
      ],
      "match": {
        "subject": {
          "equals": "authorization without credit card present"
        }
      }
    },
    {
      "id": "rbc_cc_purchase.v1",
      "category": "credit_card_purchase",
      "enabled": false,
      "senders": [
        "rbcroyalbankalerts@alerts.rbc.com"
      ],
      "extract": {
        "amount": {
          "re": "Amount:\\s*\\$([0-9,]+\\.[0-9]{2})\\s+Transaction",
          "as": "money"
        },
        "card_last4": {
          "re": "Account:\\s*\\*+([0-9]{4})\\s+Purchase"
        },
        "merchant": {
          "re": "Description:\\s*([^:]{1,60})\\s+Thank"
        }
      },
      "constants": {
        "bank": "RBC",
        "currency": "CAD",
        "kind": "purchase"
      },
      "required": [
        "amount"
      ],
      "fixtures": [
        {
          "body": "&zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; Hello, As requested, we&rsquo;re letting you know that a purchase of $1,234.56 was made on your RBC Royal Bank credit card account ************1234 on October 01, 2026 towards TEST MERCHANT & CO. 7. If you don&rsquo;t recognize this transaction, please call us at 1-800-000-0000 (available 24/7) and we&rsquo;ll be happy to help. Account: ************1234 Purchase Amount: $1,234.56 Transaction Date: October 01, 2026 Transaction Description: TEST MERCHANT & CO. 7 Thank you! View in a browser Privacy & Security | Legal RBC Royal Bank | Royal Bank of Canada RBC WaterPark Place, 88 Queens Quay West, 12th Floor, Toronto, ON, M5J 0B8, Canada www.rbcroyalbank.com &reg;/TM Trademark(s) of Royal Bank of Canada. RBC and Royal Bank are registered trademarks of Royal Bank of Canada. Copyright&copy; Royal Bank of Canada, 2026 Your personal information is important and valuable. Learn how to stay safe online: Active Scam Alerts | RBC Cyber Security | Report Fraud to RBC Legal Disclaimers Please do not reply to this email, as it was sent from an unmonitored account. You are receiving this email as part of your Alerts subscription that you have requested. To make changes to your subscription, simply log on to RBC Royal Bank Online Banking.",
          "expect": {
            "bank": "RBC",
            "currency": "CAD",
            "kind": "purchase",
            "amount": 1234.56,
            "card_last4": "1234",
            "merchant": "TEST MERCHANT & CO. 7"
          }
        },
        {
          "body": "&zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; &zwnj; &shy; Hello, As requested, we&rsquo;re letting you know that a purchase of unavailable was made on your RBC Royal Bank credit card account ************1234 on October 01, 2026 towards TEST MERCHANT & CO. 7. If you don&rsquo;t recognize this transaction, please call us at 1-800-000-0000 (available 24/7) and we&rsquo;ll be happy to help. Account: ************1234 Purchase Amount: unavailable Transaction Date: October 01, 2026 Transaction Description: TEST MERCHANT & CO. 7 Thank you! View in a browser Privacy & Security | Legal RBC Royal Bank | Royal Bank of Canada RBC WaterPark Place, 88 Queens Quay West, 12th Floor, Toronto, ON, M5J 0B8, Canada www.rbcroyalbank.com &reg;/TM Trademark(s) of Royal Bank of Canada. RBC and Royal Bank are registered trademarks of Royal Bank of Canada. Copyright&copy; Royal Bank of Canada, 2026 Your personal information is important and valuable. Learn how to stay safe online: Active Scam Alerts | RBC Cyber Security | Report Fraud to RBC Legal Disclaimers Please do not reply to this email, as it was sent from an unmonitored account. You are receiving this email as part of your Alerts subscription that you have requested. To make changes to your subscription, simply log on to RBC Royal Bank Online Banking.",
          "expect": null
        },
        {
          "sender": "rbcroyalbankalerts@alerts.rbc.com.evil.example",
          "expect": null
        }
      ],
      "match": {
        "subject": {
          "equals": "you made a purchase."
        }
      }
    }
  ]
}
