Link to home
Start Free TrialLog in
Avatar of eg252
eg252

asked on

send xml to amazon using vba

Does anyone know how to use this xml? I want to use vba to update amazon with a tracking number.. I found this - and I registered with amazon - but i'm pretty clueless as to how to proceed...

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amznenvelope.
xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>My Store</MerchantIdentifier>
</Header>
<MessageType>OrderFulfillment</MessageType>
<Message>
<MessageID>1</MessageID>
<OrderFulfillment>
<MerchantOrderID>1234567</MerchantOrderID>
<MerchantFulfillmentID>1234567</MerchantFulfillmentID>
<FulfillmentDate>2002-05-01T15:36:33-08:00</FulfillmentDate>
<FulfillmentData>
<CarrierCode>UPS</CarrierCode>
<ShippingMethod>Second Day</ShippingMethod>
<ShipperTrackingNumber>1234567890</ShipperTrackingNumber>
</FulfillmentData>
<Item>
<MerchantOrderItemID>1234567</MerchantOrderItemID>
<MerchantFulfillmentItemID>1234567</MerchantFulfillmentItemID>
<Quantity>2</Quantity>
</Item>
</OrderFulfillment>
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Amazon should have some docs/examples on the way in which they want you to talk to the system.   Normally, you use SOAP or WDSL, and then talk to the web site with RESTful or simply the http POST/GET (example below).

What is it exactly your trying to do?  I should be able to get you going in the right direction at least.

Jim.

                  ' Set the correct URL
                  'strPostURL = "https://test.authorize.net/gateway/transact.dll"
110               strPostURL = "https://secure.authorize.net/gateway/transact.dll"
                  'strPostURL = "https://developer.authorize.net/tools/paramdump/index.php"

120               strPostSting = ""
125        strPostSting = strPostSting & "x_login=" & URLEncode(strAPILogin) & "&"
126       strPostSting = strPostSting & "x_tran_key=" & URLEncode(strTransactionKey) & "&"
                  'For debugging.
                  'strPostSting = strPostSting & "x_test_request=" & URLEncode("TRUE") & "&"
130               strPostSting = strPostSting & "x_version=" & URLEncode("3.1") & "&"
140               strPostSting = strPostSting & "x_delim_data=" & URLEncode("TRUE") & "&"
150               strPostSting = strPostSting & "x_delim_char=" & URLEncode("|") & "&"
160               strPostSting = strPostSting & "x_relay_response=" & URLEncode("FALSE") & "&"
170               strPostSting = strPostSting & "x_email_customer=" & URLEncode("FALSE") & "&"

180               strPostSting = strPostSting & "x_type=" & URLEncode("PRIOR_AUTH_CAPTURE") & "&"
190               strPostSting = strPostSting & "x_trans_id=" & URLEncode(rs!CCTransactionID) & "&"

                  ' Additional fields can be added here as outlined in the AIM integration
                  ' guide at: http://developer.authorize.net
200               strPostSting = left(strPostSting, Len(strPostSting) - 1)

                  ' We use xmlHTTP to submit the input values and record the response
                  Dim objRequest As New MSXML2.XMLHTTP
210               objRequest.Open "POST", strPostURL, False
220               objRequest.Send strPostSting
230               strPostResponse = objRequest.responseText
                  'Debug.Print strPostResponse
240               Set objRequest = Nothing
Avatar of eg252
eg252

ASKER

Thank you for responding.
i need very specifically AMAZON xml help..
I need to know if anyone did Amazon XML in vba..  I need the url of where to post and a small sample so I can get started..
Have you looked at Amazon's documentation here:

Amazon Marketplace Web Service (Amazon MWS) Documentation
 https://developer.amazonservices.com/gp/mws/docs.html/189-7490411-2657469

and also:

Amazon MWS Scratchpad
https://mws.amazonservices.com/scratchpad/index.html
Are you using the Marketplace Web Service or doing something else with Amazon?

XML is just the data that get's sent received, not how.   You could for example be working with EDI and XML.

That's why I asked exactly what it was you were doing.

So far, we don't have enough info to help you.

Jim.
Avatar of eg252

ASKER

All I'm tryring to do is to update Amazon with a tracking number for an order.. I'm working on this for hours and hours.. I finally got to the point where I figured out signatures and I got the xml and url.. Now I'm stuck because the md5 doesnt match.. and I'm trying to figure out the md5. I will post the code when I'm done - but right now I want to STILL know if anyone has successfully updated amazon with a tracking number from access...
<<but right now I want to STILL know if anyone has successfully updated amazon with a tracking number from access... >>

 There's no reason you can't and it seems what HiTechCoach pointed you to is what your working with.   I saw a section in there on MD5 and what to do.

 I also have MD5 code here somewhere...

 Jim.
Avatar of eg252

ASKER

thank you. i saw the scratchpad AND the documentation page. I tried 5 or 6 md5 modules and still cannot match..
I'm attaching my xml - this is the md5 that Amazon wants..

XadsJ9m+KfWBFE5TygQGdg==

All the modules I tried did NOT get that answer....

Thank you all for trying!
testing.txt
For the XML that you posted, does that match the entire string that Scratch pad returned as the "String to sign" value?

Jim.
The digest I get on your XML is:

8c12b32fe838087cec694733327546c8

 so I'm thinking what Amazon is calculating on is not what you posted.   So far, I haven't known this MD5 code to have a problem (haven't used it a ton though).

Jim.
ASKER CERTIFIED SOLUTION
Avatar of eg252
eg252

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very nice...glad to here you've got it working.

Thanks for coming back and posting that.

Jim.
Avatar of eg252

ASKER

this works