STAYCHARTED BLOG · PROCUREMENT & UNSPSC
UNSPSC classification: how the codes work, and how AI suggests them from your reviewed purchases
How UNSPSC codes work: four levels, real examples, and how to find a code. Then let AI suggest codes for new purchase lines from the ones your team reviewed.
What is UNSPSC classification?
UNSPSC (United Nations Standard Products and Services Code) is an open classification standard for products and services owned by the United Nations Development Programme (UNDP). Its eight-digit commodity codes have four core levels: segment, family, class and commodity. UNDP provides the codeset for free download.
How a UNSPSC code is built
Each pair of digits is one level. Reading a code left to right goes from broad to specific:
| Level | Digits | Example 1 | Example 2 |
|---|---|---|---|
| Segment | 1–2 | 43000000 Information Technology Broadcasting and Telecommunications | 44000000 Office Equipment and Accessories and Supplies |
| Family | 3–4 | 43210000 Computer Equipment and Accessories | 44120000 Office supplies |
| Class | 5–6 | 43211500 Computers | 44121900 Ink and lead refills |
| Commodity | 7–8 | 43211503 Notebook computers | 44121902 Lead refills |
Higher levels are commonly represented with trailing zeros: 43210000 is the whole family, and 43211503 is one commodity in it. Some systems add a fifth pair of digits for the business function, such as retail or wholesale.
Which level to classify to. For broad spend reporting, the family or class level may be sufficient. Commodity codes are needed mainly where buyers or catalogs require them. Pick the deepest level your team can apply consistently, and train on that level.
A model trained on your reviewed purchase records learns which labels your team applies. It is not a substitute for the code definitions or a complete code database. Check the current standard and applicable use terms before building your training labels.
Choose the granularity you need. A family-level analysis may be useful even when the line descriptions cannot support reliable commodity-level classification.
Prepare purchase rows, not just supplier names
A supplier may sell office supplies, computing equipment and maintenance services. Assigning its entire spend to one category can conceal important differences. Line descriptions and purchasing context help separate them.
| Field | Why it may help | What to check |
|---|---|---|
| Item or service description | Describes what was purchased | Avoid empty or generic text |
| Existing commodity text | Adds business context | Exclude fields unavailable at prediction time |
| Supplier | Can clarify terminology | Do not assume one category per supplier |
| Reviewed UNSPSC code | The answer to learn | Use one agreed taxonomy version |
Keep the original record ID and amount for reconciliation and later spend analysis. The classifier chooses a category; your spreadsheet or procurement system calculates totals.
Train on reviewed codes rather than copying uncertain legacy mappings wholesale. Otherwise, the model can reproduce the same mistakes faster.
Worked example: purchase lines and the family a model suggests
A model trained on your team's reviewed lines suggests a family for each new line, with a confidence. In this example, the review cutoff is 0.9; lines below it go to a person.
| Purchase line | Suggested family | Confidence | What happens |
|---|---|---|---|
| Dell Latitude 14" laptop, 16 GB, for new hire | 43210000 Computer Equipment and Accessories | 0.96 | Accepted |
| Microsoft 365 E3, annual subscription, 50 seats | 43230000 Software | 0.93 | Accepted |
| Nightly office cleaning, Building B, October | 76110000 Cleaning and janitorial services | 0.91 | Accepted |
| Temporary AP clerk via agency, 3 weeks | 80110000 Human resources services | 0.74 | To review: could also be read as a finance service |
| Copy paper, letter size, 10 reams | 44120000 Office supplies | 0.58 | To review: see below |
The confidences are illustrative, to show how the cutoff works; your model's report gives you real ones.
Why the copy paper goes to a person. Many teams file office paper under Office supplies. UNSPSC also has a whole segment for paper, Paper Materials and Products (14). An internal Office supplies spend bucket is not automatically the correct UNSPSC family. Check the paper code in the version you use, and keep any internal-category mapping separate. Low confidence can flag an item to check; it does not prove that conflicting history is the cause.
How to automate UNSPSC suggestions
- Pick one department, purchase stream or category level for the pilot.
- Collect descriptions and final reviewed UNSPSC labels at that level.
- Resolve outdated codes, conflicting labels and duplicate records before training.
- Train in StayCharted and review the errors on held-out rows, including uncommon categories.
- Fill a copy of a new purchase file or call the API from your procurement workflow.
- Have reviewers check uncertain results and confirm codes against your chosen standard version.
- Store approved corrections as examples for a later model version.
Use a later batch or a supplier not represented heavily in training to test generalization. Strong results on repeated item descriptions do not establish performance on new kinds of purchases. If a new purchase falls outside the categories in your examples, send it for review rather than treating a confident known-category answer as proof of fit.
How to find the right UNSPSC code
- Download the code set. UNDP provides the current code set at no cost. Check which version your buyers and procurement system require.
- Search by keyword, then read upward. Find a commodity that matches, then check its class and family make sense for what you bought.
- Use your procurement system's lookup. If your system provides a UNSPSC lookup, check its version and the definitions it uses. SAP Business Network, for example, supports UNSPSC commodity codes.
- Write down your conventions for the items that could go two ways, like the copy paper above.
- Then let a model do the repeats. Once a few hundred lines are reviewed, train on them: new lines get a suggested code and a confidence, and use the cutoff to prioritize lookup and review, while checking a sample of confident answers too.
UNSPSC, NIGP and your own categories
- UNSPSC is the global standard, used by many companies, procure-to-pay systems and public bodies.
- NIGP codes are common in US state and local government purchasing. If you must report in both, keep the mapping between them as a separate table rather than training one model on two code sets.
- Your own spend categories are often what finance actually reports on. A common setup is your own categories for reports, mapped to a UNSPSC family for benchmarking. See spend classification with machine learning.
UNSPSC, GL accounts and HS codes solve different problems
UNSPSC describes the product or service being purchased. A GL account reflects your accounting structure. An HS code concerns customs classification. Do not treat these labels as interchangeable or infer a universal one-to-one mapping.
You can train separate models for separate decisions when you have approved examples for each. For accounting workflows, see AI invoice coding. For the broader taxonomy discussion, see classification standards.
StayCharted supplies suggestions from your examples. Your procurement owners remain responsible for the categories used in reports. Start with a manageable set of well-understood labels, then expand when the evaluation supports it.
Common questions
Can AI assign UNSPSC codes?
A trained classifier can suggest codes represented in reviewed training examples. Validate results against the chosen UNSPSC version and review uncertain or unfamiliar purchases.
Do I need examples for every UNSPSC code?
You need representative examples for the categories you intend the model to predict. Start with the subset or broader hierarchy level relevant to your purchasing data.
Is UNSPSC the same as a GL account or HS code?
No. UNSPSC classifies products and services, GL accounts organize accounting entries, and HS codes concern customs classification. Each requires its own appropriate labels and review.
Does StayCharted include an automatically updated UNSPSC database?
This workflow uses the categories and reviewed labels you provide. Maintain the standard version and code definitions as part of your procurement process.
How many UNSPSC codes are there?
The count depends on the code-set version and whether you count commodities alone or all hierarchy levels. Check the version available from UNDP; most organizations use only a small share of the full set.
Is UNSPSC free?
Yes. UNDP owns UNSPSC and provides the current code set for browsing and download at no cost.
What level of UNSPSC should we classify to?
Choose the deepest level your team can apply consistently and your buyers or reporting requirements need. Family or class can support broad spend analysis; catalogs may require commodity codes. Train and evaluate at your chosen level.
How accurate is AI at UNSPSC classification?
It depends on your data and the hierarchy level. StayCharted measures accuracy on your reviewed held-out rows, overall and per code. We have not published a UNSPSC benchmark. As an example from a different taxonomy, the Dedicated AI Model in our HS code benchmark matched 25.1% of exact 10-digit codes and 74.0% of 2-digit chapters. Those are HS results, not a prediction of UNSPSC accuracy.