You can use spill for anything that is fluid-like. Liquids are obviously fluids, but mass quantities of small things can also act as fluids in certain instances. Things in open bushels or buckets often fit this criteria, but non-actual-liquid things in closed bags often do not.
Or, put another way, if you can say pour X, you can say spill X.
You could use it for a large bucket/bushel of green beans but not really a bag of them. Unless it's a large bag with an open top (i.e. like a bucket or bushel). Because you don't pour greens beans from a bag typically. (Other types of beans might work with spill).