Saturday, January 17, 2009

Posting XML Files with the Amazon Merchant Transport Utility

Since I've done a bunch of XML integrations with Amazon Storefronts lately (utilizing the Amazon Merchant Transport Utility), I thought it would be helpful to share some information to help others get through the process.

AMTU Overview

From SourceForge.net, "The Amazon Merchant Transport Utility (AMTU) is a java-based utility designed to make posting files and receiving reports from Amazon's Merchants Interface as simple as dragging and dropping files into a directory." You can download AMTU from SourceForge.net by clicking here.

This article deals with my experience using AMTU on a Windows platform, but things should work similarly on other Operating Systems.

By default, when you install AMTU it is installed to "C:\Amazon\MerchantTransport\". Within that directory, there are a lot of sub-directories and files installed as well. The directories that we will be concerned about in this article are located in the "\DocumentTransport\production\" sub-directory. The directories are:
  • failed
  • outgoing
  • processingreports
  • reports
  • sent
  • temp
When posting files, you really only need to pay attention to the "failed", "outgoing", "processingreports" and "sent" directories.

Posting to AMTU

To post files to Amazon via AMTU, you will need to place the files into the "outgoing" directory. AMTU monitors the "outgoing" folder to determine if there are files that need to be uploaded to Amazon.

When files are found in the "outgoing" directory, AMTU uploads the files to Amazon and then moves the files to the "sent" directory. One thing to note, when AMTU moves the files to the "sent" directory, the file name is changed slightly. A unique identifier (the DocumentTransactionID) is placed at the end of the file name (i.e. MyUpload.xml.2150723562).

Once Amazon finishes processing the uploaded files, a new file is created in the "processingreports" directory for each of the posted files. The name of the files will contain the DocumentTransactionID that was attached to the sent file name (i.e. PROCESSING2150723562.xml). This is how you can determine which uploaded file is associated with the processed file without having to open the file and look at the contents.

Sometimes, files will show up in the "failed" directory. That can happen for a number of reasons (lost connection, timeout, etc...). Those files will need to be re-posted again at another time.

In a nutshell, that is all you need to know about posting XML files to Amazon via AMTU.

In my next post, I will talk about how to monitor the files during the AMTU posting process and building in automatic notification capabilities.

About the Author: Mike Bernhardt is the President and Co-Founder of Madison, Wisconsin based Dane Solutions. Dane Solutions is a software development company specializing in custom software development and .NET consulting.

Welcome to our Blog

Welcome to the official blog of Dane Solutions. We intend to use this blog to post corporate news, programming advice and various other topics.