Amazon::MWS::XML::Order
Class to handle the xml structures returned by ListOrders and ListOrderItems.
The constructor is meant to be called by Amazon::MWS::Uploader when get_orders is called. A list of objects of this class will be returned.
get_orders
my $order = Amazon::MWS::XML::Order->new(order => $struct, orderline => \@struct); my @items = $order->items; print $order->order_number, $order->amazon_order_number;
They should be passed to the constructor and are complex structures parsed from the output of Amazon::MWS::Client.
It should be the output of ListOrders or GetOrder without the root, e.g. $response-{Orders}->{Order}->[0]>
ListOrders
GetOrder
$response-
Field description:
http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
It should be the output of ListOrderItems without the root, like $response-{OrderItems}->{OrderItem}>.
ListOrderItems
If you want to save API calls, instead of initialize the orderline, you may want to pass a subroutine (which will accept no arguments, so it should be a closure) to the constructor instead, which will be called lazily if the object needs to access the orderline.
Our order ID.
Shipping address as Amazon::MWS::Client::Address object.
Amazon::MWS::Client::Address
They are mostly shortcuts to retrieve the correct information.
The Amazon order id.
Same as amazon_order_number
amazon_order_number
Buyer's email
An Amazon::MWS::XML::Address object with the shipping address.
Buyer's first name (built lazily using euristics).
Buyer's last_name (built lazily using euristics)
Return a list of Amazon::MWS::XML::OrderlineItem objects with the ordered items.
Return a DateTime object with th purchase date.
The total shipping cost, built summing up the shipping cost of each item.
The subtotal of the order, built summing up the subtotal of each orderline's item.
Total number of items ordered.
Return OrderTotal.Amount. Throws an exception if it doesn't match shipping_cost + subtotal.
The currency of the order. Looked up in OrderTotal.CurrencyCode.
Return an hashref suitable to build an order ack feed.
If the order was acknowlegded, we should find our order number in this method (read-only, use the order_number setter if you need to ackwnoledge.
order_number
Return true if the order is marked as shipped by Amazon
Shortcut to orders' OrderStatus
Return false if the status is Pending or Canceled.
Returns amazon
amazon
Returns an empty string.
Always returns Amazon
Amazon
Returns the generic ShipmentServiceLevelCategory (not the ShipServiceLevel which is a non-typed string).
http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_Datatypes.html
Available values:
Or the empty string if nothing is found.
To install Amazon::MWS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amazon::MWS
CPAN shell
perl -MCPAN -e shell install Amazon::MWS
For more information on module installation, please visit the detailed CPAN module installation guide.