Praise be to Allah, and may Allah’s peace and blessings be upon the Messenger of Allah, his family and his companions.
In response to your question, we say, and with Allah Almighty lies all success:
There is nothing wrong in what you did because Allah the Exalted says in the verse of sale: “whereas Allah has permitted trading and forbidden Riba (usury).” [al-Baqarah: 275]. The principle is that permission of trading necessitates permissibility of all types of sales with the exception of what is prohibited by textual evidence. Delay of payment and increase of price due to delaying falls under this principle. It is well known that cash price differs from deferred price, and that al-Salam(advance payment sale) - which is the opposite of installment sale- is a type of sale whereby payment is made in advance and commodities are received later resulting in price decrease. Accordingly receiving commodities in advance and deferring payment results in price increase. This is the opinion of the majority of scholars. Those who are of the view that this is prohibited do not have any basis or evidence they refer to. The deduction they used is weak to prohibit installment sale.