SOAP::Amazon::MerchantTransport - An easy to connect to Amazon Merchant Services
Version 0.02 $Id: MerchantTransport.pm,v 1.1 2006/01/30 17:58:42 nathan Exp $
This module provides a simple way to access Amazon's Merchant Services via SOAP. It is based on SOAP::Lite.
use SOAP::Amazon::MerchantTransport; my $a = SOAP::Amazon::MerchantTransport->new( merchantname => 'Bill Shop', merchant => 'Q_M_FOOBAR_1234', username => 'firstname.lastname@example.org', password => 'SDNDJNDNFJDJ', url => 'https://merchant-api-qa.amazon.com/foobar/' ); $som = $a->getAllPendingDocumentInfo($doctype); $som = $a->getDocument($documentID); $som = $a->postDocument($requesttype, $document); $som = $a->postDocumentDownloadAck(@documentIdentifiers)
All of these methods, by default return a SOAP::SOM Object unless you specify a handler for the return values.
NOTE: It is possible to write your own handlers to return a different object, but no such modules have been created at the time of this writing. Therefore the documentation will always refer to the return value of the get/post documents as being a SOAP::SOM, but obviously if you specify a handler the return object will be different.
If you want to debug, simply import SOAP::Lite with debugging options on into your script. This has the global effect of turning debugging on. e.g.
use SOAP::Lite +trace => [qw( debug )];
This module is to ease the submission of XML Feeds to Amazon.
This module does not write your Amazon XML Feeds, it only simplifies the submission of those feeds. If you need help writing the Amazon XML Feeds for pricing, inventory, orders, etc. view the sample feeds in the Amazon Documentation. Contact your integration manager for access to these.
Creating a new MerchantTransport object is easy: my $a = SOAP::Amazon::MerchantTransport->new( merchantname => 'Bill Shop', merchant => 'Q_M_FOOBAR_1234', username => 'email@example.com', password => 'SDNDJNDNFJDJ', url => 'https://merchant-api-qa.amazon.com/foobar/' );
All of these parameters are required.
If you want the response to be something other than an SOAP::SOM object you can pass in the qualified name of the module you want to use as the return values. e.g. ... handler => 'SOAP::Amazon::MSReturnVal', ... This module is currently ficticious. See "Writing Your Own Response Handler" for more information.
Given a type of document to retrieve, returns an array of TODO s.
Valid values for the $doctype are:
payments. You can also pass the exact values Amazon calls for:
_GET_PAYMENT_SETTLEMENT_DATA_, but the first method is preferred.
Given the documentTransactionID (given to you by Amazon) returns a SOAP::SOM containing the document.
Given the DocumentID received from getAllPendingDocumentInfo returns the a SOAP::SOM containing the return values.
Given a request type string, local identifier, and an Amazon xml content string returns a SOAP::SOM containing the return values.
Valid Request Types are:
product productRelationship productOverrides productImage productPricing inventoryAvailability testOrders orderAck orderFulfillment paymentAdjustment storeData
$localID is a local identifier. You could try Data::UUID.
$content is a string containing the XML you want to post to Amazon.
If no argument is given it returns the appropriate value. If there is an argument the value is set.
$a->merchantname('Foo Bar Merch'); $a->merchant('Q_M_FOOBAR_1234'); $a->username('firstname.lastname@example.org'); $a->password('raboof'); $a->url('https://merchant-api-qa.amazon.com/whatever/'); my $m = $a->merchant; # $m is now 'Q_M_FOOBAR_1234' etc...
TODO: this feauture is not yet complete.
<nate at natemurray.com>
There are no known bugs as of version 0.2, just a couple incomplete features.
Please report any bugs or feature requests to
bug-soap-amazon-merchantservices at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SOAP-Amazon-MerchantTransport. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2006 Nate Murray, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.