Contribution Margin for Ecommerce: CM1, CM2 and CM3 from AFAS, Your Store, Sendcloud and Ad Data

Reporting

Contribution Margin for Ecommerce: CM1, CM2 and CM3 from AFAS, Your Store, Sendcloud and Ad Data

Contribution margin needs four systems: your store, AFAS for cost prices, Sendcloud for shipping costs and your ad platforms. Here is how they fit together.

Updated November 20, 2026

·

12 min read

Revenue and ROAS tell you how much you sold and what the ads cost. They do not tell you whether an order made money. That answer is spread over four systems that rarely meet: the store knows what was sold, AFAS knows what it cost to buy, Sendcloud knows what it cost to ship, and the ad platforms know what it cost to win the customer. Put the four next to each other per order and you can steer on contribution margin, which is the number a webshop actually lives on.

This guide explains CM1, CM2 and CM3, shows which system supplies which line, walks through one worked month, and lists the places where the calculation usually goes wrong. The examples use AFAS Profit, Shopify, WooCommerce or Magento, and Sendcloud, because that combination is common among Dutch webshops. The method is the same with another ERP or shipping platform.

What CM1, CM2 and CM3 mean

Contribution margin is what is left of revenue after the costs that an order causes. It is calculated in steps, and each step answers a different question.

LevelCalculationThe question it answers
CM1Net revenue minus the cost of the goods soldDo we earn enough on the product itself?
CM2CM1 minus the costs of getting the order to the customer: shipping, packaging, payment fees, fulfilment and returnsDo we still earn money once the parcel is delivered?
CM3CM2 minus marketing spendDo we still earn money after paying to win the order?

There is no official standard for these three levels. Some companies put payment fees in CM1, some count returns separately, and some stop at CM2 and call the result after marketing something else. That is fine, as long as you write your own version down once and use it everywhere. The same advice applies to every number on a KPI scorecard.

Net revenue needs the same care. In this guide it means what the customer paid for the products, without VAT, after discounts and after refunds. A revenue figure that still contains VAT makes every margin look about a fifth better than it is.

Which system holds which number

No single system can calculate contribution margin on its own, because each one only sees its own part of the order.

LineWhere it livesWhat to watch
Orders, order lines, discounts, VAT, refundsShopify, WooCommerce or MagentoThe store is the record of what was sold. Use its order number as the key for everything else.
Cost price per articleAFAS ProfitAFAS values an article at a fixed settlement price, an average purchase price or the last purchase price. Know which one you use.
Stock and purchase invoicesAFAS ProfitNeeded when the cost price changes per delivery.
Shipping cost per parcel, surcharges, return labelsSendcloudWhat Sendcloud invoices you, per parcel. This differs from what the customer paid for shipping.
Payment feesYour payment provider, such as Mollie, or a field on the orderOften a fixed amount plus a percentage per order.
Ad spend per campaignGoogle Ads, Meta Ads, Microsoft Ads and othersSpend is per campaign and per day, never per order.
Which channel an order came fromGA4, your own tracking, or a post purchase surveyThis is what links spend to orders.

Two keys hold the whole thing together. The order number links the store to the parcel in Sendcloud. The article code or SKU links an order line in the store to the article in AFAS. If those two are clean, the rest is arithmetic. If they are not, fix that first.

A worked month

Take a hypothetical webshop with 4,000 orders in a month and an average order value of €75 excluding VAT.

LineAmountShare of net revenue
Net revenue€300,000100%
Cost of goods sold€165,00055%
CM1€135,00045%
Outbound shipping€22,000
Return shipping and handling€6,000
Payment fees€4,500
Packaging€2,500
CM2€100,00033.3%
Ad spend€48,00016%
CM3€52,00017.3%

Per order that is €33.75 at CM1, €25 at CM2 and €13 at CM3. Out of that €13 the shop still has to pay salaries, rent and software. A shop that reports a ROAS of 6.25 on this month (€300,000 divided by €48,000) and a shop that reports €13 per order are describing the same month. Only one of the two sentences tells you how much room there is.

What changes when you steer on CM3

The total is useful. The split is where decisions come from. Here are two campaigns from the same hypothetical shop, each with €10,000 in spend and €40,000 in net revenue.

Campaign ACampaign B
Net revenue€40,000€40,000
Cost of goods sold€22,000€28,000
CM1€18,000€12,000
Shipping, returns, fees€4,000€7,000
CM2€14,000€5,000
Ad spend€10,000€10,000
CM3€4,000minus €5,000
ROAS (net revenue divided by ad spend)4.04.0

On ROAS these campaigns are equal, and an ad platform would treat them the same. Campaign B sells products with a thinner margin that come back more often, and it loses €5,000. Nobody sees that until cost prices and shipping costs sit next to the spend. This is the practical reason why platform ROAS is a poor target.

The same split works along other lines:

  • Per product or category. Which products look like bestsellers on revenue and lose money once returns are counted?
  • Per country. Shipping to Germany or Belgium costs more per parcel, and return rates differ per market.
  • Per new or returning customer. A first order may be allowed a CM3 of zero if the second order comes without ad spend.
  • Per discount campaign. A discount comes straight out of CM1, while shipping and ad costs stay the same.

Once the numbers exist, set a target on them. A target on CM3 per month, next to the revenue target, changes what the marketing team optimizes for.

What you need from AFAS

AFAS Profit has no fixed set of tables that every tool can read. Data comes out through GetConnectors: definitions of a data set that someone sets up in your AFAS environment and switches on in an app connector. A tool reads them with a token that belongs to that app connector. By switching on only GetConnectors, the access stays read only.

For contribution margin you need at least:

  • Articles with their cost price. AFAS can value an article at a fixed settlement price, at the average purchase price or at the last purchase price. Each gives a slightly different CM1, so decide which one counts as cost of goods in your reporting.
  • Stock per article, if you also want to see how much money sits on the shelf.
  • Purchase invoices and receipts, if your purchase price moves a lot between deliveries.
  • The ledger, if you want to check that the margin in your dashboard matches the books at the end of the month.

One limit is good to know in advance. With a single cost price per article, AFAS knows what an article costs on average, and it does not know what this particular unit cost. If you buy the same product through different routes at different prices, you only get the real cost per sold unit when you record lots or serial numbers in AFAS, or use separate article codes per route. That is a choice in how you keep your administration, and no integration can add it afterwards.

What you need from Sendcloud and your store

Sendcloud holds two things the store does not. The first is the invoiced cost per parcel, with the base rate, surcharges, fuel surcharge and any refunds as separate lines. The second is the return: the reason the customer gave, and what the return label cost. The parcel carries the order number that your store sent to Sendcloud, and that is how the cost finds its way back to the order.

Three details matter:

  • Shipping income and shipping cost are different numbers. The store knows what the customer paid for shipping. Sendcloud knows what you paid. Free shipping above a threshold means the first is zero and the second is not.
  • One order can have several parcels. A split shipment or an order in two boxes gives several cost lines for one order. Add them up per order.
  • Sendcloud only knows what Sendcloud invoices. If you ship on your own carrier contract and the carrier invoices you directly, those costs come from the carrier.

From the store you need the order lines with quantity, price, discount and VAT, and the refunds per line. Take refunds seriously: a returned item gives back revenue and cost of goods, and the shipping and return costs stay.

Where the calculation usually goes wrong

Timing. An order is placed today, shipped tomorrow, invoiced by the carrier next week and returned in three weeks. A margin report for last week is provisional. Decide when a period counts as final, and expect recent weeks to move.

Costs counted twice. Some shops type an estimated shipping cost on the order in the store and also receive the real cost from Sendcloud. Add both and shipping is counted double. Pick one source per kind of cost, and prefer the invoiced one.

Orders without a cost price. A new article that is not yet in AFAS, or a SKU that is spelled differently in the store, has no cost price. Counted as zero cost, it makes the margin look better than it is. Show how much of the revenue has a known cost price, and treat margin on the rest as unknown.

Ad spend per order. Spend does not belong to an order. It is assigned through attribution, and the model you choose moves CM3 between channels. Compare several attribution models next to each other before you cut a campaign on its CM3.

VAT. Revenue with VAT and costs without VAT is the most common mistake of all. Everything goes in without VAT. Goods sold under the margin scheme need separate treatment, because VAT is due on the margin and not on the selling price.

Where Verity fits

Verity loads these systems into your own BigQuery, models them, and shows them on dashboards with targets and attribution. Each one has its own connection:

  • Your store. Shopify, WooCommerce and Magento: orders with discounts, tax and refunds. The Magento connection also brings the cost price on every order line.
  • Shipping. Sendcloud: what Sendcloud invoices per parcel, and your returns, matched to your orders by order number.
  • Payments. Mollie: the transaction fees per payment method, refunds and chargebacks, with a ready made dashboard.
  • AFAS Profit. AFAS: your articles with their cost prices, and your stock per warehouse with a snapshot per day.
  • Marketing. Google Ads, Meta Ads, Microsoft Ads, GA4 and Klaviyo, with attribution models side by side.

The cost price from AFAS follows the way you keep your administration. With one price per article you get the margin on that price. If you record serial numbers, the cost of a sold item comes from its own purchase line, and CM1 per order is the real one.

To see what this looks like for your shop, book a demo and bring your own definition of CM1, CM2 and CM3. That is where we start. The dashboards page shows how targets sit next to the actuals, and the data integration page explains how the loading works.

Frequently asked questions

What is the difference between CM1, CM2 and CM3?

CM1 is net revenue minus the cost of the goods sold. CM2 also takes off the costs of delivering the order, such as shipping, packaging, payment fees and returns. CM3 also takes off marketing spend. The exact lines per level differ per company, so write your own definition down.

Can I calculate contribution margin from my store alone?

Only partly. Shopify, WooCommerce and Magento can hold a cost price per product, and that gives a rough CM1. The real shipping cost, the return cost and the ad spend are in other systems. If AFAS is your administration, the cost price there is the one your accountant uses, and that is the one to report on.

Does AFAS know the purchase price of each item I sold?

By default AFAS values an article at one price: a fixed settlement price, the average purchase price or the last purchase price. The purchase price of one specific sold unit is only known when you record lots or serial numbers, or use separate article codes for different purchase routes.

How do Sendcloud costs get linked to an order?

Sendcloud invoices per parcel, and each parcel belongs to a shipment that carries the order number your store sent. Add the invoice lines of all parcels of an order to get its shipping cost. Orders shipped outside Sendcloud need the costs from the carrier.

Which is the better target, ROAS or CM3?

CM3, when you have the data. ROAS treats every euro of revenue as equal. CM3 shows that a campaign selling low margin products with many returns can lose money at the same ROAS as a campaign that earns well.

Stop Guessing. Start Asking.

Verity turns your data into a conversation. Ask questions in plain language, get trusted answers backed by your actual data.