How can I fetch order price from a form and update related custom fields on contact

I’d like to run a report to see how long members are staying in my membership on average and how much money they spend.
I have custom fields for start date and end date and they’re added to the relevant automation flows.
But I have trouble to streamline the pricing (I have multiple products for different price tags).
I know I could solve this by writing custom script but isn’t there an easier solution?