I'm aware that the IRS treats barter between businesses as the sale of services in both directions, and this make intuitive sense if you use an accrual accounting method. But how would you treat this if you use a cash basis? (This question is US-specific but may be relevant to other countries as well.)
Make up a (realistic) value
If you don't track the accrued costs involved, then it means that the valuation of the deal will be somewhat arbitrary, but it still can be made by looking at the value of equivalent or similar goods or services.
It's rather similar to accounting treatment of (noncash) gifts, for example.
You make up a valuation, and as there are obvious tax reasons to make it as low as possible, the valuation should be justifiable or you risk the wrath of IRS. If you sell the same goods or services for cash, then the value of the barter deal is obvious. If this barter is the only time you're handling this particular type of goods, a wholesale price of similar items (either of your items, or the items that you're receiving in barter) could work.