I had developed an application years ago that submit tracking info back at Amazon via the SubmitFeed API using the POST_ORDER_FULFILLMENT_DATA feed type. All is well for the past few years until it just stops working today. I had checked the response and this is what it returned:
HTTP/1.1 400 Bad Request
<message>Invalid query string provided - Keys may not contain &lt;</message>
I come up with a solution to add ‘Content-Type:text/xml’ in the request. This header should be included with the ‘Content-MD5: [MD5 HASH here]’ header and should be passed into Amazon as an array.
Here is how you properly MD5 plus base64_encode the header for Amazon MWS:
$feed_md5 = base64_encode(md5($feed_content,true));
Here is how you pass the headers into an array:
$headers = array("Content-MD5:". $feed_md5, 'Content-Type:text/xml');
Script works normally after performing these steps.