Retail and e-commerce · Profitability by SKU

Contribution margin by order and SKU

What is left of each order and each SKU after COGS, shipping, commission, installment fees, media and taxes, without deducting anything twice.

UsageWidely used
EffortHigh
ForRetailers and e-commerce businesses that sell across several channels and want to know the real profit per product.
Source

Channel orders, cost per SKU and fees

Rule

Effective cost, allocation per item and nothing counted twice

Outcome

Contribution margin by item, SKU and channel

Activation

Dashboard, AI agent and channel report

What it solves

  • The margin of each SKU and each marketplace accounts for all variable costs, not just COGS.
  • No cost goes in twice: commission, shipping, payment fees and media each appear once.
  • It becomes clear how much the installment card fee and each channel's commission eat into margin.

Business questions it answers

Ask your agent these questions once the case is live.

What is the contribution margin by marketplace and by SKU this month?
What are the 10 SKUs with the worst margin, and what is weighing on each one?
How much is the 12-installment card fee taking out of our margin?
What is the maximum CPA that still breaks even for product X?
How much do we pay in commissions and fees relative to revenue on each marketplace?
Is it worth continuing to sell this product on this channel?

What you need

  • Marketplaces, own store and hub or ERP connected to Nekt
  • Cost per SKU with an effective date (spreadsheet or ERP product record)
  • The fees of each channel and of the card acquirer, per installment

What you get

  • A table by order line item and day with revenue, each cost and the margin
  • Margin dashboard by SKU, channel and period, with a ranking of the worst margins
  • A cost coverage indicator, to know how much of revenue has reliable COGS
  • An AI agent that answers questions about profit with each channel's rules

Where to activate

Profitability dashboard

SKU, quantity, revenue, COGS, commission, shipping, media, taxes and margin in R$ and %, filterable by channel.

AI agent via MCP

Answers questions about profit by product and channel with each marketplace's rules already applied.

Alerts

SKU sold without a registered cost, and SKU with negative margin for the week.

Ready to build?

Each channel has its own commission, shipping and date rules, and costs usually live in a spreadsheet. Start with one channel and one closed month. The detailed view has the business rules, the pitfalls and the acceptance test. Or send everything straight to your agent with the Nekt MCP.

The problem

Each channel delivers revenue and cost its own way: a unit commission in one, commission plus service fee in another, values in cents in a third, and the same shipment repeated under two statuses. Product cost lives in a spreadsheet that changes over time, and a SKU without a cost silently becomes zero cost. Whoever calculates on the order total and stacks everything on top ends up deducting the same fee twice or forgetting the installment card fee.

How it is usually done, and the rule

Each row is a mistake that already happened in practice.

The common wayThe rule
01
Calculating margin on the order total and then trying to break it down by product.
Calculate at the item and aggregate afterwards

The lowest reliable level is the order's line item (SKU). Allocate the order's shipping, coupon discount and service fee to the item (by item value or by quantity, with the criterion declared). Kits and bundles are exploded into their components, allocated by each component's value. Order, SKU, channel and month are sums of items.

02
Deducting commission, shipping and card fee from a value that is already the net payout.
No value goes in twice

Before deducting a component, check whether it is already inside another line. A per-order fulfillment fee that already includes payment processing does not get a card fee on top. Revenue already net of tax does not get tax deducted again. A marketplace's net payout already comes without commission.

03
Applying today's cost to sales from six months ago.
COGS at the cost effective on the sale date

Use the unit cost that applied on the order date, from a dated table per SKU. The current product record cost only serves as an estimate, flagged as such. For own production, the factory-to-store transfer cost goes in without the ICMS (state VAT) credit; for resale, invoice cost x (1 minus the supplier's ICMS rate). Packs multiply the quantity (x2, x3, x6) when the line represents the pack.

04
COALESCE of cost to zero and a 100% margin on the new SKU.
A SKU without cost never becomes zero cost

When the SKU is not in the cost table, COGS stays null and the item gets a coverage flag. Report coverage: the percentage of revenue with a known cost. Margin for an item without cost does not enter the best-margin ranking.

05
Adding up the fee column of every channel as if it were the same concept.
Commission by each channel's rule

On Mercado Livre, sale_fee is per unit: multiply by quantity. On Shopee, commission is commission_fee plus service_fee, and the subtotal received is escrow_amount. On Magalu, values come in cents and are divided by 100. On Amazon, the same shipment appears as DEFERRED_RELEASED and as RELEASED with the same value: count it once per shipment.

06
Using the shipping charged to the buyer as the shipping cost.
Shipping is what the seller paid

On Mercado Livre, the seller's real shipping cost is in orders.payments[].shipping_cost, at the payment level, not in orders.shipping. Free shipping for the buyer is a seller cost. In your own store, use the real shipping cost or the effective rate by product and destination, never the shipping charged to the customer.

07
Margin = (price minus COGS) / price, and that is it.
Deduct the installment card fee

When customers mostly pay by card in installments, the acquirer fee varies with the number of installments (around 14% for 12 installments). Apply the installment fee of each sale. If the mix shifts from single payment to 12 installments, real margin falls even at the same price and the same COGS.

08
A single rate per product, calculated as a historical average.
Rates with an effective period

Fulfillment fees, shipping tables and commissions change over time. Store each rate by product, channel or country and effective period, and apply the one in effect on the order date. A lifetime average rate distorts both past and present.

09
Treating a refund as a nonexistent order and wiping out cost that was already spent.
Order status defines what goes in

Cancelled, failed, pending or draft orders are excluded entirely: no revenue, no cost, no count. A refunded order keeps zero revenue but retains COGS and shipping cost and counts as an order. An internal or test order zeroes everything. The margin reference date is the order confirmation date.

10
Concluding the SKU sells without media because its Ads figure is zero.
Media allocated and estimates labeled

Media goes in by product and day, from the spend of the campaign tied to the product. In marketplace Ads, shared groups (catalog, family) attribute to a sibling item: a SKU with zero Ads may still have received media. Estimated tax is labeled as estimated. Contribution margin measures profitability; expected net and actual payout measure reconciliation and are not mixed.

Where each cost comes from, by channel

Normalize each channel before adding up.

Mercado Livre · commissionUnit fee x quantitysale_fee * quantity
Mercado Livre · shippingShipping paid by the sellerorders.payments[].shipping_cost
Mercado Livre · packSeveral orders in one shipmentpack_id
Shopee · commissionCommission plus service feecommission_fee + service_fee
Shopee · receivedSubtotal after feesescrow_amount
Magalu · valuesCents to reaisvalue / 100
Amazon · settlementOne shipment, onceDEFERRED_RELEASED or RELEASED, never both
Own store · revenueTotal minus itemized taxtotal_price - total_tax
Installment card paymentAcquirer fee by installment counttaxa_parcela(n_parcelas)
Refunded orderZero revenue, cost retained

Definitions

Item revenue
price x quantity minus allocated discount, excluding itemized tax, per order line item, on the order confirmation date
Item COGS
unit cost effective on the order date x quantity x pack multiplier; null, with a flag, if the SKU has no cost
Item variable costs
channel commission and fees + shipping paid by the seller + acquirer fee by installment count + fulfillment, allocated per item
Margin before media
revenue minus COGS minus variable costs, summed over the period
Contribution margin R$
margin before media minus allocated media minus sales taxes (including DIFAL, the interstate ICMS differential) when revenue is not net of tax
Contribution margin %
sum of contribution margin / sum of revenue in the period, dividing only once
Break CPA
(revenue minus COGS minus variable costs) / orders in the period: the maximum acquisition cost that still breaks even
Commission and fees over revenue
(commission + channel fees) / channel revenue in the month
Cost coverage
revenue from items with known cost / total revenue in the period

Pitfalls that already happened

Silent zero cost

SKUs missing from the cost table went in with zero COGS and showed up as the most profitable products in the operation.

Null cost with a flag, coverage indicator and an alert for SKUs sold without cost.

Commission and shipping doubled

Amazon returns the same shipment as DEFERRED_RELEASED and RELEASED. Adding both doubled commission and shipping on the vast majority of shipments.

One row per shipment, from the most recent settlement.

Shipping in the wrong field

Shipping read from orders.shipping on Mercado Livre was not the seller's cost, and margin per listing came out wrong until it was fixed.

Seller shipping in orders.payments[].shipping_cost.

Lifetime average rate

A single fulfillment fee per product, averaged over the whole history, was off by 14% to 30% in the months before a rate revision.

Rates by effective period, applied by order date.

Pack counted as a unit

In one of the stores, the line quantity represented a pack of 2, 3 or 6 units. Without the multiplier, COGS was underestimated.

Multiplier table per pack SKU, per store; a new pack SKU with no row triggers an alert.

Average of margins

The average of each day's or SKU's percentage margins does not match the month's margin and overweights low-volume items.

Sum the components and divide once.

Acceptance test

The case is done when every item passes.

Agent package

Paste into Claude, ChatGPT or any client with the Nekt MCP connected.

Full Markdown
Contribution margin by order and SKU
- Grain: one row per order line item, per day (order confirmation date). Order, SKU, channel and month are sums of items.
- No financial value is added or deducted twice. If a line already contains commission, shipping, media, discount or fee, that component is not applied again.
- COGS = unit cost effective on the order date x quantity x pack multiplier. A SKU without cost has null COGS and a coverage flag; never zero.
- Mercado Livre: commission = sale_fee x quantity; seller shipping = orders.payments[].shipping_cost.
- Shopee: commission = commission_fee + service_fee; received = escrow_amount.
- Magalu: values / 100.
- Amazon: a shipment counts once (do not add DEFERRED_RELEASED to RELEASED).
- Acquirer fee applied by each sale's number of installments.
- Cancelled, failed and pending orders are excluded. Refunded: zero revenue, costs retained, order counted. Internal or test: everything zero.
- Margin % = sum of margin / sum of revenue. Never an average of percentages.
- Estimated tax is always reported as estimated.
- Contribution margin measures profitability. Expected net and actual payout measure reconciliation. Do not treat them as equivalent.
- Transfers between companies in the same group are not revenue.
Client exceptions:
- <client>: own production COGS = transfer price x <factor> (without ICMS credit).
- <client>: per-order fulfillment fee already includes the payment fee; do not add a card fee.
- <client>: pack SKUs <list> with multiplier <n>.

Variations

Marketplace reconciliation

The same order in the marketplace, the hub and the ERP: reconcile by pack_id and store order number, with a confidence level.

Physical store with installments

No marketplace: COGS, acquirer fee per installment and single-payment vs. installment mix by store.

International DTC

Revenue excluding VAT or sales tax by country, fulfillment rate by product and country, and Break CPA by product.