Amazon Inventory

newton981

New member
Local time
Today, 19:50
Joined
Jan 2, 2014
Messages
3
I have a large database of items we sell on Amazon, I am looking to automate the process of uploading the inventory.

I am uploading a tab delimeted text file using the following code,

With CreateObject("msxml2.xmlhttp")
.Open "POST", strURL, False

.setRequestHeader "Host:", "mws.amazonservices.co.uk"
.setRequestHeader "User-Agent:", "VBA"
.setRequestHeader "Content-MD5:", md5hdr2
.setRequestHeader "Content-Type:", "text"

.send c2a

Forms!Form1.Text3.value = .responseText
End With

I am confident I have the signature and the MD5 Header, but I cannot get the data into Amazon!

I keep getting a non-descript error "InputDataError".

When debugging my Play API, I was told that the "send" command was not uploading the file contents, it was uploading the filename! So c2a is a string variable that contains the tab delimited data. This works like a charm for Play, but no joy for Amazon.

I have read and printed most of the Amazon Reference guides, they offer little or no help for this VBA issue.

I am convinced I have made a basic error, this field of VBA is new to me, so please be gentle!

Any help would be greatly appreciated.
 
When debugging my Play API, I was told that the "send" command was not uploading the file contents, it was uploading the filename!
What was the filename name and extension (and which filename)?
 
... and how you construct c2a ?
Are you sure that c2a really contain that tab delimited data ?
Show us the statement(s) that fill c2a with data.
 
jdraw, thank you for the link, I have read that before, one thing I should have mentioned is that I have been manually uploading and downloading inventory and sales reports for some years, so I am more than familiar with the layout of the file and know my files work when uploaded manually.

Mihail, Thanks for replying, I am sure that c2a contains the necessary formatting as I have outputted it to a text file before now to double check.
I build it very simply,
c2a = "sku" & Chr(9) & "product-id" & Chr(9) & "product-id-type" & Chr(9) & "price" & Chr(9) & "item-condition" & Chr(9) & "quantity" & Chr(9) & "add-delete" & Chr(9) & "will-ship-internationally" & Chr(9) & "expedited-shipping" & Chr(9) & "item-note" & Chr(9) & "fulfillment-center-id" & Chr(13)
c2a = c2a & "XYZ555" & Chr(9) & "0099923842927" & Chr(9) & "3" & Chr(9) & "500" & Chr(9) & "11" & Chr(9) & "1" & Chr(9) & "a" & Chr(9) & "6" & Chr(9) & Chr(9) & "NEW" & Chr(9) & "DEFAULT" & Chr(13)

The feed type I am specifying is "_POST_FLAT_FILE_LISTINGS_DATA_" which according to the Amazon literature is the correct feed type for tab delimited files.

Thanks again gentlemen for your help,
 

Users who are viewing this thread

Back
Top Bottom