Answer:
The journal entries for the whole transaction are:
August 7, 202x, merchandise purchased on account, terms 1/10, n/30
Dr Merchandise inventory 9,750
Cr Accounts payable 9,750
August 11, 202x, partial return of purchased merchandise
Dr Accounts payable 1,500
Cr Merchandise inventory 1,500
August 16, 202x, invoice is paid within discount period
Dr Accounts payable 8,250
Cr Cash 8,167.50
Cr Purchase discounts 82.50