hrhsii
hrhsii

Reputation: 157

Amazon MWS : Errors with new 2013 ListOrders API

I am upgrading my Amazon orders download script from: $serviceUrl = "https://mws-eu.amazonservices.com/Orders/2011-01-01" to $serviceUrl = "https://mws-eu.amazonservices.com/Orders/2013-09-01"

Some of the parameters have changed from arrays to strings.

Using ListOrdersSample.php I am trying to only download Unshipped and PartiallyShipped orders but I am having difficulty formatting the variable.

In the scratchpad I see:

OrderStatus.Status.1=Unshipped OrderStatus.Status.2=PartiallyShipped

I have tried:

//$orderStatuses='OrderStatus.Status.1=Unshipped,OrderStatus.Status.2=PartiallyShipped';
// $orderStatuses='Unshipped:PartiallyShipped';
// $orderStatuses='Unshipped&PartiallyShipped';
// $orderStatuses= (array("Unshipped", "PartiallyShipped"));
$orderStatuses='Unshipped';
$request->setOrderStatus($orderStatuses);

All versions of separators seem to fail with the similar error:

Caught Exception: 1 validation error detected: Value '[Unshipped&PartiallyShipped]' at 'orderStatus' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy enum value set: [Unfulfillable, PartiallyShipped, PendingAvailability, Shipped, Pending, InvoiceUnconfirmed, Canceled, Unshipped]]

The only one to work is the uncommented Unshipped on it's own then I get the error:

Caught Exception: Unshipped and PartiallyShipped should be used together when filtering by OrderStatus. You cannot use one and not the other.

I have a similar problem trying to list multiple marketplaceids.

Any help would be appreciated

Upvotes: 3

Views: 707

Answers (1)

hrhsii
hrhsii

Reputation: 157

I finally got it to work. If anyone is interested, the format for multi item strings is:

$marketplaceIdList=(array('A1F83G8C2ARO7P','A13V1IB3VIYZZH','A1PA6795UKMFR9','APJ6JRA9NG5V4','A1RKKUPIHCS9HS','ATVPDKIKX0DER')); 
$request->setMarketplaceId($marketplaceIdList);

$orderStatuses=(array('Unshipped','PartiallyShipped'));  
$request->setOrderStatus($orderStatuses);

invokeListOrders($service, $request);

Upvotes: 3

Related Questions