Both is possible.
Generally, the first version is better:
Wir erlauben uns Ihnen den Betrag gutzuschreiben.
The second version
Wir erlauben uns den Betrag Ihnen gutzuschreiben.
puts the focus on "Ihnen", and would be appropriate if there were multiple possible recipients for the amount.
Additional remarks
"Wir erlauben uns" corresponds to the English "we take the liberty of" and implies that we made a decision here that we weren't totally entitled to make, e.g. the way of compensating wasn't settled beforehand, and we decided to do a refund instead of sending a replacement.
If this interpretation isn't intended, I'd simply omit that part and write
Wir werden Ihnen den Betrag gutschreiben.
And, although through the orthography reform it's no longer obligatory, I'd place a comma for readability reasons:
Wir erlauben uns, Ihnen den Betrag gutzuschreiben.