Trade and wholesale Pricing, stock and margin EDI, WMS and web shop

Custom distribution ERP development

A distribution ERP is the administrative core of a trading company that doesn't make anything itself: buying, holding stock, selling, delivering, invoicing. No bills of materials or routings, but three questions that come up every day: which price applies to this customer, what can I actually promise, and what margin does this order leave. Appfront builds that core to your requirements where an off-the-shelf package can't cope.

What a distribution ERP does and doesn't do

A distribution ERP records the flow of goods in a company that buys and sells without producing anything itself: purchase orders, goods receipts, stock movements, sales orders, delivery, invoicing and the postings that follow. What defines a manufacturing ERP is absent here: no bills of materials, no routings, no capacity planning per work centre.

In their place come three questions: which price applies to this customer, what you can genuinely promise given what is in stock and what is already allocated, and what margin remains once all retrospective rebates have been settled. A distribution ERP answers those three questions consistently, whether the order arrives by phone, through the webshop or via EDI.

This page is about that administrative core itself. If you are looking for software around an ERP that stays in place, such as an ordering portal or integrations with your current package, software for wholesalers is the right starting point. Background on approach and architecture can be found at Building a custom ERP system.

From purchase order to general ledger

One continuous trail from order and receipt to sales order, pick instruction, delivery note, invoice and posting. Every step records who changed what and when, so any discrepancy can be traced back to its source.

Pricing as an engine of its own

Customer agreements, price tiers, promotional prices and surcharges come together in a single calculation model that order entry, the webshop and EDI all query. That way the same customer never gets two answers to the same question.

Margin per order line

Revenue minus the actual purchase cost, minus the rebate this customer will still earn later. Only then can you see whether an order earned its keep or merely added turnover.

In wholesale, the price is rarely a single number

An item has a list price, but almost nobody pays it. There is a discount matrix per customer and item group, on top of that a contract price for a handful of A-customers, a volume tier that only kicks in from a certain number of cases, and a promotional price that applies for three weeks. The same item line thus yields three prices for three customers, and two for the same customer, depending on the order date.

The interesting question is not whether your system can record all these forms. Almost any package can. The question is which agreement wins when two apply at once. Does the promotional price take precedence over the contract price, or not, because the contract price was already negotiated sharper? Does the volume tier count per order line, per order total or on annual volume? At many wholesalers, that answer lives in the heads of two people in the sales office. The first real task is to make those precedence rules explicit and to record, per order line, which agreement was applied.

Alongside these there are amounts that are not called a price: a small-order surcharge, packaging and deposits, fuel, or in the metal trade an alloy surcharge. They belong to the revenue of the line, but often sit in a table that nobody connects to margin.

The trickiest are the retrospective rebates. A customer who builds up a turnover rebate per quarter or year buys all year at a price that is correct on the order confirmation and looks fine in the reporting. Only at settlement does it become clear how much has to be paid back retroactively across all lines in that period. If you do not accrue that rebate as a liability at the moment of the order, you steer for months on a margin that does not exist. It is better to estimate, per line, the rebate tier the customer is heading for, reserve that amount and show sales the margin after expected rebate.

Stock and purchasing: where the records start to drift

A wholesaler does not sell items but promises: this quantity, on this date, at this address. That promise is only solid if the system knows the difference between what is on the shelf, what is already allocated and what is on its way. Four places where this goes wrong.

Physical stock is not the same as available stock

There are four hundred units on the rack, of which three hundred and fifty are promised to tomorrow's orders. Technical stock says four hundred, free stock says fifty, and economic stock adds open purchase orders and deducts sales still to be delivered. Look at the wrong figure and you sell goods that already belong to someone else. So don't show a stock figure; show an availability answer.

Stock across multiple locations

As soon as there are two warehouses, an in-between category appears: goods that are no longer at one location and not yet at the other. If you don't record that transfer as stock in transit, you're missing half of an item for a day. On top of that comes the question of which location a customer may be supplied from, and what an urgent transfer costs in freight.

Backorders and partial deliveries

There are twelve units left and three customers want them. Who gets them is a policy decision: in order of receipt, by customer priority or by order value. That decision belongs in the system, not with whoever happens to have the screen open. Then comes the rest: deliver the remainder or cancel, invoice separately or not, and who pays for the extra freight run. If a customer doesn't accept partial deliveries, their order may only be released once it is complete. That is a rule in the system, not a note in the customer record.

The invoice price is not the cost price

With imports, costs are added on top that only become known later: freight, insurance, customs clearance and import duties according to the commodity code the item falls under. Who bears what depends on the agreed Incoterm. The freight invoice arrives weeks after the goods, so at the time of receipt the actual cost price per unit isn't yet fixed. The system must allocate those costs to the batch afterwards and recalculate stock value and realised margin. Add minimum order quantities and long lead times, and purchasing advice becomes a calculation instead of a gut feeling.

Integrations and standards you can't avoid

A distribution ERP never stands alone. If a WMS runs in the warehouse, the physical truth shifts there and the ERP keeps the administrative one. The key design decision is then not technical but organisational: which system leads when the counts differ, and when does the other one correct itself.

Towards customers, EDI is not optional in many industries. The UN/EDIFACT messages you encounter most often are ORDERS for the order, ORDRSP for the confirmation, DESADV for the dispatch advice and INVOIC for the invoice, with PRICAT for price and product catalogues. Underneath lies GS1 identification: a GTIN per item, a GLN per party and location, and an SSCC on the parcel label, so that the announced shipment and the pallet on the dock are the same unit. Large customers prescribe their own interpretation of these messages, so expect different profiles per customer.

On top of that come carrier booking and track-and-trace feeding back onto the order, and on the invoicing side the European e-invoicing standard EN 16931 with the Dutch implementation NLCIUS, exchanged via Peppol.

UN/EDIFACT ORDERS & ORDRSP DESADV dispatch advice INVOIC & PRICAT GS1 GTIN / GLN / SSCC Peppol & NLCIUS EN 16931 e-invoicing WMS integration Carrier APIs Scanning & barcodes PostgreSQL REST & GraphQL APIs Docker & CI/CD Audit logging & monitoring

If your question goes beyond the administrative core and also involves purchase planning and supplier performance, see supply chain management software.

Not sure about a large project yet?

Test your idea first: a working prototype in 1 day

With OneDayBuild, we make your idea tangible in a single day for €1,150, so you know whether further development is worth the investment. Decide to go ahead with the full build? Then we deduct the cost in full.

View OneDayBuild →

When an off-the-shelf package is the better choice

For a wholesaler with a conventional way of working, a mature distribution package is almost always wiser than custom software. Microsoft Dynamics 365 Business Central, Exact, AFAS, SAP Business One and Infor have years of edge cases behind them that you would otherwise have to discover yourself: VAT on EU chain transactions, credit notes that land in the right period, stock valuation your accountant will accept. Legislative changes also arrive with the release.

Don't underestimate what building your own brings with it, either. You become responsible for every change the legislator forces on you, for security, and for knowledge that would otherwise sit with a supplier. An ERP is never finished.

Custom software pays for itself when your commercial model is precisely what no package supports: a pricing and rebate structure you won't simplify because it is how you make your margin, or units and calculation rules that are commonplace in your niche but don't exist in the standard product. A hybrid is often best: the general ledger stays in the package, and we build the trading core around it as custom software. If a package is enough, we will tell you. Tell us about your situation.

Signs that custom software is justified

  • Your pricing structure doesn't fit in a package's fields, and simplifying it would cost you margin
  • Retrospective rebates determine your real margin and need to be factored in at the order stage
  • You work with units the standard product doesn't know, such as variable weight or sales by length
  • Your biggest customers require message profiles your package doesn't support
  • A function you need has been on your supplier's roadmap for years
  • Your way of working is your differentiator, not the administration around it

Frequently asked questions about a distribution ERP

Often you should. Those packages cover purchasing, inventory, sales and invoicing for a conventional wholesaler well and absorb legislative changes for you. The balance only tips when your pricing or rebate structure doesn't fit the standard fields and you don't want to simplify it.

They are rarely recorded in full. Some of them live in spreadsheets, in email and in the heads of the sales support team. The first phase is therefore an inventory: which types of agreement exist, which precedence rule applies when they overlap, and which agreements have effectively lapsed.

The code and the data are yours. We deliver into your own repository and onto infrastructure you have access to, with documentation of the architecture, the integrations and the rollout. Also put handover in writing in the maintenance contract.

Being locked in rarely comes down to the technology and usually to undocumented business rules. Make sure pricing, allocation and rebate calculation exist in the system as explicit, testable rules, that integrations run through documented interfaces, and that your data remains exportable.

Yes, and that is often the wisest set-up. The custom software manages products, prices, inventory, orders and invoices, and passes postings to the financial package. One agreement is then crucial: which system is the master for debtors, products and open items.

Your administration must remain auditable and reproducible, and falls under the statutory retention obligation for tax records. In practice that means gap-free invoice number sequences, no silent changes after the fact but corrections with a trail, and a financial audit file your accountant can import. From then on, you are the one safeguarding that requirement.

Only if all channels call the same pricing engine. If the webshop works from an exported price list, it falls behind as soon as a promotion or a new volume discount takes effect. Build the price calculation as a single service and record on each order line which agreement was applied.

Want to talk through your pricing structure?

Tell us how your prices, tiers and rebates are structured and which systems you currently use. We'll tell you honestly whether an off-the-shelf package will do and where custom software pays for itself, before anything gets built. For shipment visibility across multiple carriers, see the control tower integration.

Another perspective on this topic can be found on applatenmaken.com: building an ERP system.

Edit content