Adding an Inventory, XML Upload

An inventory for an item in the BrickLink catalog can be uploaded in BrickLink XML format on the Add Inventory page. If there is an error in the BrickLink XML format, the upload process will stop and display an error message. Once the BrickLink XML format has been successfully uploaded with no errors, the inventory can be verified before being submitted to an Inventories Administrator for final approval.

Below are the guidelines for how to create an inventory in BrickLink XML format along with detailed explanations of the available elements that must or can be used. A sample inventory in BrickLink XML format follows that.


Creating an Inventory in BrickLink XML format

  • An inventory in BrickLink XML format can not have an XML declaration. For example, any line similar to
    <?xml version="1.0" encoding="UTF-8">
    must be removed.

  • An inventory in BrickLink XML format must open with an
    <INVENTORY>
    tag and close with a corresponding
    </INVENTORY>
    tag. This is known as the
    INVENTORY
    element.

  • An item being listed in an inventory in BrickLink XML format must open with an
    <ITEM>
    tag and close with a corresponding
    </ITEM>
    tag. This is known as an
    ITEM
    element. One or more
    ITEM
    elements must be placed inside the
    INVENTORY
    element (i.e. between the
    <INVENTORY>
    and
    </INVENTORY>
    tags).

  • An item being listed in an inventory in BrickLink XML format must contain four required elements and can contain other optional elements. Whether required or optional, these elements must all be placed inside an
    ITEM
    element (i.e. between the
    <ITEM>
    and
    </ITEM>
    tags for a given item). Omitting one or more of the required elements will result in an error during the upload process. The following table summarizes the elements available for use inside an
    ITEM
    element.

    Element Usage Required Details
    ITEMTYPE <ITEMTYPE>
    value
    </ITEMTYPE>
    Yes value must be one of the following: S (for a set), P (for a part), M (for a minifigure), B (for a book), or G (for a gear item)

    Note: A minifigure inventory can only contain parts.
    ITEMID <ITEMID>
    value
    </ITEMID>
    Yes value is the Item No. for this item in the BrickLink catalog
    COLOR <COLOR>
    value
    </COLOR>
    Yes value is a color ID from the Color Guide

    Note: If this item is a set, a minifigure, or a book, value must be 0.
    QTY <QTY>
    value
    </QTY>
    Yes value is a whole number greater than 0 representing the quantity of this item in the inventory
    EXTRA <EXTRA>
    Y
    </EXTRA>
    No This element is only needed when this item is an extra item in the inventory. Refer to the Inventory Sections help page to determine if this item is considered an extra item for the purposes of the inventory.

    Note: A minifigure inventory can not contain extra items.
    COUNTERPART <COUNTERPART>
    Y
    </COUNTERPART>
    No This element is only needed when this item is a counterpart in the inventory. Refer to the Inventory Sections help page to determine if this item is considered a counterpart for the purposes of the inventory.

    Note: A minifigure inventory can not contain counterparts.
    ALTERNATE <ALTERNATE>
    Y
    </ALTERNATE>
    No This element is only needed when this item is an alternate item in the inventory. Refer to the Inventory Sections help page to determine if this item is considered an alternate item for the purposes of the inventory.

    Note: A minifigure inventory can not contain alternate items.
    MATCHID <MATCHID>
    value
    </MATCHID>
    No This element is only needed to create a match between one or more alternate items with one or more regular items. Regular items are those that are not extra items, counterparts, or alternate items.

    value is a whole number greater than 0 representing the match ID for a group of items that are matched together in the inventory. value should start at 1 for the first group of items that are matched together and then be incremented by 1 for each additional group of items that are matched together. value must be the same for all items in the same group.

    Note: All items with a match ID must be sorted at the bottom of the inventory.


Sample Inventory in BrickLink XML format

The sample inventory in BrickLink XML format shown here contains the parts which make up the Skeleton with Standard Skull minifigure.

<INVENTORY>
<ITEM>
<ITEMTYPE>
P
</ITEMTYPE>

<ITEMID>
6260
</ITEMID>

<COLOR>
1
</COLOR>

<QTY>
1
</QTY>

</ITEM>
<ITEM>
<ITEMTYPE>
P
</ITEMTYPE>

<ITEMID>
3626bpb0001
</ITEMID>

<COLOR>
1
</COLOR>

<QTY>
1
</QTY>

</ITEM>
<ITEM>
<ITEMTYPE>
P
</ITEMTYPE>

<ITEMID>
6265
</ITEMID>

<COLOR>
1
</COLOR>

<QTY>
2
</QTY>

</ITEM>
<ITEM>
<ITEMTYPE>
P
</ITEMTYPE>

<ITEMID>
6266
</ITEMID>

<COLOR>
1
</COLOR>

<QTY>
2
</QTY>

</ITEM>
</INVENTORY>