Step 1
Collect the order history with customer identifiers, order dates, line items and their categories, order values and refund entries for one stated span, together with the analysis date, the catalogue mapping used for categories and any promotion calendar the merchant keeps.