I broke the lever of my shifter (SRAM X7) when I fell off my bike on a trail. I think it just fell off the unit. I can see where the lever is connected to the mechanism that pulls the cable. Can I replace just the lever, and not have to buy the entire shifter?
It's extremely unlikely that you will be able to buy parts for a cheap shifter. The whole unit costs $US25 with free shipping.
Imagine you could buy just the lever wholesale for $3. Then you'd pay the wholesaler $3 to find it and pack it for you, then the $3 postage cost. So your "$3" part is going to cost you $9. Plus you're probably going to want the mounting parts for that lever, but they're unlikely to be available separately (the economics get even worse for 2c screws), so there will be a kit of parts including the lever, ratchet mechanism and whatever attaches it to the body. But that kit costs $10 plus the $6 S&H. So you have saved $9 over buying a whole new lever.
Now the shop cuts the old cable off the bike, installs the new parts, new gear cable and outer, and set everything up. Which is about $20-$40 of labour, plus $10 for the cable and outer.
The total cost is about $16 + $10 + $20 = $46-$66. Or $55 for a whole new lever, fitted. New whole lever is an easy job, taking apart the old one is tricky so will probably take longer.
From a bike shop's point of view that's a $9 saving in exchange for the risk that you're wrong about how much damage was done. If the pivot that that lever sits on has bent the repaired lever won't work properly. There's a whole range of problems like this, but you as the customer won't care, you will just come in and say "you fixed it, but it doesn't work". After the first time this happened they stopped doing it, and only fit whole new parts.
So bike shops will not order the "parts kit", only a few keen cyclists who do their own repairs will. Instead of selling hundreds of these kits, SRAM will only sell ten. And maybe another ten next year. Or not, since the overhead cost of each product is non-trivial and if something is only going to sell a hundred units at $10 they're not going to bother.
Which is what you see happening.
@Moz has provided a very good answer to this, however, do hunt around on eBay for what-you-may-find, you also might have one of those bike shops nearby that keep broken-but-useful parts (where they may have what you want) and also be aware that these levers come in a set, you only want one (a replacement) not the set of two.
Consult your LBS.