For now, we recommend storing barcodes either as the name of the resource (best option for searching and assigning those resources later), or in the “ID” property (not as good as the resource name, but still helpful). The name of a resource is searched in all contexts, while the ID property on a resource is searched in only some contexts. (And other properties are not yet searched at all, which is why we don't recommend using them yet for barcodes.)
Note, we are expanding search to look in more properties by default. So eventually, it won’t matter where you store the barcode of a resource. But for now the above suggestions work best.