Hello Ajboonstra,
I can steer you in the right direction for recording this kind of transaction. Essentially, you have a situation where your customer has become somewhat of a vendor/supplier since they sold product to you. In QuickBooks, customer and vendor accounts are handled separately. This means there isn't a way to apply an amount received from your customer selling you something to their open invoice. Because of that, it takes a bit of accounting maneuvering to work this out. Luckily, we have awesome accountant users here in community who have offered their advice on these kinds of questions previously.
I recommend taking a look at this one, for instance, as a place to start: I have a customer who is also a vendor. I have paid his bill minus what he owes us. How do I credit ...
You'll note that I've linked to a QuickBooks Desktop question, but the accounting methodology should be the same. If you have an accountant, I recommend adding them as an accountant user to your QuickBooks Online so they can take a look at your books and help you get set up with this. Learn more here: Invite or remove an accountant
If you're looking for an accountant, QuickBooks can help you there, too! Simply click the My Accountant tab in your account, then the Find a Pro to Help button. From there, you'll be taken to a search where you can use your postal code to find an accountant near you.
I hope that helps! Don't be afraid to stop by community again. :)