Importing from XML

XML is a hardware and software independent format that is designed to describe data.  If you are unfamiliar with XML, excellent information and tutorials can be found at w3schools.com.

Preparing Your XML File

XML is a structured format and is most commonly created by other computer processing.   Although there are editors that will allow you to create XML based on a schema, it is not very common to create import data using an editor.  The more likely scenario is that the data is coming from another computer source.  XML will most commonly be created by some other program to ensure it meets the strict format of the XSD.

 

The particular structure of an XML file is defined by a schema.  The XML Elements used by SixBit are documented in the SixBit Applications Programming Interface Guide in the SixBit API Schema topic.  Exporting XML from SixBit is the easiest way to see examples of the different XML elements in the SixBit Schema.

 

There are tools and websites available that will take an XML document and validate it against a schema to ensure the XML is compliant.  The SixBit schema file is called SixBitAPI.xsd and can be found in the SixBit API SDK folder of the SixBit installed directory.  This file can be used to validate XML during the development process to ensure the XML created will be compliant with SixBit.  In addition, before importing, SixBit will validate all XML.

 

In depth instruction on XML and creating XML documents is beyond the scope of this User's Guide.  It is expected that the user have some experience with XML to create XML documents for SixBit.

Importing the XML File

SixBit provides XML import capabilities for Items, Inventory, Suppliers/Consignors, Compatibility Sets, Orders, Shipments, Sales, and Buyers.  Each type of data must be provided in a separate file, but the basic process for importing from XML is the same regardless of the data type being imported.

 

 

To import items from an XML file:

  1. From the ribbon bar in the Sell Items mode (for importing Items/Inventory/Suppliers/Consignors/Compatibility Sets) , or the Ship Orders mode (for importing Buyers, Orders, Shipments/Sales)  click the arrow under the Import button, then select Import from File followed by the type of data to be imported.
  2. The Batch Edit window will appear to provide a preview of the data before importing and allow for any last minute changes to the data.  See Using the Batch Edit Window for more information.

  1. Depending upon the type of data being imported, you may be asked about the type of import in the lower left corner.  Choose the type of import to be performed.  See Importing_vs._Updating for more information.

 

Import Type Description
Add Records This option will only add new records when an existing record does not exist.  No updating of existing records will be performed.
Update Records This option will only update existing records.  If a record from the input is not found, it will not be added.
Add and Update Records This option will add any missing records and update any existing records in the database.

  

  1. The next several steps only apply when importing Item information.  When importing any other type of data, skip to step 7.

If listings are being run for any items that will be updated, SixBit can update the listings as well during the import by checking Update Running Listings; this will require SixBit to make a call for each running listing updated and will make the import perform a little more slowly.

  1. If you specified pictures in your import, you can Replace Existing Pictures by checking the box.  By leaving this option unchecked, the pictures will be added to any existing items.
  2. Pictures can be imported as images that will be hosted on your own or merely URL's that your listings will point to.  Click Import URL's as Links if you just want to store the URL for the listing to point to.
  3. When finished, click the OK to begin the import.

 

Importing vs. Updating

The import of a XML file can actually be handled as either a straight import or as an update to existing data or both at the same time.   Importing is useful to populate your database with new data, but it can also be useful to update existing data.  For example, if you have an empty database and your supplier sends you a flat file of 20,000 items that you want input into SixBit.  You can perform an import and SixBit will add the 20,000 records.  Now, suppose that each month, your supplier sends you an updated list; it may have a few extra items added or it may have fixed some spelling errors in some titles or even updated the description or MSRP.  In this case, you have several choices as to how the import will behave.  The Add and Update Records option would update any existing records found and add any new ones that were not already in the database.  If no more new records were desired, the Update Records option would perform an update on any records found, but will not add any new records.   Finally, Add Records will only add any new records that are found and will not update any existing records.   

 

Whenever you import from a CSV file, SixBit will first look to see if the record you are importing has the same unique identifier as one that is already in the database. Unique identifiers are fields like ItemID, SKU, SupplierID, OrderID, ExternalOrderID, BuyerID, BuyerEmail, etc.  Basically, any field that can uniquely identify a record as being different than all other records of the same type.   If SixBit finds a unique identifier match, it just updates the other fields on the existing record.  When a data type has more than one unique identifiers, it will look for other identifiers in succession.  For example, on an Items import, if an ItemID is not provided, then it looks ExternalItemID then SKU, and if a SKU is not provided, it looks for an existing ProductID.  If none of those fields are provided or found in the database, then the imported record will be added as a new record.

ID's vs. Names

SixBit keeps track of some fields by use of an internal numeric identifier in addition to a human readable name.  Many fields can be entered through either an ID or a Name.  For example, each Origin Template has a name, but internally SixBit also keeps track of it by a number.  When importing from a XML file, the Origin Template can be specified by providing the internal numeric identifier to the Origin Template ID field, or by providing the name to the Origin Template Name field.  Any destination field that has an ID/Name pair of input fields works the same way.

 

The internal number is the more reliable identifier since it will never change, however, the name is more common and easier to find.  Users are not expected to know the internal identifiers of a field, but they are exportable.  In scenarios where data is exported, changed, and then reimported, the unique identifiers will be more reliable.

Ordinal IDs

Whenever present, the OrdinalID field is used to specify the order of display in the SixBit interface.  If not provided, the default is the next available number.  If two records have the same ordinalid, the display order cannot be guaranteed.

Special Handling Rules

Details concerning special handling of any particular XML element can be found in the definition for the element in the SixBit API Schema.