Price audit
An API change caused price mismatches in e-commercevariants, across colors and sizes.
Try the audit101 references corrected245 products audited
The story
Every product has a grid of variants with their own prices. Some prices changed incorrectly, and checking every cell by hand was impractical.
I wrote a Python and Selenium automation that audits each variant, checks inventory and corrects mismatches using the same interface as the store team. It reloads the page after each correction to verify the result.
The tricky part was recovery. The browser can crash, and a partial or repeated correction is worse than no correction. That is why each write is logged before it happens.

The audit resumes from its checkpoint.
Run, stop and resume the audit. The grid marks the items already checked.
mismatch
corrected and verified
ok
Under the hoodconstraints, steps and details
What could go wrong
- A correct price hides an error in a neighboring variant.
- Stock for one variant is used to validate another.
- A list of mismatches is treated as approval.
- A crash leaves a partial write or causes a repeat write.
Each correction, step by step
- Read the current state and validate the variant grid.
- Calculate the target only for approved references.
- Log the intended write in a local SQLite journal.
- Save through the interface.
- Reload and compare prices, variant grids and stock.
- Mark the correction as verified.
Four independent steps check prices, check variant grids, match stock and apply corrections. If a run stops before saving, the pending write can resume. If it stops afterward, the automation rereads the screen to verify the save without repeating it. If the state matches neither the original nor the target, the run stops.
Monetary values use Decimal arithmetic. The expected amount and the observed amount are stored separately.