0

I am familier with Amazon MWS and have used Report,Feed and Product API in past, now i want to upload TSV order file to ship all those orders in my amazon seller central's account. Please can anyone tell me what feed type should i use and what is the structure of the feed which i have to submit. Thank you in advance.

aynber
  • 22,380
  • 8
  • 50
  • 63
Keyur Padalia
  • 2,077
  • 3
  • 28
  • 55

2 Answers2

1

The FeedType for your request would be _POST_FLAT_FILE_FULFILLMENT_DATA_ for flat file submission.

You can find all FeedType values in this document: MWS Developer Guide (Version 2009-01-01) (Page 93)

Hazzit
  • 6,782
  • 1
  • 27
  • 46
  • Could either of you elaborate on how you actually sent the file? looking in the PHP client lib, there is only the confirmShipment() method which accepts an XML file. Furthermore, if you extend the FeedsClient and try to write your own confirmShipmentFlatFile() method you can't make use of the submitFeed() method or the invokeSubmitFeed() method since they're private! Is the only option to add it to the FeedsClient class directly and hope that when Amazon brings out a new version, you remember to add your method back in? – neilcrookes Oct 29 '13 at 17:36
  • I've not used Amazon's library, but used my own code. I also use XML whenever I can, so I'm not sure I can help there. I'd probably just change the "private" to "public" once I was sure there was no existing function wrapping it. An update to the library will then create a PHP error, which is easy to locate. – Hazzit Oct 31 '13 at 01:28
  • Thanks. I ended up adding the method to the client library, see the answer below. Screw updating! – neilcrookes Oct 31 '13 at 13:46
0

Adding the code I added to the client library here so it's more readable than in the comment above:

//MWSFeedsClient.php

/**
 * Submits the given flat file shipping feed and returns a feed submission id
 *
 * @param string Path to the flat file shipping feed
 * @return string Feed submission id
 */
public function confirmShipmentFlatFile($feedFilePath)
{
    $feedHandle = @fopen($feedFilePath,"r");

    //Computing the MD5 hash
    $contentMD5Header = base64_encode(md5(stream_get_contents($feedHandle), true));
    rewind($feedHandle);

    //Submit the Order Fulfillment feed
    return $this->submitFeed(MarketplaceWebService_Model_FeedType::POST_FLAT_FILE_FULFILLMENT_DATA, $feedHandle, $contentMD5Header);
}
neilcrookes
  • 4,203
  • 2
  • 21
  • 27