Step 1
Collect the purchase history with stable customer identifiers, order dates, order values and refund entries for one stated span, together with the value measure the merchant has chosen, the currency it is expressed in and the treatment applied to refunded and cancelled orders.