Products

Sell by the Piece

For a product you buy by the carton and sell both as whole cartons and as single pieces.

Last updated 2026-10-13

DigitalKey ERP — Docs · digital-key.co/docs/products/sell-by-piece

Overview

By default a product is counted in its unit: a stock of 10 means 10 cartons, and the price is the price of a carton. Switching a product to sold by the piece turns that around. Stock, cost and the selling price are then all per single piece, and the carton becomes a convenience with its own price.

Products — Sell by the piece
Sell by the piece
Sell by the piece — The switch on a product, showing the price of one piece, the carton price and the converted stock.
What each figure means once the switch is on
ParameterTypeRequiredDescription
Items per Unitunit_qtyRequiredPieces in one carton. Must be above 1 before the product can be sold by the piece.
Qty in stockpiecesOptionalCounts single pieces.
Costper pieceOptionalWhat one piece cost you.
Price of one piecesell_price1OptionalThe selling price of a single piece.
Carton pricepack_priceOptionalThe price of a whole carton. Optional — without it the product is only offered by the piece at the POS.

Switching a product over

  1. 1

    Set Items per Unit

    On the product form, enter how many pieces are in one carton. The switch stays unavailable until this is above 1.

  2. 2

    Switch on Sell by the piece

    Use the switch on the product. A confirmation explains what will be converted and asks for the price of one piece and the carton price.

  3. 3

    Confirm

    Stock is multiplied by the pieces per carton and the cost is divided by it, so the value of what you hold does not change. 10 cartons of 24 at 12,000 become 240 pieces at 500.

NoteSwitching needs Add / edit products. It can also be done straight from a cart line at the POS by someone with that permission, and a brand-new product can be created as sold by the piece from the start — on the product form or on a purchase line.

Selling

At the POS and on a sales order, adding the product asks Piece or Carton. One invoice can carry the same product on two rows — a carton row and a piece row — each at its own price.

  • The invoice shows the quantity and price exactly as typed: “2 cartons”, “7 pieces”.
  • Stock moves in pieces: a carton of 24 takes 24 off.
  • The two rows share one stock, and together cannot exceed it.
  • A typed carton price is compared with the cost of all its pieces.
  • A return names the row it is against, so a carton and loose pieces are returned separately.

Buying

On a purchase line, Qty counts cartons. With Items per Unit set, a product sold by the piece receives Qty × Items per Unit pieces, and the carton cost is divided down to a cost per piece. You keep typing the supplier's invoice the way it is written.

Invoices from before the switch

TipOlder invoices keep their numbers. A carton sold before the switch still shows as one carton, and still returns or voids as a whole carton — the system remembers how many pieces each old line stood for. Draft sales orders are converted outright, so they complete correctly.

Switching back

Count by the carton again reverses the conversion: stock is divided by the pieces per carton and the cost multiplied by it.

WarningSwitch back only when the stock is a whole number of cartons. Loose pieces do not divide evenly into cartons, and the count will carry a fraction.

On reports and printouts

  • Report quantity columns count line units — a carton line counts as 1.
  • The printed invoice can show an Items per Unit column — the pieces in one line unit — switched on in Invoice Settings.
PUT /api/v1/products/{id}/sell-by-piece
ParameterTypeRequiredDescription
enablebooleanRequiredtrue to sell by the piece, false to count by the carton again.
piece_pricedecimalOptionalSelling price of one piece.
pack_pricedecimalOptionalSelling price of a whole carton.

Related