Generating a Part Report with POs and Landed Unit Price
Last updated: November 25, 2026
This article describes how to generate a report of your inventory by part. The report includes purchase orders, quantities, allocations, unit price, and landed unit price (shipping and tariffs).
Navigate to: https://platform.cofactr.com/reporting/sql
Note: The SQL Explorer feature is not included with all Cofactr plans. Please contact success@cofactr.com to discuss upgrades to a plan that includes SQL Explorer if you do not already have access.
Copy and paste the following query into the query field:
SELECT
part.mpn,
part.mfg,
part.custom_id AS internal_part_number,
(
SELECT STRING_AGG(DISTINCT alt.mpn, ', ')
FROM alt_part_bom_line_join j1
JOIN alt_part_bom_line_join j2 ON j2.bom_line_id = j1.bom_line_id
JOIN part alt ON alt.id = j2.part_id
WHERE j1.part_id = part.id
AND j2.part_id != part.id
) AS other_mpns,
part.description,
stock_lot.lot_id AS cofactr_lot_id,
CASE WHEN stock_lot.is_expected THEN 'Expected' ELSE 'On Hand' END AS lot_status,
stock_lot.quarantined,
stock_lot.quantity,
COALESCE((
SELECT SUM(a.quantity)
FROM allocation a
WHERE a.stock_lot_id = stock_lot.id
), 0) AS allocated_qty,
purchase_order.cofactr_po_number,
purchase_order.customer_po_number,
requisition.code AS order_code,
stock_lot.unit_price,
ROUND(pol.shipping_paid / NULLIF(pol.quantity, 0), 6) AS shipping_per_unit,
ROUND(pol.duties_paid / NULLIF(pol.quantity, 0), 6) AS tariffs_per_unit,
ROUND(
stock_lot.unit_price
+ COALESCE(pol.shipping_paid / NULLIF(pol.quantity, 0), 0)
+ COALESCE(pol.duties_paid / NULLIF(pol.quantity, 0), 0)
, 6) AS landed_unit_price
FROM stock_lot
LEFT JOIN part ON stock_lot.part_id = part.id
LEFT JOIN purchase_order_line pol ON stock_lot.purchase_order_line_id = pol.id
LEFT JOIN purchase_order ON pol.purchase_order_id = purchase_order.id
LEFT JOIN requisition_line ON pol.purchase_request_id = requisition_line.id
LEFT JOIN requisition ON requisition_line.requisition_id = requisition.id
WHERE stock_lot.quantity > 0
ORDER BY part.mpn, stock_lot.is_expected, stock_lot.lot_idClick Run Query
If you have a large library of parts, it may take a minute or two for the data to load.
Optionally, click Export to save the report as a CSV or Excel file.
Reading the report
Each row is one stock lot. If you have more than one lot of a part, that part appears on more than one row.
mpn, mfg: Manufacturer part number and manufacturer
internal_part_number: Your internal part number, if one is set
other_mpns: Other MPNs that share a BOM line with this part
cofactr_lot_id: The lot ID assigned by Cofactr
lot_status: On Hand or Expected
quarantined: Whether the lot is quarantined
quantity: Number of parts in the lot
allocated_qty: Quantity allocated to a program or kit
cofactr_po_number: The Cofactr PO the lot was purchased on
customer_po_number: Your PO number, if one was provided
order_code: The order code (starts with RQ)
unit_price: Unit price paid
shipping_per_unit, tariffs_per_unit: Shipping and tariffs paid on the PO line, divided by the line quantity
landed_unit_price: Unit price plus shipping and tariffs per unit
Things to know
Fees: Landed unit price in this report includes shipping and tariffs. Cofactr fees are not included.
Parts you shipped to Cofactr: Lots you sent in yourself don't have a Cofactr PO, so the PO, shipping, and tariff columns are blank and the landed unit price equals the unit price.