From ESOUI Wiki
A place that items can be stored in is called a bag, and bags have numbered slots for stacks of items.
In code, bags are represented using one of the built-in Bag numbers. For most bags, the slots are numbered from 0 to the size of the bag, but there are exceptions, including the guild bank.
List of known bags
- The items that the player is carrying, not including quest items and equipped items.
- The contents of the player's bank.
- The items that the player has recently sold to a merchant.
- The contents of the guild bank, for the last guild that the player selected while visiting the bank.
- The contents of the player's bank with active ESO+.
- The contents of the player's Craft Bag.
- The items that the player has equipped.
- If you want to iterate over a bag's contents, then you should use ZO_GetNextBagSlotIndex.