Reputation: 1439
I am using Amazon's MWS to submit a product inventory but it doesn't seem to be working despite saying it has.
I use "SubmitFeed" to submit my test feed XML, which I've pasted below;
<?xml version="1.0" encoding="UTF-8 "?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>A1BJ5TNE5I3MUD</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>true</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Insert</OperationType>
<Product>
<SKU>56789</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B0EXAMPLEG</Value>
</StandardProductID>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<DescriptionData>
<Title>Example Product Title</Title>
<Brand>Example Product Brand</Brand>
<Description>This is an example product description.</Description>
<BulletPoint>Example Bullet Point 1</BulletPoint>
<BulletPoint>Example Bullet Point 2</BulletPoint>
<MSRP currency="USD">99.99</MSRP>
<Manufacturer>Example Product Manufacturer</Manufacturer>
<ItemType>example-item-type</ItemType>
</DescriptionData>
<ProductData>
<Health>
<ProductType>
<HealthMisc>
<Ingredients>Example Ingredients</Ingredients>
<Directions>Example Directions</Directions>
</HealthMisc>
</ProductType>
</Health>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
This seems to work OK, it returns the "FeedSubmissionId" etc...
<?xml version="1.0"?>
<SubmitFeedResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<SubmitFeedResult>
<FeedSubmissionInfo>
<FeedSubmissionId>3008008200</FeedSubmissionId>
<FeedType>_POST_PRODUCT_DATA_</FeedType>
<SubmittedDate>2012-03-29T11:12:04+00:00</SubmittedDate>
<FeedProcessingStatus>_SUBMITTED_</FeedProcessingStatus>
</FeedSubmissionInfo>
</SubmitFeedResult>
<ResponseMetadata>
<RequestId>9ff22ff1-e86b-45a1-b1ce-4b873f45e90a</RequestId>
</ResponseMetadata>
</SubmitFeedResponse>
I then check the status of the feed submission using "GetFeedSubmissionList" and it returns "DONE"....
<?xml version="1.0"?>
<GetFeedSubmissionListResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<GetFeedSubmissionListResult>
<NextToken />
<HasNext>false</HasNext>
<FeedSubmissionInfo>
<FeedSubmissionId>3008008200</FeedSubmissionId>
<FeedType>_POST_PRODUCT_DATA_</FeedType>
<SubmittedDate>2012-03-29T11:12:04+00:00</SubmittedDate>
<FeedProcessingStatus>_DONE_</FeedProcessingStatus>
<StartedProcessingDate>2012-03-29T11:12:13+00:00</StartedProcessingDate>
<CompletedProcessingDate>2012-03-29T11:12:33+00:00</CompletedProcessingDate>
</FeedSubmissionInfo>
</GetFeedSubmissionListResult>
<ResponseMetadata>
<RequestId>4afd9b3d-33c6-4c15-bbe1-51304dc1cd24</RequestId>
</ResponseMetadata>
</GetFeedSubmissionListResponse>
But when I login to sellers central and check out the inventory, the test product isn't there. I can't seem to find it anywhere - so where exactly is it submitting to? I've definitely not got any of the merchant id's mixed up - because I'm doing it all through the same account, authorising the developer account to use the seller account etc.
Is there something I'm not doing correctly? Do I need to do call another function to commit the data or something?
It's really frustrating because Amazon's documentation sucks so bad. I've actually come this far thanks to Stackoverflow and random blog posts out there.
Upvotes: 4
Views: 4872
Reputation: 1775
Try to look into result like I did. After sending request you can look into file.xml there will be some errors
/**
* PHP Version 5
*
* @category Amazon
* @package MarketplaceWebService
* @copyright Copyright 2009 Amazon Technologies, Inc.
* @link http://aws.amazon.com
* @license http://aws.amazon.com/apache2.0 Apache License, Version 2.0
* @version 2009-01-01
*/
/*******************************************************************************
* Marketplace Web Service PHP5 Library
* Generated: Thu May 07 13:07:36 PDT 2009
*
*/
/**
* Get Feed Submission Result Sample
*/
include_once('MarketplaceWebService/Samples/.config.inc.php');
/************************************************************************
* Uncomment to configure the client instance. Configuration settings
* are:
*
* - MWS endpoint URL
* - Proxy host and port.
* - MaxErrorRetry.
***********************************************************************/
// IMPORTANT: Uncomment the appropriate line for the country you wish to
// sell in:
// United States:
$serviceUrl = "https://mws.amazonservices.com";
// United Kingdom
//$serviceUrl = "https://mws.amazonservices.co.uk";
// Germany
//$serviceUrl = "https://mws.amazonservices.de";
// France
//$serviceUrl = "https://mws.amazonservices.fr";
// Italy
//$serviceUrl = "https://mws.amazonservices.it";
// Japan
//$serviceUrl = "https://mws.amazonservices.jp";
// China
//$serviceUrl = "https://mws.amazonservices.com.cn";
// Canada
//$serviceUrl = "https://mws.amazonservices.ca";
// India
//$serviceUrl = "https://mws.amazonservices.in";
$config = array (
'ServiceURL' => $serviceUrl,
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3,
);
/************************************************************************
* Instantiate Implementation of MarketplaceWebService
*
* AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY constants
* are defined in the .config.inc.php located in the same
* directory as this sample
***********************************************************************/
$service = new MarketplaceWebService_Client(
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY,
$config,
APPLICATION_NAME,
APPLICATION_VERSION);
/************************************************************************
* Uncomment to try out Mock Service that simulates MarketplaceWebService
* responses without calling MarketplaceWebService service.
*
* Responses are loaded from local XML files. You can tweak XML files to
* experiment with various outputs during development
*
* XML files available under MarketplaceWebService/Mock tree
*
***********************************************************************/
// $service = new MarketplaceWebService_Mock();
/************************************************************************
* Setup request parameters and uncomment invoke to try out
* sample for Get Feed Submission Result Action
***********************************************************************/
// @TODO: set request. Action can be passed as MarketplaceWebService_Model_GetFeedSubmissionResultRequest
// object or array of parameters
/*$parameters = array (
'Merchant' => MERCHANT_ID,
'FeedSubmissionId' => 'xxxxxx',
'FeedSubmissionResult' => @fopen('php://memory', 'rw+'),
);
$request = new MarketplaceWebService_Model_GetFeedSubmissionResultRequest($parameters);*/
$filename = __DIR__.'/file.xml';
$handle = fopen($filename, 'w+');
$request = new MarketplaceWebService_Model_GetFeedSubmissionResultRequest();
$request->setMerchant(MERCHANT_ID);
$request->setFeedSubmissionId('7763576008');
$request->setFeedSubmissionResult($handle);
try {
$response = $service->getFeedSubmissionResult($request);
fclose($handle);
echo ("Service Response\n");
echo ("=============================================================================\n");
echo(" GetFeedSubmissionResultResponse\n");
if ($response->isSetGetFeedSubmissionResultResult()) {
$getFeedSubmissionResultResult = $response->getGetFeedSubmissionResultResult();
echo (" GetFeedSubmissionResult");
if ($getFeedSubmissionResultResult->isSetContentMd5()) {
echo (" ContentMd5");
echo (" " . $getFeedSubmissionResultResult->getContentMd5() . "\n");
}
}
if ($response->isSetResponseMetadata()) {
echo(" ResponseMetadata\n");
$responseMetadata = $response->getResponseMetadata();
if ($responseMetadata->isSetRequestId())
{
echo(" RequestId\n");
echo(" " . $responseMetadata->getRequestId() . "\n");
}
}
echo(" ResponseHeaderMetadata: " . $response->getResponseHeaderMetadata() . "\n");
} catch (MarketplaceWebService_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "\n");
echo("Response Status Code: " . $ex->getStatusCode() . "\n");
echo("Error Code: " . $ex->getErrorCode() . "\n");
echo("Error Type: " . $ex->getErrorType() . "\n");
echo("Request ID: " . $ex->getRequestId() . "\n");
echo("XML: " . $ex->getXML() . "\n");
echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n");
}
Upvotes: 0
Reputation: 108
You do need to change a few things within this feed but it's just a starting point.
First ....
<PurgeAndReplace>false</PurgeAndReplace> // unless you want to delete all other inventory
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType> //instead of insert
Next ... only use this next section if you know the exact ASIN you want to map the SKU to.
<StandardProductID>
<Type>ASIN</Type>
<Value>B0EXAMPLEG</Value>
</StandardProductID>
Then ... verify that the upload was successful. 'DONE' is not the same thing. You need to do a GetFeedSubmissionResult, which is a file download, and check the contents for
<ProcessingSummary>
<MessagesProcessed>1</MessagesProcessed>
<MessagesSuccessful>1</MessagesSuccessful>
<MessagesWithError>0</MessagesWithError>
<MessagesWithWarning>0</MessagesWithWarning>
</ProcessingSummary>
AND MOST IMPORTANTLY ...... Unlike doing a flat file upload when using the XML and doing just the Product Feed it does not create a listing.
You must also do an Inventory (with quantity) and a Price Feed in order to create an Offer Listing viewable through your seller central page.
Upvotes: 4
Reputation: 2528
The XML looks fine, have you tried to add the RBN to the item? Also set PurgeAndReplace to false, and the OperationType to Update (as mentioned above).
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>AMZ ID</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>ABFOB.12YOV1</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B001P4WGQ6</Value>
</StandardProductID>
<LaunchDate>2012-06-18T04:59:29+01:00</LaunchDate>
<DescriptionData>
<Title>Aberfeldy 12 Year Old / 70cl</Title>
<Brand>Aberfeldy</Brand>
<Description>An award winning Eastern Highland malt that was almost unknown until it was bought by Bacardi in 1998, Aberfeldy's main claim to fame is as the heart of the excellent Dewar's blend. Clean and polished malt with a touch of honey and spice. Web-Exclusive Price!</Description>
<BulletPoint>12 Years Old</BulletPoint>
<BulletPoint>Bottled by Distillery Bottling</BulletPoint>
<PackageWeight unitOfMeasure="KG">1.50</PackageWeight>
<Manufacturer>Aberfeldy</Manufacturer>
<ItemType>AlcoholicBeverages</ItemType>
<RecommendedBrowseNode>359893031</RecommendedBrowseNode>
</DescriptionData>
<ProductData>
<FoodAndBeverages>
<ProductType>
<AlcoholicBeverages>
<CountryProducedIn>Scotland</CountryProducedIn>
<RegionOfOrigin>Highland</RegionOfOrigin>
<AlcoholContent unitOfMeasure="percent_by_volume">40.00</AlcoholContent>
</AlcoholicBeverages>
</ProductType>
</FoodAndBeverages>
</ProductData>
</Product>
</Message>
Above is just a sample of my XML i am posting. See if this help, hopefully it does!
I agree with everyone else that the API is a complete mess, and a nightmare to use. I have found myself banging my head against a wall a number of times, however that said when it works, it does work very well :)
Upvotes: 1
Reputation: 46
I agree the documentation needs more work. Your XML looks alright, although I use an OperationType of "Update".
The download report is done (DONE) so you just need to download the error report using GetFeedSubmissionResultRequest(), which returns a report as a stream of data. With Amazon submissions its a three stage process, Upload, Status and then Download. So you will need to check if your submission had an error.
In seller central there is an upload area where your requests will be shown. This is located in Invetory > Upload Products and Inventory. Hope this helps as I am using the UK version.
Upvotes: 1
Reputation: 7752
I'm not familiar with uploading data using the XML format but from the Guide to XML on pg 35 (Manage Listings with XML) it has two fields listed that you are missing:
Launch Date: Controls when the product appears in search and browse on the Amazon website
Release Date: The date a product is released for sale
I'm wondering if the item would appear in your inventory report without an Open Date even though it doesn't show up anywhere else. Since you didn't specify either of these fields it's conceivable that the item is listed in your inventory (in the inventory report) but isn't visible to buyers.
Upvotes: 1