Wholesale · Playbook 24

I've worked in this sector

Purchasing and best-price supplier routing

Every order line goes to the best-priced supplier that can actually deliver for that account, at the negotiated price, and no agreed order slips through. Buyers decide every exception.

  • Predictive ML
  • Agents with tools
  • Event-driven integration
  • Human in the loop
  • Late Payment Act 1998
  • Commercial Payments Bill
  • Competition Act 1998
  • Procurement Act 2023
  • HMRC e-invoicing
  • UK GDPR

At a glance

The problem
Staff order from whichever supplier they know, negotiated prices get missed, and orders agreed by reps never get placed
Typical volume
Around 6,000 order lines a day from 3,000 trade accounts, bought from 150 suppliers
Who's involved
The commercial director, purchasing, sales and the reps, customer service, finance, IT, the EDI team
Pilot
8–10 weeks on one supplier group, after a 3-week discovery
Platforms
AWS, Azure, or a sovereign or on-prem stack

An illustrative scenario. Linked to a real, anonymised case study below; the numbers here are still typical examples. The cloud services and UK rules were checked on 9 November 2026.

The business problem

Orders arrive all day: EDI from the larger accounts, the trade web portal, emails, phone calls and orders that reps agree on site. Purchasing then has to buy each line from a supplier. The owner has negotiated prices, rebates and delivery terms with each supplier, sometimes per account, but at the point of ordering, staff tend to use the supplier they know, the one that answered the phone, or the one they used last time.

The result is money left on the table in a way nobody sees. Lines are bought above the agreed price. Small orders go to one supplier when they'd have hit a free-delivery threshold with another. Some products are only stocked by a handful of suppliers, so staff have to be allowed to source freely, and the rules get bent for everything else too. Worst of all, orders a rep agreed with a customer sometimes never get placed. The customer finds out when nothing arrives.

Then come the confirmations. Suppliers reply by EDI, email, PDF or their own portal, with short shipments, substitutions, price changes and new delivery dates. Someone has to read every one, compare it with what was ordered and decide what to do, and that's where most buyer time goes. Paying suppliers on time also matters more each year, with the government's late payment reforms now going through Parliament.

What AI changes

  • Every order, whatever channel it came from, lands in one place and is split into waves timed to each supplier's cut-off.
  • Each line is routed to the best-priced supplier for that account, using rules for contract prices, rebates, minimum order quantities and delivery thresholds.
  • Machine learning predicts each supplier's likely availability and real lead time from its own history, so the cheapest supplier only wins if it can actually deliver on time.
  • The negotiated price goes on every purchase order. A confirmation or invoice at a different price is caught and raised, never accepted silently.
  • Orders agreed by reps are matched against orders actually placed, and anything agreed but not placed is raised the same day.
  • An agent reads every supplier confirmation and handles routine chasers. Buyers decide every exception: substitutions, price changes, routing above contract price, and split deliveries.

How success is measured

Agree these, and measure the baseline, before anything is built. Example targets are typical, not promises.

Lines bought at the negotiated price

Share of order lines placed with the right supplier at the contract price for that account.

ExampleAbove 98%

Agreed orders not placed

Orders a rep agreed that never reached a supplier. The problem nobody measured before.

ExampleClose to zero, every one investigated

On-time, in-full from suppliers

Whether the routing picks suppliers that actually deliver, not just the cheapest.

ExampleUp, measured against last year

Lead-time prediction accuracy

How close the predicted delivery date is to the actual one, by supplier.

ExampleWithin a day for most lines

Buyer time on confirmations

Time moved from reading confirmations to handling real exceptions and suppliers.

ExampleDown by half

Supplier invoices paid within terms

Whether faster matching helps the business pay its own suppliers on time.

ExampleIn line with your payment policy, reported half-yearly

UK regulation and controls

Cross-sector rules are on the UK regulation map.

  • UK lawLate Payment of Commercial Debts (Interest) Act 1998

    Late payers owe statutory interest of 8% over the Bank of England base rate, plus fixed compensation. A wholesaler is both a payer and a payee. Faster matching of confirmations, deliveries and invoices means disputes are raised early and suppliers are paid on time, so the design tracks invoice, dispute and payment dates for every line.

  • BIST and the Small Business CommissionerThe Commercial Payments Bill (in Parliament) and the Fair Payment Code

    The government's March 2026 response confirmed plans for a 60-day cap on most business payment terms (no earlier than 2027), statutory interest that can't be contracted out of, a time limit for raising invoice disputes, and powers for the Small Business Commissioner to investigate and fine. It isn't law yet. Large companies already report payment performance twice a year under the 2017 reporting regulations, so the same data feeds that report.

  • CMACompetition Act 1998, Chapter I: sharing competitively sensitive information

    Comparing supplier prices to buy well is normal. Passing one supplier's prices, terms or volumes to another is not, and nor is acting as a channel for suppliers to learn about each other. Supplier prices and terms are confidential to the buying team, and the agent can't include them in any message to a supplier. Get your own competition advice on how rebates and supplier data are used.

  • Cabinet OfficeProcurement Act 2023 (if you supply public bodies)

    Since 24 February 2025, public contracts carry an implied 30-day payment term, and it flows down to subcontracts that are wholly or substantially for that public contract. Public-sector accounts often buy on framework prices too. The routing rules hold framework prices and terms per account, and supplier lines for those accounts are flagged for 30-day payment.

  • HMRCMandatory B2B e-invoicing from 1 April 2029

    E-invoicing will run on a Peppol model, with a roadmap published on 28 October 2026. Purchase orders, confirmations and invoices are held as structured data from day one, so moving supplier invoices onto Peppol is a new channel, not a new process. Existing EDI keeps working alongside it.

  • ICOUK GDPR and the Data Protection Act 2018

    There's little personal data here: buyer and rep names, account contacts, and sole-trader suppliers. Standard controls apply: collect only what's needed, a clear retention period, and a contract that stops providers training their models on your data. Routing and prediction are about suppliers and products, not people.

The solution

Showing AWSAzuresovereign / on-prem services. Switch with the toggle; every diagram and table on this page follows it.

Purchasing and best-price supplier routing: reference architecture
  1. 01Channels

    • Customer EDI orders
    • Trade portal, email and phone
    • Orders agreed by reps
    • Supplier confirmations
  2. 02Intake

    • AWS Transfer Family (AS2)Logic Apps integration account (EDIFACT, X12, AS2)Your existing EDI translator, behind KongEDI in and out
    • API GatewayAPI ManagementKong, or your existing API gatewayPortal and order API
    • Bedrock Data AutomationContent UnderstandingDocling plus an open-weight vision modelRead emails and PDFs
  3. 03Intelligence

    • Lambda + Aurora PostgreSQLAzure Functions + Azure Database for PostgreSQLA rules service and PostgreSQL on KubernetesRouting rules engine
    • SageMaker AIAzure Machine LearningMLflow and Kubeflow on KubernetesAvailability and lead-time models
    • Agent
      Bedrock AgentCoreFoundry Agent ServiceLangGraph on Kubernetes, with open-weight models via vLLMSupplier confirmation agent
    • Agent
      Bedrock AgentCoreFoundry Agent ServiceLangGraph on KubernetesOrder capture check
  4. 04Orchestration

    • Step Functions + EventBridge SchedulerLogic Apps / Durable FunctionsTemporalOrder waves and cut-offs
    • EventBridge + SQSEvent Grid + Service BusApache Kafka or RabbitMQEvents and queues
  5. 05Systems of record

    • ERP: orders, POs, invoices
    • WMS
    • CRM and reps' app
  6. 06People

    • Person
      Buyers: approve exceptions
    • Person
      Sales ops: agreed orders not placed
    • Person
      Commercial: prices and supplier terms
  • Cloud or platform service (AWSAzuresovereign / on-prem)
  • AI agent
  • A person decides
  • Your existing systems
  • Outside your organisation

Components, side by side

Purchasing and best-price supplier routing: components on AWS, Azure and a sovereign or on-prem stack
LayerAWSAzureSovereign / on-prem
Intake: EDI, portal, emailKeep the EDI translator and trading-partner setup you have. UK suppliers still use EDIFACT, and some older ones TRADACOMS.AWS Transfer Family (AS2), API Gateway, Amazon SES, S3Logic Apps integration account (EDIFACT, X12, AS2), API Management, Blob StorageYour existing EDI translator and VAN; Kong; your mail server; Ceph or IONOS S3 Object Storage
Reading confirmations and supplier emailsTest on real supplier PDFs and email replies, including the ones typed on a phone.Bedrock Data AutomationAzure Content Understanding (includes Document Intelligence)Open-source parsing (e.g. Docling) plus an open-weight vision model
Routing rules and price bookRules, not a model, pick the supplier, so every choice can be explained line by line: price, rebate, MOQ, delivery threshold, predicted lead time.AWS Lambda or ECS, Aurora PostgreSQLAzure Functions or Container Apps, Azure Database for PostgreSQLA rules service and PostgreSQL on Kubernetes
Availability and lead-time predictionTrained on your own history of orders, confirmations and deliveries per supplier and product. Amazon Forecast is closed to new customers, so use SageMaker AI.Amazon SageMaker AIAzure Machine LearningMLflow and Kubeflow on Kubernetes
Reasoning and draftingUsed for reading and summarising confirmations and drafting chasers, not for choosing suppliers or prices.Amazon BedrockMicrosoft FoundryOpen-weight models served with vLLM on your own GPUs, or IONOS AI Model Hub
Agent runtimeThe original Bedrock Agents closed to new customers on 30 July 2026; new builds use AgentCore.Amazon Bedrock AgentCoreFoundry Agent ServiceAn open-source agent framework (e.g. LangGraph) on Kubernetes
Workflow and order wavesWaves are timed to each supplier's cut-off, so a late order still makes today's delivery where it can.AWS Step Functions, EventBridge SchedulerLogic Apps or Durable FunctionsTemporal, or n8n
Middleware and eventsAmazon EventBridge, SQSEvent Grid, Service BusApache Kafka or RabbitMQ
Link to the ERP and WMSReuse the integration layer you have. The ERP stays the record of every order, PO and invoice.Through their published APIs, behind API GatewayThrough their published APIs, behind API ManagementThrough their published APIs, behind Kong or your existing gateway
Human reviewExceptions arrive as tasks with the reason and the options, where buyers already work.In the buyers' existing ERP purchasing screensIn the buyers' existing ERP purchasing screensIn the buyers' existing ERP purchasing screens
GuardrailsBlocks any supplier message that contains another supplier's name, price or terms.Bedrock GuardrailsFoundry guardrails (Azure AI Content Safety)Open-source guardrails (e.g. NeMo Guardrails, Llama Guard)
Identity, keys, data protectionSupplier prices and terms readable only by purchasing and the routing service.IAM Identity Center, KMSEntra ID, Key VaultKeycloak or your existing Active Directory; OpenBao or HashiCorp Vault
Monitoring and auditLog every routing decision with its reasons, every exception and who decided it.CloudWatch, CloudTrailAzure Monitor, Log AnalyticsPrometheus, Grafana, OpenTelemetry
Data residencyIONOS AI Model Hub runs in German data centres: EU, not UK, residency. Supplier terms are commercially sensitive, so check contracts before choosing.eu-west-2 (London)UK South / UK WestYour own UK data centre, or a UK or EU provider

On a phone, the table shows the platform you pick. Sovereign / on-prem means open, portable components you can run in your own data centre or with a UK or European provider; IONOS is shown as one example, and others exist. What sovereign cloud means →

Hybrid and on-prem

Many organisations keep core systems and sensitive data on their own servers. This is how the same design works across both.

Stays on-prem

The ERP, the WMS, the EDI translator and the price book stay where they are. Many wholesalers run these on their own servers, and nothing in this design needs them to move.

Uses cloud AI

The lead-time models, reading supplier emails and PDFs, and the confirmation agent can run in AWS or Azure, or on your own GPUs if supplier terms must not leave your estate. The routing rules can run on either side; keeping them next to the ERP keeps them fast.

How they connect

A private link (AWS Direct Connect or Azure ExpressRoute) and the API layer. Lead-time predictions are pushed to the routing service as a table refreshed through the day, so routing never waits on a cloud call.

If the link drops

Routing carries on with the last predictions and the rules on-prem. Confirmations queue and are read when the link returns, and buyers handle urgent ones by hand, as they do today.

The agents

What each agent may do through its tools, what it may not, and where a person signs off. The limits are enforced by the platform, not the prompt.

Supplier confirmation agent

May do

  • Read confirmations from EDI, email, PDF and supplier portals
  • Match each confirmation line to the purchase order
  • Flag short shipments, substitutions, price differences and date changes
  • Update the expected delivery date in the ERP when it's within agreed tolerance
  • Send a templated chaser when a confirmation is overdue
  • Draft options for the buyer: wait, re-route to the next-best supplier, or tell the customer

May not do

  • Accept a price increase or a substitution
  • Negotiate with a supplier or agree new terms
  • Re-route an order above contract price
  • Mention one supplier's prices, terms or volumes to another
  • Cancel a purchase order or contact a customer

Where a person signs offA buyer decides every exception: price changes, substitutions, re-routing and split deliveries. The agent's permissions are enforced by the platform's identity and policy controls and the ERP's roles, not by instructions in a prompt.

Order capture check

May do

  • Compare orders agreed by reps in the CRM, the reps' app and their emails with orders in the ERP
  • Flag agreed orders that haven't been placed, or were placed with different lines or quantities
  • Raise a task to sales ops with the evidence

May not do

  • Create, change or cancel an order
  • Contact the customer or the rep's customer contacts
  • Change account prices

Where a person signs offSales ops confirm with the rep or customer and place the order. Nothing is ordered on a customer's behalf without a person checking it was really agreed.

Middleware and integration

The ERP stays the record of every customer order, purchase order and invoice, and the WMS keeps receiving goods as it does today. The routing service reads orders through the ERP's API, decides the supplier, and writes the purchase order back. It never writes straight to the database.

EDI stays where it is. Customer and supplier messages keep flowing through your existing translator and trading-partner setup, and the AI only reads the translated messages from a queue. Email and PDF confirmations join the same queue once they're read, so every confirmation is handled the same way.

Every order line carries an ID from the moment it arrives. If a supplier's system or the ERP is down, lines wait on the queue for the next wave, and a retry never creates a duplicate purchase order.

If the routing service is paused, buyers fall back to the price book in the ERP, as they did before. Orders keep moving.

Process and people

  • A price book owner in the commercial team, who loads every new contract price, rebate and threshold, with change control and a second check.
  • An exception queue for buyers with clear priorities: customer-promised orders first, then price differences, then date changes.
  • Override rules, so a buyer can route away from the best price for a reason (quality, a supplier issue, a customer request), and the reason is recorded.
  • A daily list of agreed orders not placed, owned by sales ops, closed only when each one is placed or confirmed as not agreed.
  • A monthly review of routing decisions and lead-time accuracy by supplier, shared with the commercial team for supplier reviews.
  • Buyers and reps trained before go-live, including how to see why a line went to a supplier.

Delivery plan

  1. 3 weeks

    Discovery

    Map today's ordering and buying, measure how often lines are bought off-contract and how many agreed orders go missing, collect a year of order and delivery history, and check the price book is complete.

  2. Gate · must be true to passBaseline agreed, price book owner named, ERP and EDI integration route confirmed.

  3. 8–10 weeks

    Pilot

    One supplier group in shadow mode: the routing service recommends, buyers order as normal, and the two are compared. The order capture check runs from day one, because it only raises tasks.

  4. Gate · must be true to passRouting matches or beats buyers on price without hurting on-time delivery, prediction accuracy within agreed limits, and buyer sign-off.

  5. 4–6 weeks

    Production

    Routing goes live for the pilot group, then the confirmation agent, with monitoring, support and a rollback to the ERP price book.

  6. Gate · must be true to passMonitoring, support model, rollback plan and buyer training in place.

  7. Ongoing

    Scale

    Add supplier groups in waves, single-source products last, then structured supplier invoices ready for Peppol.

  8. Gate · must be true to passEach new supplier group passes the same pilot gate.

Roles and RACI

Who is responsible, accountable, consulted and informed, by activity
ActivityCommercial directorHead of purchasingSolutions architectI can fill thisTechnical PMI can fill thisEngineersI can fill thisFinanceSecurityI can fill this
Business case and benefitsAccountableResponsibleConsultedConsultedInformedConsultedInformed
Target architecture, ERP and EDI integrationInformedConsultedAccountable and ResponsibleConsultedConsultedConsultedConsulted
Price book and routing rulesAccountableResponsibleConsultedInformedConsultedConsultedInformed
Build and integrationInformedConsultedAccountableResponsibleResponsibleInformedConsulted
Model training and accuracy testingInformedAccountableResponsibleConsultedResponsibleInformedInformed
Go-live decisionAccountableResponsibleConsultedResponsibleInformedConsultedConsulted
Run, monitor and improveInformedAccountableConsultedConsultedResponsibleConsultedConsulted

Business case and benefits

Commercial director
A · Accountable
Head of purchasing
R · Responsible
Solutions architect
C · Consulted
Technical PM
C · Consulted
Engineers
I · Informed
Finance
C · Consulted
Security
I · Informed

Target architecture, ERP and EDI integration

Commercial director
I · Informed
Head of purchasing
C · Consulted
Solutions architect
A/R · Accountable and Responsible
Technical PM
C · Consulted
Engineers
C · Consulted
Finance
C · Consulted
Security
C · Consulted

Price book and routing rules

Commercial director
A · Accountable
Head of purchasing
R · Responsible
Solutions architect
C · Consulted
Technical PM
I · Informed
Engineers
C · Consulted
Finance
C · Consulted
Security
I · Informed

Build and integration

Commercial director
I · Informed
Head of purchasing
C · Consulted
Solutions architect
A · Accountable
Technical PM
R · Responsible
Engineers
R · Responsible
Finance
I · Informed
Security
C · Consulted

Model training and accuracy testing

Commercial director
I · Informed
Head of purchasing
A · Accountable
Solutions architect
R · Responsible
Technical PM
C · Consulted
Engineers
R · Responsible
Finance
I · Informed
Security
I · Informed

Go-live decision

Commercial director
A · Accountable
Head of purchasing
R · Responsible
Solutions architect
C · Consulted
Technical PM
R · Responsible
Engineers
I · Informed
Finance
C · Consulted
Security
C · Consulted

Run, monitor and improve

Commercial director
I · Informed
Head of purchasing
A · Accountable
Solutions architect
C · Consulted
Technical PM
C · Consulted
Engineers
R · Responsible
Finance
C · Consulted
Security
C · Consulted

R ResponsibleA AccountableC ConsultedI Informed· not involved

Where I'd fit

Option A

Lead the architecture

If there's no architect on the programme, I'd own the design end to end: order intake, the waves, the routing rules, the ERP and EDI integration, and the gates. I've built this before. For a wholesaler, I designed and built a sourcing platform that took in high-volume orders, split them into waves and routed each product to the lowest-cost supplier for that account, and it captured orders that used to slip away. The prediction and agent layers here build on that same core. Platforms I've authored have moved billions of pounds of goods and services, so I know how much rests on the order flow. I'd report to your programme board.

Option B

Support your architect

If your partner or your own team already has an architect, I'd take on the routing engine, the lead-time models and the ERP and EDI integration under their lead, and give them a second senior opinion on the rest, especially where the agent is and isn't allowed to act with suppliers.

Where this goes wrong

  1. Goes wrong

    The cheapest supplier always wins, and on-time delivery quietly gets worse.

    How the design avoids it

    Predicted availability and lead time are part of every routing choice, and on-time, in-full is a pilot gate alongside price.

  2. Goes wrong

    The price book is out of date, so the system enforces the wrong prices perfectly.

    How the design avoids it

    A named price book owner, change control, and price differences on confirmations fed back as price book fixes.

  3. Goes wrong

    A model picks suppliers, and nobody can explain why a line went where it did.

    How the design avoids it

    Rules make the choice and record the reasons. Machine learning only supplies the predictions the rules use.

  4. Goes wrong

    The agent mentions a competitor's price to push a supplier, and creates a competition law problem.

    How the design avoids it

    The agent can't negotiate, supplier terms are walled off, and guardrails block other suppliers' names and prices in any message.

  5. Goes wrong

    Buyers don't trust it and override everything, so nothing changes.

    How the design avoids it

    Shadow mode first, every routing reason visible, overrides allowed with a reason, and the reasons used to improve the rules.

On the horizon

Changes already announced or under way that affect this design. More in the UK horizon scan.

  1. No earlier than 2027
    The Commercial Payments Bill: a 60-day cap on most business payment terms, statutory interest that can't be contracted out of, a time limit for invoice disputes, and fines from the Small Business Commissioner. It is going through Parliament.

    Record invoice, dispute and payment dates against every supplier line now, so you can prove you pay on time and challenge customers who don't.

  2. 1 April 2029
    Mandatory B2B e-invoicing on a Peppol model, with HMRC's roadmap published on 28 October 2026.

    Hold purchase orders, confirmations and invoices as structured data, and ask your ERP and EDI providers for their Peppol plans.

  3. Late 2026–2028
    The Cyber Security and Resilience Bill brings medium and large managed service providers into regulation, with duties set by secondary legislation by about 2028.

    Expect your EDI, hosting and IT providers to face new duties. Update supplier assurance and contracts, since a stopped order flow stops the business.

  4. 2028
    The NCSC's post-quantum cryptography milestone: a full migration plan by 2028.

    Record which encryption the EDI links, APIs and stored price data use, and keep it easy to change.

Questions to ask your partner or vendor

Good answers are specific. Vague answers to any of these are worth following up.

Copy them into your next supplier meeting

  1. When the system picks a supplier, can we see exactly why, line by line?
  2. What happens to routing when the price book is wrong or a contract price expires?
  3. Which supplier actions can the agent take without a buyer, and where is that enforced?
  4. How do you stop one supplier's prices or terms reaching another?
  5. How will lead-time predictions be tested on our own suppliers' history?
  6. What does it cost to run per thousand order lines, at our volume?

Planning something like this?

Whether you need someone to lead the design or to support the architect you already have, let's talk it through.

Sam Naseem
Sam NaseemBirmingham, UK · UK & Europe
Available now