Case study 01 · AI-assisted data engineering

Finding Six Figures of Pricing Errors in ERP Data

2,763 items audited against last purchase cost; 106 found priced below it. Findings land in a reviewable workbook, and approved changes ship through a staged pipeline.

NetSuite item costs, vendor prices, and sell prices drift out of sync constantly across a catalog of thousands of SKUs — vendors update price sheets, costs change, nobody re-touches every item every time. Margin erosion and stale pricing are invisible until someone looks, and no automated pass had ever looked.

What it found

The audit compared what the company last paid for each item against what it sells for, across 2,763 items — pulled through the ERP's query API in batches to respect its rate limits. It computed margin at last purchase price for every item (a median around 35%) and flagged 106 items priced below what was last paid for them, 63 of those with stock on hand: in aggregate, six-figure exposure that no one had seen. A separate coverage pass found dozens of items missing a price entirely and a couple dozen priced at zero.

The pipeline

Every vendor project follows the same pipeline: pull current cost and pricing data out of NetSuite via batched SuiteQL, compute exposure in Python, generate a reviewable Excel workbook, stage the changes in sandbox, and apply to production after human-in-the-loop approval — through NetSuite's CSV import flow rather than direct API writes, so the diff is reviewable before it's real.

AUDIT-TO-APPROVAL PIPELINE — THE SAME SHAPE FOR EVERY VENDOR PROJECT NetSuite batched SuiteQL 7 batches, under the query cap Python margin at last purchase price exposure computed Excel review workbook rendered to PDF, checked visually Sandbox staged in full and verified default target APPROVAL human review before any production push Production resumable and journaled — picks up mid-way
The same pipeline shape for every vendor project. Production writes go through NetSuite's CSV import flow after approval, and the production step is resumable if interrupted.

The production path

The write path was proven on a real vendor repricing — several hundred items — staged fully in sandbox, then run to production as a resumable, journaled process that survives interruption and picks back up mid-way. A data-quality bug surfaced partway through (legacy items missing a required field, failing every write) and was handled with a retry wrapper that backfills the default value, validated on a single pilot item before running across the batch.

Outcome

That vendor repricing is fully deployed to production. The below-cost audit was delivered as a review workbook and is with the business owner pending a pricing decision; other vendor repricing projects are staged in sandbox awaiting the same approval.

Stack
SuiteQL (batched) Python openpyxl NetSuite CSV Import Excel COM automation PDF rasterization