I appreciate the details that you've provided on your concern, whitegost. You can accomplish your goal by making the expense transactions billable to the created project. I'll explain more details about this.
Since you've already created a profile for your customer, all you need to do is create a vendor profile as well for the XYZ company.
Next is to create an expense transaction for the purchase that you've made and make it billable to the created project.
Here's how:
Lastly, if you convert it into an invoice you can just change it to service instead of the product.
Here's how:
Additionally, you may run and customize your reports to check your company's profitability and upcoming expenses. This way, you can track your business's cash flow accordingly.
I'm still available if you have further questions about handling customer credits in QBO. Simply click on the Reply button and I'll make sure to answer your queries promptly.