title: Error in updating item quantity on Amazon using API
body: <p>I have read much documentation on the Amazon API and am still not clear on the error I am receiving, the documentation does not provide helpful examples.</p>
  
  <p>I am using this to update my inventoy:</p>
  
  <p>I have read different documents, each stating a new service url, and I am really confused about that..</p>
  
  <pre><code>config.ServiceURL = "https://mws.amazonservices.co.uk/FulfillmentInventory/2011-10-01";
  config.ServiceURL = "https://secure.amazon.co.uk/exec/panama/seller-admin/catalog-upload/modify-only";
  </code></pre>
  
  <p>My code to start the process and send request is:</p>
  
  <pre><code>String accessKeyId = "#";
  String secretAccessKey = "#";
  String merchantId = "#";
  String marketplaceId = "#";
  
  MemoryStream stream = new MemoryStream();
  stream = GenerateInventoryDocument(txtxSku.Text, merchantId, txtQuantity.Text);
  
  const string applicationName = "C#";
  const string applicationVersion = "4";
  
  MarketplaceWebServiceConfig config = new MarketplaceWebServiceConfig();
  
  MarketplaceWebService.MarketplaceWebService service = new MarketplaceWebServiceClient(accessKeyId, secretAccessKey, applicationName, applicationVersion, config);
  MarketplaceWebService.Model.SubmitFeedResponse response = new MarketplaceWebService.Model.SubmitFeedResponse();
  
  MarketplaceWebService.Model.SubmitFeedRequest request = new MarketplaceWebService.Model.SubmitFeedRequest();
  request.Merchant = merchantId;
  request.MarketplaceIdList = new MarketplaceWebService.Model.IdList();
  request.MarketplaceIdList.Id = new List&lt;string&gt;(new string[] { marketplaceId });
  
  request.FeedContent = stream;
  request.ContentMD5 = MarketplaceWebServiceClient.CalculateContentMD5(request.FeedContent);
  request.FeedContent.Position = 0;
  
  request.FeedType = "_POST_INVENTORY_AVAILABILITY_DATA_";
  
  SubmitFeedSample.InvokeSubmitFeed(service, request);
  </code></pre>
  
  <p>The <code>GenerateInventoryDocument()</code> function is :</p>
  
  <pre><code>MemoryStream myDocument = new MemoryStream();
  string myString;
  
  //Add the document header.
  myString = "&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;AmazonEnvelope xsi:noNamespaceSchemaLocation=\"amzn-envelope.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;Header&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;DocumentVersion&gt;1.01&lt;/DocumentVersion&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;MerchantIdentifier&gt;" + merchantID + "&lt;/MerchantIdentifier&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;/Header&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;MessageType&gt;Inventory&lt;/MessageType&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;Message&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;MessageID&gt;1&lt;/MessageID&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;OperationType&gt;Update&lt;/OperationType&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;Inventory&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;SKU&gt;" + sku + "&lt;/SKU&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;FulfillmentLatency&gt;1&lt;/FulfillmentLatency&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;Quantity&gt;" + quantity + "&lt;/Quantity&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;/Inventory&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;/Message&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  myString = "&lt;/AmazonEnvelope&gt;";
  this.AddStringToStream(ref myString, myDocument);
  
  return myDocument;
  </code></pre>
  
  <p>When I use this URL:</p>
  
  <pre><code>config.ServiceURL = "https://mws.amazonservices.co.uk/FulfillmentInventory/2011-10-01";
  </code></pre>
  
  <p>I get the following error response:</p>
  
  <pre><code>&lt;ErrorResponse xmlns="http://mws.amazonaws.com/FulfillmentInventory/2011-10-01/"&gt; 
      &lt;Error&gt;
         &lt;Type&gt;Sender&lt;/Type&gt;
         &lt;Code&gt;NoSuchVersion&lt;/Code&gt;
         &lt;Message&gt;The requested version ( 2010-01-01 ) is not valid.&lt;/Message&gt;
         &lt;Detail/&gt;
      &lt;/Error&gt;
      &lt;RequestID&gt;f35d1eb0-b8e7-40c0-8394-027619fb0762&lt;/RequestID&gt;
  &lt;/ErrorResponse&gt;
  </code></pre>
  
  <p>And when I use this service URL that I read on another doc:</p>
  
  <pre><code>config.ServiceURL = "https://secure.amazon.co.uk/exec/panama/seller-admin/catalog-upload/modify-only";
  </code></pre>
  
  <p>I get the following error response:</p>
  
  <pre><code>&lt;BusinessLogicError&gt;CUSTOMER_UNAUTHORIZED&lt;/BusinessLogicError&gt;
  </code></pre>
  
  <p>Please let me know if there is something wrong in this code, as I am totally following the documents, also it's been the 3rd day I have spent on this.  Maybe I am losing my mind :D</p>
  
  <p>These are small issues and I can't figure them out.</p>