We study a periodic review joint inventory and pricing problem of a single item with stochastic demand subject to reference effects. The random demand is contingent on the current price and the reference price that acts a benchmark against which customers compare the price of a product. Randomness is introduced with an additive random term. The customers perceive the difference between the price and the reference price as a loss or a gain. Hence, they have different attitudes towards them, such as loss aversion, loss neutrality or loss seeking. We model the problem using safety stock as the decision variable and show that the problem can be decomposed into two subproblems for all demand models under mild conditions. Using the decomposition, we show that a steady state solution exists for the infinite horizon problem and we characterize the steady state solution. Defining the modified revenue as revenue less the production cost, we show that a state-dependent order-up-to policy is optimal for concave demand models with concave modified revenue functions and provide example demand models with absolute difference reference effects and loss-averse customers. We also show that the optimal inventory level increases with the reference price. All of our results hold for finite and infinite horizon problems.