STAYCHARTED BLOG · Machine learning · Rules and automation
GL coding rules vs machine learning: when vendor rules stop working
Vendor-to-account rules code most invoices until one vendor sells you five different things. When a model trained on your coded history does better.
Can vendor payments map to vendor-specific GL codes automatically?
Yes, and for a vendor that only ever sells you one thing, a rule is the right tool. Set a default account on the vendor record and you're done.
The question is what happens with everything else.
Where vendor rules break
- One vendor, many accounts. Amazon, Staples, a distributor or a consultancy: the same vendor can be office supplies, IT equipment, marketing or a capital purchase. The vendor rule picks one, and someone recodes the rest.
- New vendors. No rule exists until someone writes one, so the first invoices go to a suspense account or a person.
- Card and bank transactions. Merchant strings like "SQ *CORNERCAFE 4415" rarely match a rule cleanly.
- Department and cost center. A rule can pick the account; it rarely knows which department the purchase was for.
- Exceptions pile up. Each recode becomes another exception in the spreadsheet, and nobody can say which exceptions still apply.
What a trained model does instead
A model trained on your coded history reads what a person reads: the vendor, the line description, the amount band, the department or requester if you have it. It suggests the GL account (and, with a second model, the cost center) that your team actually used, with a confidence.
- It learns from your final coding, so the recodes teach it where invoices really belong.
- It handles the vendor that sells many things, because it reads the description, not only the vendor.
- It handles new vendors whose descriptions look like ones you've coded before.
- Below your cutoff, the invoice goes to a person, as it does today.
Rules and model together
- Policy first. Keep rules for anything fixed: capitalization thresholds, intercompany, tax accounts, a vendor that only ever means one account.
- The model for the rest. For invoices and transactions no policy rule decides, the model suggests the account and confidence.
- A cutoff. Above it, the suggestion is used. Below it, the line waits for a person.
- Corrections teach. Every recode becomes a training row for the next version.
How to decide, with your own numbers
- Export 6 to 12 months of coded lines: vendor, description, amount, department, and the final GL account.
- Train an AI Classifier Model on everything before last month.
- Test it on last month's lines, which StayCharted scores against the accounts you actually used.
- Compare with what the vendor default would have given for the same lines.
Measure single-purpose and mixed-purpose vendors separately. The comparison shows where a model reduces recoding enough to justify using it.
Works with what you have
- A spreadsheet: fill the month's export and sort by confidence.
- Google Sheets: the add-on fills a column in place.
- Your ERP or AP tool: call the API from your workflow, or use Zapier, Make or Power Automate. API reference →
- Moving ERPs: your QuickBooks history can train the model you'll use in NetSuite. QuickBooks to NetSuite →
Explore the rules vs machine learning series
- Rule-Based System vs Machine Learning: When Rules Stop Scaling
- Convert a Rule-Based System to Machine Learning, Safely
- ServiceNow Assignment Rules vs Machine Learning: When to Switch
- QuickBooks Bank Rules vs AI Categorization: When to Switch
- Outlook Rules vs AI for Shared Inbox Routing: When to Switch
- Keyword Tables vs Machine Learning for UNSPSC and HS Codes
Common questions
Should we delete vendor default accounts?
No. They're right for vendors that only ever mean one account. Use the model for the vendors and transactions they get wrong.
Can it suggest the cost center too?
Yes, with a second model trained on the same history, or one model whose answer has several fields.
What about audit?
Every suggestion has a confidence, every correction and retrain is in Activity, and the model's accuracy per account is on its report. Approval rules and thresholds stay as rules.
How much history do we need?
A few hundred coded lines for each account you want it to suggest. Accounts with fewer can stay on rules or with a person.