Bad debt options

You have basically settled a transaction by barter rather than by cash.

If you are now selling the “thing” that you received then you would simply treat the money received as if it was a payment by the client.

If you are keeping the “thing” in the business either as an asset or stock then you can create a supplier account with a purchase equal to the outstanding debt. Then use the procedure described in the link below to set one off against the other.