Amazon PAS

Product Advertising Service (http://aws.amazon.com/associates)

Version

2009.09.04

Copyright

2006-2010 Ryan Parman, Foleeo, Inc., and contributors.

License

Simplified BSD Licensehttp://opensource.org/licenses/bsd-license.php

See Also

CloudFusionhttp://getcloudfusion.com
Amazon PAShttp://aws.amazon.com/associates

Constants

PAS_LOCALE_US

Locale code for the United States

PAS_LOCALE_UK

Locale code for the United Kingdom

PAS_LOCALE_CANADA

Locale code for Canada

PAS_LOCALE_FRANCE

Locale code for France

PAS_LOCALE_GERMANY

Locale code for Germany

PAS_LOCALE_JAPAN

Locale code for Japan

AmazonPAS

Container for all Amazon PAS-related methods.  Inherits additional methods from CloudFusion.

Extends

CloudFusion

Example Usage

require_once('cloudfusion.class.php');

// Instantiate a new AmazonPAS object using the settings from the config.inc.php file.
$s3 = new AmazonPAS();

// Instantiate a new AmazonPAS object using these specific settings.
$s3 = new AmazonPAS($key, $secret_key, $assoc_id);

Properties

locale

The Amazon locale to use by default.

Functions

__construct()

public function __construct($key =  null,
$secret_key =  null,
$assoc_id =  null)

The constructor

Access

public

Parameters

keystring (Optional) Your Amazon API Key.  If blank, it will look for the AWS_KEY constant.
secret_keystring (Optional) Your Amazon API Secret Key.  If blank, it will look for the AWS_SECRET_KEY constant.
assoc_idstring (Optional) Your Amazon Associates ID.  If blank, it will look for the AWS_ASSOC_ID constant.

Returns

boolean false if no valid values are set, otherwise true.

set_locale()

public function set_locale($locale =  null)

Override the default locale to use for PAS requests.

Access

public

Parameters

localestring (Optional) The locale to use.  Allows PAS_LOCALE_US, PAS_LOCALE_UK, PAS_LOCALE_CANADA, PAS_LOCALE_FRANCE, PAS_LOCALE_GERMANY, PAS_LOCALE_JAPAN

Examples

AmazonPAS::set_locale
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Set a locale and trigger an operation
$pas = new AmazonPAS();
$response = $pas->item_lookup('B002FZL94O', null, PAS_LOCALE_US);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::set_locale
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Set a locale and trigger an operation
$pas = new AmazonPAS();
$pas->set_locale(PAS_LOCALE_US);
$response = $pas->item_lookup('B002FZL94O');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

Returns

void

authenticate()

public function pas_authenticate($action,  
$opt =  null,
$locale =  null)

Construct a URL to request from Amazon, request it, and return a formatted response.

Access

public

Parameters

actionstring (Required) Indicates the action to perform.
optarray (Optional) Associative array of parameters.  See the individual methods for allowed keys.
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Returns

ResponseCore object

browse_node_lookup()

public function browse_node_lookup($browse_node_id,  
$opt =  null,
$locale =  null)

Given a browse node ID, browse_node_lookup() returns the specified browse node’s name, children, and ancestors.  The names and browse node IDs of the children and ancestor browse nodes are also returned.  browse_node_lookup() enables you to traverse the browse node hierarchy to find a browse node.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

browse_node_idinteger (Required) A positive integer assigned by Amazon that uniquely identifies a product category.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘BrowseNodeInfo’ (default), ‘NewReleases’, ‘TopSellers’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('BrowseNodeLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::browse_node_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Browse a node
$pas = new AmazonPAS();
$response = $pas->browse_node_lookup('173429');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::browse_node_lookup with ResponseGroup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Browse a node
$pas = new AmazonPAS();
$response = $pas->browse_node_lookup('173429', array(
	'ResponseGroup' => 'TopSellers'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/BrowseNodeLookup.html

cart_add()

public function cart_add($cart_id,  
$hmac,  
$offer_listing_id,  
$opt =  null,
$locale =  null)

Enables you to add items to an existing remote shopping cart.  cart_add() can only be used to place a new item in a shopping cart.  It cannot be used to increase the quantity of an item already in the cart.  If you would like to increase the quantity of an item that is already in the cart, you must use the cart_modify() operation.

You add an item to a cart by specifying the item’s OfferListingId, or ASIN and ListItemId.  Once in a cart, an item can only be identified by its CartItemId.  That is, an item in a cart cannot be accessed by its ASIN or OfferListingId.  CartItemId is returned by cart_create(), cart_get(), and cart_add().

To add items to a cart, you must specify the cart using the CartId and HMAC values, which are returned by the cart_create() operation.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

cart_idstring (Required) Alphanumeric token returned by cart_create() that identifies a cart.
hmacstring (Required) Encrypted alphanumeric token returned by cart_create() that authorizes access to a cart.
offer_listing_idstring|array (Required) Either a string containing the Offer ID to add, or an associative array where the Offer ID is the key and the quantity is the value.  An offer listing ID is an alphanumeric token that uniquely identifies an item.  Use the OfferListingId instead of an item’s ASIN to add the item to the cart.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MergeCartboolean (Optional) A boolean value that when True specifies that the items in a customer’s remote shopping cart are added to the customer’s Amazon retail shopping cart.  This occurs when the customer elects to purchase the items in their remote shopping cart.  When the value is False the remote shopping cart contents are not added to the retail shopping cart.  Instead, the customer is sent directly to the Order Pipeline when they elect to purchase the items in their cart.  This parameter is valid only in the US locale.  In all other locales, the parameter is invalid but the request behaves as though the value were set to True.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CartAdd', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::cart_add - single item, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_add(
	'valid-cart-id',
	'valid-hmac',
	'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf',
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::cart_add - single item, multiple quantities, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_add(
	'valid-cart-id',
	'valid-hmac',
	array(
		'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 15
	),
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::cart_add - multiple items, multiple quantities, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_add(
	'valid-cart-id',
	'valid-hmac',
	array(
		'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 15,
		'L8gljSEq%2FXqKabPO8rZWrJnKBc1ZOAC5iNhpyITjDo%2FHxJ%2Bqt2oZ01Cx0I%2BgIQziGxUHqhfn0K2wsJziNp4jrA%3D%3D' => 5
	),
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CartAdd.html

cart_clear()

public function cart_clear($cart_id,  
$hmac,  
$opt =  null,
$locale =  null)

Enables you to remove all of the items in a remote shopping cart, including SavedForLater items.  To remove only some of the items in a cart or to reduce the quantity of one or more items, use cart_modify().

To delete all of the items from a remote shopping cart, you must specify the cart using the CartId and HMAC values, which are returned by the cart_create() operation.  A value similar to the HMAC, URLEncodedHMAC, is also returned.  This value is the URL encoded version of the HMAC.  This encoding is necessary because some characters, such as + and /, cannot be included in a URL.  Rather than encoding the HMAC yourself, use the URLEncodedHMAC value for the HMAC parameter.

cart_clear() does not work after the customer has used the PurchaseURL to either purchase the items or merge them with the items in their Amazon cart.  Carts exist even though they have been emptied.  The lifespan of a cart is 7 days since the last time it was acted upon.  For example, if a cart created 6 days ago is modified, the cart lifespan is reset to 7 days.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

cart_idstring (Required) Alphanumeric token returned by cart_create() that identifies a cart.
hmacstring (Required) Encrypted alphanumeric token returned by cart_create() that authorizes access to a cart.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MergeCartboolean (Optional) A boolean value that when True specifies that the items in a customer’s remote shopping cart are added to the customer’s Amazon retail shopping cart.  This occurs when the customer elects to purchase the items in their remote shopping cart.  When the value is False the remote shopping cart contents are not added to the retail shopping cart.  Instead, the customer is sent directly to the Order Pipeline when they elect to purchase the items in their cart.  This parameter is valid only in the US locale.  In all other locales, the parameter is invalid but the request behaves as though the value were set to True.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CartClear', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::cart_clear - validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
$pas = new AmazonPAS();
$response = $pas->cart_clear('valid-cart-id', 'valid-hmac', array(
	'Validate' => 'true'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CartClear.html

cart_create()

public function cart_create($offer_listing_id,  
$opt =  null,
$locale =  null)

Enables you to create a remote shopping cart.  A shopping cart is the metaphor used by most e-commerce solutions.  It is a temporary data storage structure that resides on Amazon servers.  The structure contains the items a customer wants to buy.  In Amazon Associates Web Service, the shopping cart is considered remote because it is hosted by Amazon servers.  In this way, the cart is remote to the vendor’s web site where the customer views and selects the items they want to purchase.

Once you add an item to a cart by specifying the item’s ListItemId and ASIN, or OfferListing ID, the item is assigned a CartItemId and accessible only by that value.  That is, in subsequent requests, an item in a cart cannot be accessed by its ListItemId and ASIN, or OfferListingId.

Because the contents of a cart can change for different reasons, such as item availability, you should not keep a copy of a cart locally.  Instead, use the other cart operations to modify the cart contents.  For example, to retrieve contents of the cart, which are represented by CartItemIds, use cart_get().

Available products are added as cart items.  Unavailable items, for example, items out of stock, discontinued, or future releases, are added as SaveForLaterItems.  No error is generated.  The Amazon database changes regularly.  You may find a product with an offer listing ID but by the time the item is added to the cart the product is no longer available.  The checkout page in the Order Pipeline clearly lists items that are available and those that are SaveForLaterItems.

It is impossible to create an empty shopping cart.  You have to add at least one item to a shopping cart using a single cart_create() request.  You can add specific quantities (up to 999) of each item.  cart_create() can be used only once in the life cycle of a cart.  To modify the contents of the cart, use one of the other cart operations.

Carts cannot be deleted.  They expire automatically after being unused for 7 days.  The lifespan of a cart restarts, however, every time a cart is modified.  In this way, a cart can last for more than 7 days.  If, for example, on day 6, the customer modifies a cart, the 7 day countdown starts over.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

offer_listing_idstring|array (Required) Either a string containing the Offer ID to add, or an associative array where the Offer ID is the key and the quantity is the value.  An offer listing ID is an alphanumeric token that uniquely identifies an item.  Use the OfferListingId instead of an item’s ASIN to add the item to the cart.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MergeCartboolean (Optional) A boolean value that when True specifies that the items in a customer’s remote shopping cart are added to the customer’s Amazon retail shopping cart.  This occurs when the customer elects to purchase the items in their remote shopping cart.  When the value is False the remote shopping cart contents are not added to the retail shopping cart.  Instead, the customer is sent directly to the Order Pipeline when they elect to purchase the items in their cart.  This parameter is valid only in the US locale.  In all other locales, the parameter is invalid but the request behaves as though the value were set to True.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CartCreate', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::cart_create - single item, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
$pas = new AmazonPAS();
$response = $pas->cart_create('%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf', array(
	'Validate' => 'true'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::cart_create - single item, multiple quantities, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
$pas = new AmazonPAS();
$response = $pas->cart_create(array(
	'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 15
), array(
	'Validate' => 'true'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CartCreate.html

cart_get()

public function cart_get($cart_id,  
$hmac,  
$opt =  null,
$locale =  null)

Enables you to retrieve the IDs, quantities, and prices of all of the items, including SavedForLater items in a remote shopping cart.

Because the contents of a cart can change for different reasons, such as availability, you should not keep a copy of a cart locally.  Instead, use cart_get() to retrieve the items in a remote shopping cart.  To retrieve the items in a cart, you must specify the cart using the CartId and HMAC values, which are returned in the cart_create() operation.  A value similar to HMAC, URLEncodedHMAC, is also returned.

This value is the URL encoded version of the HMAC.  This encoding is necessary because some characters, such as + and /, cannot be included in a URL.  Rather than encoding the HMAC yourself, use the URLEncodedHMAC value for the HMAC parameter.

cart_get() does not work after the customer has used the PurchaseURL to either purchase the items or merge them with the items in their Amazon cart.

Access

public

Parameters

cart_idstring (Required) Alphanumeric token returned by cart_create() that identifies a cart.
hmacstring (Required) Encrypted alphanumeric token returned by cart_create() that authorizes access to a cart.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

CartItemIdstring (Optional) Alphanumeric token that uniquely identifies an item in a cart.  Once an item, specified by an ASIN or OfferListingId, has been added to a cart, you must use the CartItemId to refer to it.  The other identifiers will not work.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MergeCartboolean (Optional) A boolean value that when True specifies that the items in a customer’s remote shopping cart are added to the customer’s Amazon retail shopping cart.  This occurs when the customer elects to purchase the items in their remote shopping cart.  When the value is False the remote shopping cart contents are not added to the retail shopping cart.  Instead, the customer is sent directly to the Order Pipeline when they elect to purchase the items in their cart.  This parameter is valid only in the US locale.  In all other locales, the parameter is invalid but the request behaves as though the value were set to True.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CartGet', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::cart_get - validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
$pas = new AmazonPAS();
$response = $pas->cart_get('valid-cart-id', 'valid-hmac', array(
	'Validate' => 'true'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CartGet.html

cart_modify()

public function cart_modify($cart_id,  
$hmac,  
$cart_item_id,  
$opt =  null,
$locale =  null)

Enables you to change the quantity of items that are already in a remote shopping cart, move items from the active area of a cart to the SaveForLater area or the reverse, and change the MergeCart setting.

To modify the number of items in a cart, you must specify the cart using the CartId and HMAC values that are returned in the cart_create() operation.  A value similar to HMAC, URLEncodedHMAC, is also returned.  This value is the URL encoded version of the HMAC.  This encoding is necessary because some characters, such as + and /, cannot be included in a URL.  Rather than encoding the HMAC yourself, use the URLEncodedHMAC value for the HMAC parameter.

You can use cart_modify() to modify the number of items in a remote shopping cart by setting the value of the Quantity parameter appropriately.  You can eliminate an item from a cart by setting the value of the Quantity parameter to zero.  Or, you can double the number of a particular item in the cart by doubling its Quantity.  You cannot, however, use cart_modify() to add new items to a cart.

Access

public

Parameters

cart_idstring (Required) Alphanumeric token returned by cart_create() that identifies a cart.
hmacstring (Required) Encrypted alphanumeric token returned by cart_create() that authorizes access to a cart.
cart_item_idarray (Required) Associative array that specifies an item to be modified in the cart where N is a positive integer between 1 and 10, inclusive.  Up to ten items can be modified at a time.  CartItemId is neither an ASIN nor an OfferListingId.  It is, instead, an alphanumeric token returned by cart_create() and cart_add().  This parameter is used in conjunction with Item.N.Quantity to modify the number of items in a cart.  Also, instead of adjusting the quantity, you can set ‘SaveForLater’ or ‘MoveToCart’ as actions instead.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Actionstring (Optional) Change cart items to move items to the Saved-For-Later area, or change Saved-For- Later (SaveForLater) items to the active cart area (MoveToCart).
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
ListItemIdstring (Optional) The ListItemId parameter is returned by the ListItems response group.  The parameter identifies an item on a list, such as a wishlist.  To add this item to a cart, you must include in the cart_create() request the item’s ASIN and ListItemId.  The ListItemId includes the name and address of the list owner, which the ASIN alone does not.
MergeCartboolean (Optional) A boolean value that when True specifies that the items in a customer’s remote shopping cart are added to the customer’s Amazon retail shopping cart.  This occurs when the customer elects to purchase the items in their remote shopping cart.  When the value is False the remote shopping cart contents are not added to the retail shopping cart.  Instead, the customer is sent directly to the Order Pipeline when they elect to purchase the items in their cart.  This parameter is valid only in the US locale.  In all other locales, the parameter is invalid but the request behaves as though the value were set to True.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CartModify', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::cart_modify - single item, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_modify(
	'valid-cart-id',
	'valid-hmac',
	array(
		'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 5
	),
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::cart_modify - single item, save for later, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_modify(
	'valid-cart-id',
	'valid-hmac',
	array(
		'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 'SaveForLater'
	),
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::cart_modify - single item, move to cart, validate only.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Validate whether a request would be successful, without executing it, using the 'Validate' option.
// Replace 'valid-cart-id' and 'valid-hmac' with real values from the <create_cart()> response.
// Added line breaks for readability.
$pas = new AmazonPAS();
$response = $pas->cart_modify(
	'valid-cart-id',
	'valid-hmac',
	array(
		'%2BcgeaxKWE74bnHvaPPwZKdTcqwPB%2BsxyOgd2umMnTvT1A0Px1JRwyPijPD3CvBmsohKLo9IArgjZc1QkjL34z3Yj5axtYiyf' => 'MoveToCart'
	),
	array(
		'Validate' => 'true'
	)
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CartModify.html

customer_content_lookup()

public function customer_content_lookup($customer_id,  
$opt =  null,
$locale =  null)

For a given customer ID, the customer_content_lookup() operation retrieves all of the information a customer has made public about themselves on Amazon.  Such information includes some or all of the following: About Me, Birthday, City, State, Country, Customer Reviews, Customer ID, Name, Nickname, Wedding Registry, or WishList.  To find a customer ID, use the customer_content_search() operation.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

customer_idstring (Required) An alphanumeric token assigned by Amazon that uniquely identifies a customer.  Only one customer_id can be submitted at a time in customer_content_lookup().
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘CustomerInfo’ (default), ‘CustomerReviews’, ‘CustomerLists’, ‘CustomerFull’, ‘TaggedGuides’, ‘TaggedItems’, ‘TaggedListmaniaLists’, ‘TagsSummary’, or ‘Tags’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
ReviewPageinteger (Optional) A positive integer that specifies the page of reviews to read.  There are ten reviews per page.  For example, to read reviews 11 through 20, specify ReviewPage=2.  The total number of pages is returned in the TotalPages response tag.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TagPageinteger (Optional) Specifies the page of results to return.  There are ten results on a page.  The maximum page number is 400.
TagsPerPageinteger (Optional) The number of tags to return that are associated with a specified item.
TagSortstring (Optional) Specifies the sorting order for the results.  Allows ‘FirstUsed’, ‘LastUsed’, ‘Name’, or ‘Usages’ (default)
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CustomerContentLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::customer_content_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Look up the user
$pas = new AmazonPAS();
$response = $pas->customer_content_lookup('A1ESH8CKZLUV25');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::customer_content_lookup with ResponseGroup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Look up the user
$pas = new AmazonPAS();
$response = $pas->customer_content_lookup('A1ESH8CKZLUV25', array(
	'ResponseGroup' => 'CustomerFull'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CustomerContentLookup.html
Relatedcustomer_content_lookup(), customer_content_search()

customer_content_search()

public function customer_content_search($email_name,  
$opt =  null)

For a given customer Email address or name, the customer_content_search() operation returns matching customer IDs, names, nicknames, and residence information (city, state, and country).  In general, supplying an Email address returns unique results whereas supplying a name more often returns multiple results.  This operation is US-only.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

email_namestring (Required) Either the email address or the name of the customer you want to look up the ID for.
optarray (Optional) Associative array of parameters which can have the following keys:

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
CustomerPageinteger (Optional) A positive integer that specifies the page of customer IDs to return.  Up to twenty customer IDs are returned per page.  Defaults to 1.
Emailstring (Optional) Besides the first parameter, you can set the email address here.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
Namestring (Optional) Besides the first parameter, you can set the name here.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('CustomerContentSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::customer_content_search by name
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Look up the user
$pas = new AmazonPAS();
$response = $pas->customer_content_search('Ryan Parman');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::customer_content_search by email
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Look up the user
$pas = new AmazonPAS();
$response = $pas->customer_content_search('ryan@getcloudfusion.com');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/CustomerContentSearch.html
Relatedcustomer_content_lookup(), customer_content_search()

help()

public function help($about,  
$help_type,  
$opt =  null,
$locale =  null)

The Help operation provides information about PAS operations and response groups.  For operations, Help lists required and optional request parameters, as well as default and optional response groups the operation can use.  For response groups, Help lists the operations that can use the response group as well as the response tags returned by the response group in the XML response.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

aboutstring (Required) Specifies the operation or response group about which you want more information.  Allows all PAS operations, all PAS response groups.
help_typestring (Required) Specifies whether the help topic is an operation or response group.  HelpType and About values must both be operations or response groups, not a mixture of the two.  Allows ‘Operation’ or ‘ResponseGroup’.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘Request’ or ‘Help’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

AmazonPAS::help
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get help info
$pas = new AmazonPAS();
$response = $pas->help('CustomerContentSearch', 'Operation');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/Help.html

item_lookup()

public function item_lookup($item_id,  
$opt =  null,
$locale =  null)

Given an Item identifier, the ItemLookup operation returns some or all of the item attributes, depending on the response group specified in the request.  By default, item_lookup() returns an item’s ASIN, DetailPageURL, Manufacturer, ProductGroup, and Title of the item.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

item_idstring (Required) A positive integer that unique identifies an item.  The meaning of the number is specified by IdType.  That is, if IdType is ASIN, the ItemId value is an ASIN.  If ItemId is an ASIN, a search index cannot be specified in the request.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Conditionstring (Optional) Specifies an item’s condition.  If Condition is set to “All,” a separate set of responses is returned for each valid value of Condition.  The default value is “New” (not “All”).  So, if your request does not return results, consider setting the value to “All.”  When the value is “New,” the ItemSearch Availability parameter cannot be set to “Available.”  Amazon only sells items that are “New.”  Allows ‘New’, ‘Used’, ‘Collectible’, ‘Refurbished’, and ‘All’.  Defaults to ‘New’.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
IdTypestring (Optional) Type of item identifier used to look up an item.  All IdTypes except ASINx require a SearchIndex to be specified.  SKU requires a MerchantId to be specified also.  Allows ‘ASIN’, ‘SKU’, ‘UPC’, ‘EAN’, ‘ISBN’ (US only, when search index is Books), and ‘JAN’.  UPC is not valid in the Canadian locale.  Defaults to ‘ASIN’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
OfferPagestring (Optional) Page of offers returned.  There are 10 offers per page.  To examine offers 11 trough 20, for example, set OfferPage to 2.  Allows 1 through 100.
RelatedItemsPageinteger (Optional) This optional parameter is only valid when the RelatedItems response group is used.  Each ItemLookup request can return, at most, ten related items.  The RelatedItemsPage value specifies the set of ten related items to return.  A value of 2, for example, returns the second set of ten related items.
RelationshipTypestring (Optional) This parameter is required when the RelatedItems response group is used.  The type of related item returned is specified by the RelationshipType parameter.  Sample values include Episode, Season, and Tracks.  For a complete list of types, go to the documentation for “Relationship Types”.  Required when ‘RelatedItems’ response group is used.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Check the documentation for all allowed values.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
ReviewPageinteger (Optional) Page of reviews returned.  There are 5 reviews per page.  To examine reviews 6 through 10, for example, set ReviewPage to 2.  Allows 1 through 20.
ReviewSortstring (Optional) Specifies the order in which Reviews are sorted in the return.  Allows ‘-HelpfulVotes’, ‘HelpfulVotes’, ‘-OverallRating’, ‘OverallRating’, ‘SubmissionDate’ and ‘-SubmissionDate’.  Defaults to ‘-SubmissionDate’.
SearchIndexstring (Optional) The product category to search.  Constraint: If ItemIds an ASIN, a search index cannot be specified in the request.  Required for for non-ASIN ItemIds.  Allows any valid search index.  See the “Search Indices” documentation page for more details.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TagPageinteger (Optional) Specifies the page of results to return.  There are ten results on a page.  Allows 1 through 400.
TagsPerPageinteger (Optional) The number of tags to return that are associated with a specified item.
TagSortstring (Optional) Specifies the sorting order for the results.  Allows ‘FirstUsed’, ‘-FirstUsed’, ‘LastUsed’, ‘-LastUsed’, ‘Name’, ‘-Name’, ‘Usages’, and ‘-Usages’.  Defaults to ‘-Usages’.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
VariationPagestring (Optional) Page number of variations returned by ItemLookup.  By default, ItemLookup returns all variations.  Use VariationPage to return a subsection of the response.  There are 10 variations per page.  To examine offers 11 trough 20, for example, set VariationPage to 2.  Allows 1 through 150.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('ItemLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::item_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Lookup an item
$pas = new AmazonPAS();
$response = $pas->item_lookup('B002FZL94O');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::item_lookup with ResponseGroup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Lookup an item
$pas = new AmazonPAS();
$response = $pas->item_lookup('B002FZL94O', array(
	'ResponseGroup' => 'Large'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/ItemLookup.html
Relateditem_lookup(), item_search()

item_search()

public function item_search($keywords,  
$opt =  null,
$locale =  null)

The item_search() operation returns items that satisfy the search criteria, including one or more search indices.  item_search() is the operation that is used most often in requests.  In general, when trying to find an item for sale, you use this operation.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

keywordsstring (Required) A word or phrase associated with an item.  The word or phrase can be in various product fields, including product title, author, artist, description, manufacturer, and so forth.  When, for example, the search index equals “MusicTracks”, the Keywords parameter enables you to search by song title.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Actorstring (Optional) Name of an actor associated with the item.  You can enter all or part of the name.
Artiststring (Optional) Name of an artist associated with the item.  You can enter all or part of the name.
AudienceRatingstring (Optional) Movie ratings based on MPAA ratings or age, depending upon the locale.  You may specify one or more values in a comma-separated list.
Authorstring (Optional) Name of an author associated with the item.  You can enter all or part of the name.
Availabilitystring (Optional) Enables ItemSearch to return only those items that are available.  This parameter must be used in combination with a merchant ID and Condition.  When Availability is set to “Available,” the Condition parameter cannot be set to “New”.
Brandstring (Optional) Name of a brand associated with the item.  You can enter all or part of the name.
BrowseNodeinteger (Optional) Browse nodes are positive integers that identify product categories.
Citystring (Optional) Name of a city associated with the item.  You can enter all or part of the name.  This parameter only works in the US locale.
Composerstring (Optional) Name of an composer associated with the item.  You can enter all or part of the name.
Conditionstring (Optional) Use the Condition parameter to filter the offers returned in the product list by condition type.  By default, Condition equals “New”.  If you do not get results, consider changing the value to “All.  When the Availability parameter is set to “Available,” the Condition parameter cannot be set to “New”.  ItemSearch returns up to ten search results at a time.  Allows ‘New’, ‘Used’, ‘Collectible’, ‘Refurbished’, ‘All’.
Conductorstring (Optional) Name of a conductor associated with the item.  You can enter all or part of the name.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
Directorstring (Optional) Name of a director associated with the item.  You can enter all or part of the name.
ItemPageinteger (Optional) Retrieves a specific page of items from all of the items in a response.  Up to ten items are returned on a page unless Condition equals “All.”  In that case, returns up to three results per Condition, for example, three new, three used, three refurbished, and three collectible items.  Or, for example, if there are no collectible or refurbished items being offered, returns three new and three used items.  The total number of pages of items found is returned in the TotalPages response tag.  Allows 1 through 400.
Keywordsstring (Optional) A word or phrase associated with an item.  The word or phrase can be in various product fields, including product title, author, artist, description, manufacturer, and so forth.  When, for example, the search index equals “MusicTracks,” the Keywords parameter enables you to search by song title.
Manufacturerstring (Optional) Name of a manufacturer associated with the item.  You can enter all or part of the name.
MaximumPricestring (Optional) Specifies the maximum price of the items in the response.  Prices are in terms of the lowest currency denomination, for example, pennies.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
MinimumPricestring (Optional) Specifies the minimum price of the items in the response.  Prices are in terms of the lowest currency denomination, for example, pennies.
Neighborhoodstring (Optional) Name of a neighborhood You can enter all or part of the name.  The neighborhoods are located in one of the valid values for City.
Orchestrastring (Optional) Name of an orchestra associated with the item.  You can enter all or part of the name.
PostalCodestring (Optional) Postal code of the merchant.  In the US, the postal code is the postal code.  This parameter enables you to search for items sold in a specified region of a country.
Powerstring (Optional) Performs a book search using a complex query string.  Only works when the search index is set equal to “Books”.
Publisherstring (Optional) Name of a publisher associated with the item.  You can enter all or part of the name.
RelatedItemsPageinteger (Optional) This optional parameter is only valid when the RelatedItems response group is used.  Each ItemLookup request can return, at most, ten related items.  The RelatedItemsPage value specifies the set of ten related items to return.  A value of 2, for example, returns the second set of ten related items.
RelationshipTypestring (Optional; Required when RelatedItems response group is used) This parameter is required when the RelatedItems response group is used.  The type of related item returned is specified by the RelationshipType parameter.  Sample values include Episode, Season, and Tracks.  A complete list of values follows this table.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
ReviewSortstring (Optional) Sorts reviews based on the value of the parameter.  ‘-HelpfulVotes’, ‘HelpfulVotes’, ‘-OverallRating’, ‘OverallRating’, ‘Rank’, ‘-Rank’, ‘-SubmissionDate’, ‘SubmissionDate’.
SearchIndexstring (Optional) The product category to search.  Many ItemSearch parameters are valid with only specific values of SearchIndex.
Sortstring (Optional) Means by which the items in the response are ordered.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TagPageinteger (Optional) Specifies the page of results to return.  There are ten results on a page.  The maximum page number is 400.
TagsPerPageinteger (Optional) The number of tags to return that are associated with a specified item.
TagSortstring (Optional) Specifies the sorting order for the results.  Allows ‘FirstUsed’, ‘-FirstUsed’, ‘LastUsed’, ‘-LastUsed’, ‘Name’, ‘-Name’, ‘Usages’, and ‘-Usages’.  To sort items in descending order, prefix the values with a negative sign (-).
TextStreamstring (Optional) A search based on two or more words.  Picks out of the block of text up to ten keywords and returns up to ten items that match those keywords.  For example, if five keywords are found, two items for each keyword are returned.  Only one page of results is returned so ItemPage does not work with TextStream.
Titlestring (Optional) The title associated with the item.  You can enter all or part of the title.  Title searches are a subset of Keyword searches.  If a Title search yields insufficient results, consider using a Keywords search.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
VariationPageinteger (Optional) Retrieves a specific page of variations returned by ItemSearch.  By default, ItemSearch returns all variations.  Use VariationPage to return a subsection of the response.  There are 10 variations per page.  To examine offers 11 trough 20, for example, set VariationPage to 2.  The total number of pages is returned in the TotalPages element.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('ItemSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::item_search
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for an item
$pas = new AmazonPAS();
$response = $pas->item_search('skillet awake');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::item_search with ResponseGroup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for an item
$pas = new AmazonPAS();
$response = $pas->item_search('skillet awake', array(
	'ResponseGroup' => 'Large'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/ItemSearch.html
Relateditem_lookup(), item_search()

list_lookup()

public function list_lookup($list_id,  
$list_type,  
$opt =  null,
$locale =  null)

The list_lookup() operation returns, by default, summary information about a list that you specify in the request.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

list_idstring (Required) Number that uniquely identifies a list.
list_typestring (Required) Type of list.  Accepts ‘WeddingRegistry’, ‘Listmania’, ‘WishList’.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Conditionstring (Optional) Specifies an item’s condition.  If Condition is set to “All”, a separate set of responses is returned for each valid value of Condition.  Allows ‘All’, ‘Collectible’, ‘Refurbished’, or ‘Used’.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
IsOmitPurchasedItemsboolean (Optional) If you set IsOmitPurchasedItems to TRUE, items on a wishlist that have been purchased will not be returned.  Only those items that have not been purchased or those for which the entire quantity has not been purchased are returned.  Defaults to FALSE.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ProductGroupstring (Optional) Category of the item, for example, ‘Book’ or ‘DVD’.
ProductPageinteger (Optional) Retrieves a specific page of lists returned.  There are ten lists per page.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Sortstring (Optional) Means by which the list items in the response are ordered.  Use only with wishlists.  Allows ‘DateAdded’, ‘LastUpdated’, ‘Price’, and ‘Priority’.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('ListLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::list_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for a list
$pas = new AmazonPAS();
$response = $pas->list_lookup('KAFYR57E8R81', 'WishList');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/ListLookup.html
Relatedlist_lookup(), list_search()

list_search()

public function list_search($email_name,  
$list_type,  
$opt =  null,
$locale =  null)

Given a customer name or Email address, the list_search() operation returns the associated list ID(s) but not the list items.  To find those, use the list ID returned by list_search() with list_lookup().

Specifying a full name or just a first or last name in the request typically returns multiple lists belonging to different people.  Using Email as the identifier produces more filtered results.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

email_namestring (Required) Name or email address of the list creator.  This parameter is not supported for the BabyRegistry.  Set this to null if you want to explicitly pass FirstName and LastName for $opt.
list_typestring (Required) Specifies the kind of list you are retrieving.  Allows ‘BabyRegistry’, ‘WeddingRegistry’, ‘WishList’.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Citystring (Optional) City in which the list creator lives.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
Emailstring (Optional) E-mail address of the list creator.  This parameter is not supported for the BabyRegistry.
FirstNamestring (Optional) First name of the list creator.  Returns all list owners that have FirstName in their first name.  For example, specifying ‘John’, will return first names of ‘John’, ‘Johnny’, and ‘Johnson’.
LastNamestring (Optional) Last name of the list creator.  ListSearch returns all list owners that have LastName in their last name.  For example, specifying ‘Ender’, will return the last names of ‘Ender’, ‘Enders’, and ‘Enderson’.
ListPageinteger (Optional) Retrieve a specific page of list IDs.  There are ten list IDs per page.  The total number of pages is returned in the TotalPages response tag.  The default is to return the first page.  Allows 1 through 20.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Statestring (Optional) State in which the list creator lives.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('ListSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::list_search by name
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for a list
$pas = new AmazonPAS();
$response = $pas->list_search('Ryan Parman', 'WishList');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::list_search, skipping $email_name and explicitly setting FirstName and LastName.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for a list
$pas = new AmazonPAS();
$response = $pas->list_search(null, 'WishList', array(
	'FirstName' => 'Ryan',
	'LastName' => 'Parman'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::list_search by email address
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for a list
$pas = new AmazonPAS();
$response = $pas->list_search('ryan@getcloudfusion.com', 'WishList');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/ListSearch.html
Relatedlist_lookup(), list_search()

seller_listing_lookup()

public function seller_listing_lookup($item_id,  
$id_type,  
$seller_id,  
$opt =  null,
$locale =  null)

Enables you to return information about a seller’s listings, including product descriptions, availability, condition, and quantity available.  The response also includes the seller’s nickname.  Each request requires a seller ID.

You can also find a seller’s items using ItemLookup.  There are, however, some reasons why it is better to use seller_listing_lookup(): (a) seller_listing_lookup() enables you to search by seller ID.  (b) seller_listing_lookup() returns much more information than item_lookup().

This operation only works with sellers who have less than 100,000 items for sale.  Sellers that have more items for sale should use, instead of Amazon Associates Web Service, other APIs, including the Amazon Inventory Management System, and the Merchant@ API.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

item_idstring (Optional) Number that uniquely identifies an item.  The valid value depends on the value for IdType.  Allows an Exchange ID, a Listing ID, an ASIN, or a SKU.
id_typestring (Optional) Use the IdType parameter to specify the value type of the Id parameter value.  If you are looking up an Amazon Marketplace item, use Exchange, ASIN, or SKU as the value for IdType.  Discontinued, out of stock, or unavailable products will not be returned if IdType is Listing, SKU, or ASIN.  Those products will be returned, however, if IdType is Exchange.  Allows ‘Exchange’, ‘Listing’, ‘ASIN’, ‘SKU’.
seller_idstring (Optional) Alphanumeric token that uniquely identifies a seller.  This parameter limits the results to a single seller ID.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('SellerListingLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::seller_listing_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for an item
$pas = new AmazonPAS();
$response = $pas->seller_listing_lookup('B002FZL94O', 'ASIN', 'ATVPDKIKX0DER');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/SellerListingLookup.html
Relatedseller_listing_search(), seller_lookup()

seller_listing_search()

public function seller_listing_search($seller_id,  
$opt =  null,
$locale =  null)

Enables you to search for items offered by specific sellers.  You cannot use seller_listing_search() to look up items sold by merchants.  To look up an item sold by a merchant, use item_lookup() or item_search() along with the MerchantId parameter.

seller_listing_search() returns the listing ID or exchange ID of an item.  Typically, you use those values with seller_listing_lookup() to find out more about those items.

Each request returns up to ten items.  By default, the first ten items are returned.  You can use the ListingPage parameter to retrieve additional pages of (up to) ten listings.  To use Amazon Associates Web Service, sellers must have less than 100,000 items for sale.  Sellers that have more items for sale should use, instead of Amazon Associates Web Service, other seller APIs, including the Amazon Inventory Management System, and the Merchant@ API.

seller_listing_search() requires a seller ID, which means that you cannot use this operation to search across all sellers.  Amazon Associates Web Service does not have a seller-specific operation that does this.  To search across all sellers, use item_lookup() or item_search().

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

seller_idstring (Required) An alphanumeric token that uniquely identifies a seller.  These tokens are created by Amazon and distributed to sellers.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
ListingPageinteger (Optional) Page of the response to return.  Up to ten lists are returned per page.  For customers that have more than ten lists, more than one page of results are returned.  By default, the first page is returned.  To return another page, specify the page number.  Allows 1 through 500.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
OfferStatusstring (Optional) Specifies whether the product is available (Open), or not (Closed.)  Closed products are those that are discontinued, out of stock, or unavailable.  Defaults to ‘Open’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Sortstring (Optional) Use the Sort parameter to specify how your seller listing search results will be ordered.  The -bfp (featured listings - default), applies only to the US, UK, and DE locales.  Allows ‘-startdate’, ‘startdate’, ‘+startdate’, ‘-enddate’, ‘enddate’, ‘-sku’, ‘sku’, ‘-quantity’, ‘quantity’, ‘-price’, ‘price |+price’, ‘-title’, ‘title’.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Titlestring (Optional) Searches for products based on the product’s name.  Keywords and Title are mutually exclusive; you can have only one of the two in a request.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('SellerListingSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::seller_listing_search
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for an item
$pas = new AmazonPAS();
$response = $pas->seller_listing_search('ATVPDKIKX0DER');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/SellerListingSearch.html
Relatedseller_listing_lookup(), seller_lookup()

seller_lookup()

public function seller_lookup($seller_id,  
$opt =  null,
$locale =  null)

Returns detailed information about sellers and, in the US locale, merchants.  To lookup a seller, you must use their seller ID.  The information returned includes the seller’s name, average rating by customers, and the first five customer feedback entries.  seller_lookup() will not, however, return the seller’s e-mail or business addresses.

A seller must enter their information.  Sometimes, sellers do not.  In that case, seller_lookup() cannot return some seller-specific information.

To look up more than one seller in a single request, insert a comma-delimited list of up to five seller IDs in the SellerId parameter of the REST request.  Customers can rate sellers.  5 is the best rating; 0 is the worst.  The rating reflects the customer’s experience with the seller.  The seller_lookup() operation, by default, returns review comments by individual customers.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

seller_idstring (Required) An alphanumeric token that uniquely identifies a seller.  These tokens are created by Amazon and distributed to sellers.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
FeedbackPagestring (Optional) Specifies the page of reviews to return.  Up to five reviews are returned per page.  The first page is returned by default.  To access additional pages, use this parameter to specify the desired page.  The maximum number of pages that can be returned is 10 (50 feedback items).  Allows 1 through 10.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('SellerLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::seller_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for an item
$pas = new AmazonPAS();
$response = $pas->seller_lookup('ATVPDKIKX0DER');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/SellerLookup.html
Relatedseller_listing_lookup(), seller_listing_search()

vehicle_part_lookup()

public function vehicle_part_lookup($make_id,  
$model_id,  
$year,  
$item_id,  
$opt =  null)

Given a car part, vehicle_part_lookup() returns the vehicle models and years the part works in.  For example, one carburetor might work in the same vehicle model over a five year period.  You can page through the parts returned using the parameters, Count and FitmentPage.  This operation is US-only.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

make_idinteger (Required) Identifier that uniquely identifies the make of the car.  This can be retrieved by using vehicle_search() first.
model_idinteger (Required) Identifier that uniquely identifies the model of the car.  This can be retrieved by using vehicle_search() first.
yearinteger (Required) The year of the car the part works in.
item_idstring (Required) The part ID to lookup.  This is typically an ASIN, and can be looked up with vehicle_part_search().
optarray (Optional) Associative array of parameters which can have the following keys:

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

BedIdinteger (Optional) Identifier that uniquely identifies the bed style of a truck.  This parameter does not pertain to cars.
BodyStyleIdinteger (Optional) Identifier that uniquely identifies the body style of the car.
BrakesIdinteger (Optional) Identifier that uniquely identifies the brake type on a car.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
DriveTypeIdinteger (Optional) Identifier that uniquely identifies the type of drive on the car.  A drive type, for example, is four wheel drive.
EngineIdinteger (Optional) Identifier that uniquely identifies the type of engine in the car.  An engine type would be, for example, the piston displacement, like 409 cu. inches.
FitmentCountinteger (Optional) Specifies the number of Fitments returned per page of results.  Fitments are a combination of car characteristics, including make, model, year, and trim.  This parameter is only used with the Fitments response group.
FitmentPageinteger (Optional) The page number of the Fitments returned.  Use FitmentPage with Count to page through the results.
IdTypestring (Optional) Specifies the type of ID.
MakeIdinteger (Optional; Required when using the VehiclePartFit response group) Identifier that uniquely identifies the make of the car.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
MfrBodyCodeIdinteger (Optional) Identifier that uniquely identifies the manufacturer’s car body code.
ModelIdinteger (Optional; Required when using the VehiclePartFit response group) Identifier that uniquely identifies the model of the car.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘Fitments’, ‘HasPartCompatibility’, and ‘VehiclePartFit’.  Defaults to ‘HasPartCompatibility’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
SpringTypesIdinteger (Optional) Identifier that uniquely identifies the type of spring shocks in the car.
SteeringIdinteger (Optional) Identifier that uniquely identifies the steering type of the car.  A steering type would be power steering.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TransmissionIdinteger (Optional) Identifier that uniquely identifies the transmission type used in the car.
TrimIdinteger (Optional) Identifier that uniquely identifies the trim on the car.  Trim generally refers to a package of car options (e.g.  Volvo GL vs.  Volvo DL).  Using this parameter helps narrow responses.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
WheelbaseIdinteger (Optional) Identifier that uniquely identifies the car’s wheelbase.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.
Yearinteger (Optional; Required when using the VehiclePartFit response group) The year of the vehicle.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('VehiclePartLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::vehicle_part_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Use vehicle_search() to look up these values
$pas = new AmazonPAS();
$response = $pas->vehicle_part_lookup(59, 752, 2005, 'B000IYDEPG');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/VehiclePartLookup.html
Relatedvehicle_part_search(), vehicle_search()

vehicle_part_search()

public function vehicle_part_search($make_id,  
$model_id,  
$year,  
$opt =  null)

Returns the parts that work in the car.  For example, a 2008 GMC Yukon has a list of parts that can work in it.  The more parameters that you supply in the request, the narrower your results.

VehicleSearch has additional, optional parameters to narrow the results, for example BrowseNodeId and Brand.  You can page through the vehicles returned using the parameters, Count, PartPageDirection, and FromItemId.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

make_idinteger (Required) Identifier that uniquely identifies the make of the car.  This can be retrieved by using vehicle_search() first.
model_idinteger (Required) Identifier that uniquely identifies the model of the car.  This can be retrieved by using vehicle_search() first.
yearinteger (Required) The year of the car the part works in.
optarray (Optional) Associative array of parameters which can have the following keys:

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

BedIdinteger (Optional) Identifier that uniquely identifies the bed style of a truck.  This parameter does not pertain to cars.
BodyStyleIdinteger (Optional) Identifier that uniquely identifies the body style of the car.
BrakesIdinteger (Optional) Identifier that uniquely identifies the brake type on a car.
Brandinteger (Optional) The brand of the company that made the part.
BrowseNodeIdinteger (Optional) Identifier that uniquely identifies the BrowseNode to which the part belongs.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
Countinteger (Optional) Controls the number of items returned.  Use Count with FitmentPage to page through the results.
DriveTypeIdinteger (Optional) Identifier that uniquely identifies the type of drive on the car.  A drive type, for example, is four wheel drive.
EngineIdinteger (Optional) Identifier that uniquely identifies the type of engine in the car.  An engine type would be, for example, the piston displacement, like 409 cu. inches.
FromItemIdinteger (Optional) An ASIN that identifies where to start or end the next page of returned results.  If PartPageDirection is “Next,” the ASIN after this one starts the next set of up to 15 returned results.  If PartPageDirection is “Previous,” the ASIN is one after the previous set of up to fifteen results returned.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
MfrBodyCodeIdinteger (Optional) Identifier that uniquely identifies the manufacturer’s car body code.
PartPageDirectionstring (Optional) Specifies the direction, forward or backward, to go from FromItemId in presenting the next set of (up to) fifteen results.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘PartBrowseNodeBinsSummary’, ‘PartBrandBinsSummary’, ‘HasPartCompatibility’, ‘VehiclePartFit’, and ‘VehicleParts’.  Defaults to ‘VehicleParts’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
SpringTypesIdinteger (Optional) Identifier that uniquely identifies the type of spring shocks in the car.
SteeringIdinteger (Optional) Identifier that uniquely identifies the steering type of the car.  A steering type would be power steering.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TransmissionIdinteger (Optional) Identifier that uniquely identifies the transmission type used in the car.
TrimIdinteger (Optional; Sometimes Required) Identifier that uniquely identifies the trim on the car.  Required when using one of the following parameters: ‘BedId’, ‘BodyStyleId’, ‘BrakesId’, ‘DriveTypeId’, ‘EngineId’, ‘MfrBodyCodeId’, ‘SpringTypesId’, ‘SteeringId’, ‘TransmissionId’, ‘WheelbaseId’.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
WheelbaseIdinteger (Optional) Identifier that uniquely identifies the car’s wheelbase.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('VehiclePartSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::vehicle_part_search
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Use vehicle_search() to look up these values
$pas = new AmazonPAS();
$response = $pas->vehicle_part_search(
	59, // Honda
	752, // Civic
	2005
);

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/VehiclePartSearch.html
Relatedvehicle_part_lookup(), vehicle_search()

vehicle_search()

public function vehicle_search($opt =  null)

Returns all vehicles that match the specified values for year, make, model, and trim.  The request can have one or more of those parameters—the more parameters, the narrower the results.  Typically, VehicleSearch requests are repeated, first with the year to get the make, then with the year and make to get the model, and then with the year, make, and model, to get the trim.

The operation can also return all of the vehicle’s options, including BedId, BedName, BodyStyleId, BodyStyleName, BrakesId, BrakesName, DriveTypeId, DriveTypeName, EngineId, EngineName, MakeId, and MakeName.  (The full list of options follows.)  All of these parameters can be used in subsequent requests with the other vehicle operations to narrow results.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

optarray (Optional) Associative array of parameters which can have the following keys:

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MakeIdinteger (Optional; Sometimes Required) Identifier that uniquely identifies the make of the car.  The make is the car’s manufacturer, such as Ford or General Motors.  Use with ‘Year’ to get model.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ModelIdinteger (Optional; Sometimes Required) Identifier that uniquely identifies the model of the car.  Use with ‘Year’ and ‘MakeId’ to get trim.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.  Allows ‘VehicleYears’, ‘VehicleMakes’, ‘VehicleModels’, ‘VehicleTrims’, and ‘VehicleOptions’.  Defaults to ‘VehicleYears’.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TrimIdinteger (Optional; Sometimes Required) Identifier that uniquely identifies the trim on the car.  Required when when using the ‘VehicleOptions’ response group.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.
Yearinteger (Optional; Sometimes Required) The year of the car the part works in.  Required only if including ‘MakeId’ in request or if you are using ‘VehicleSearch’ to look up a ‘MakeId’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('VehicleSearch', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::vehicle_search - get all makes by year
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Set a locale and trigger an operation
$pas = new AmazonPAS();
$response = $pas->vehicle_search(array(
	'Year' => 2005,
	'ResponseGroup' => 'VehicleMakes'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/VehicleSearch.html
Relatedvehicle_part_lookup(), vehicle_part_search()

similarity_lookup()

function similarity_lookup($item_id,  
$opt =  null,
$locale =  null)

Returns up to ten products per page that are similar to one or more items specified in the request.  This operation is typically used to pique a customer’s interest in buying something similar to what they’ve already ordered.

If you specify more than one item, similarity_lookup() returns the intersection of similar items each item would return separately.  Alternatively, you can use the SimilarityType parameter to return the union of items that are similar to any of the specified items.  A maximum of ten similar items are returned; the operation does not return additional pages of similar items.  If there are more than ten similar items, running the same request can result in different answers because the ten that are included in the response are picked randomly.  The results are picked randomly only when you specify multiple items and the results include more than ten similar items.

When you specify multiple items, it is possible for there to be no intersection of similar items.  In this case, the operation returns an error.

Similarity is a measurement of similar items purchased, that is, customers who bought X also bought Y and Z.  It is not a measure, for example, of items viewed, that is, customers who viewed X also viewed Y and Z.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

item_idstring (Required) Specifies the item you want to look up.  An ItemId is an alphanumeric identifier assigned to an item.  You can specify up to ten ItemIds separated by commas.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

Conditionstring (Optional) Specifies an item’s condition.  If Condition is set to “All”, a separate set of responses is returned for each valid value of Condition.  Allows ‘All’, ‘Collectible’, ‘Refurbished’, or ‘Used’.
ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) Specifies the merchant who is offering the item.  MerchantId is an alphanumeric identifier assigned by Amazon to merchants.  Make sure to use a Merchant ID and not a Seller ID.  Seller IDs are not supported.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
SimilarityTypestring (Optional) “Intersection” returns the intersection of items that are similar to all of the ASINs specified.  “Random” returns the union of items that are similar to all of the ASINs specified.  Only ten items are returned.  So, if there are more than ten similar items found, a random selection from the group is returned.  For this reason, running the same request multiple times can yield different results.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('SimilarityLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::similarity_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for similar items
$pas = new AmazonPAS();
$response = $pas->similarity_lookup('B002FZL94O');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/SimilarityLookup.html
Relatedtag_lookup(), transaction_lookup()

tag_lookup()

function tag_lookup($tagname,  
$opt =  null)

Returns entities based on specifying one to five tags.  A tag is a descriptive word that a customer uses to label entities on Amazon’s retail web site.  Entities can be items for sale, Listmania lists, guides, and so forth.  For example, a customer might tag a given entity with the phrase, “BestCookbook”.  This operation is US-only.

In the tag-related response groups, Tags and TagSummary specify the amount of information returned.  The other tag-related response groups, TaggedGuides, TaggedItems, and Tagged listmaniaLists, specify the kind of entity tagged.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

tagnamestring (Required) Comma separated list of tag names.  Up to five tags can be included in a request.
optarray (Optional) Associative array of parameters which can have the following keys:
localestring (Optional) Which Amazon-supported locale do we use?  Defaults to United States.

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
Countinteger (Optional) Number of tagged entities to return per tag.  The default is 5; the maximum is 20.
CustomerIdstring (Optional) Alphanumeric token that uniquely identifies a customer.  This parameter limits the tags returned to those provided by a single customer.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
TagPageinteger (Optional) Specifies the page of results to return.  There are twenty results on a page.
TagSortstring (Optional) Specifies the sorting order for the results.  Allows ‘FirstUsed’, ‘-FirstUsed’, ‘LastUsed’, ‘-LastUsed’, ‘Name’, ‘-Name’, ‘Usages’, and ‘-Usages’.  To sort items in descending order, prefix the previous values with a negative sign (-).
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('TagLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::tag_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for tagged items
$pas = new AmazonPAS();
$response = $pas->tag_lookup('skillet');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>
AmazonPAS::tag_lookup with large response group
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Search for tagged items
$pas = new AmazonPAS();
$response = $pas->tag_lookup('skillet', array(
	'ResponseGroup' => 'Large'
));

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/TagLookup.html
Relatedsimilarity_lookup(), transaction_lookup()

transaction_lookup()

function transaction_lookup($transaction_id,  
$opt =  null)

Returns information about up to ten purchases that have already taken place.  Transaction IDs are created whenever a purchase request is made by a customer.  This operation is US-only.

If you added your Associates ID to the config.inc.php file, or you passed it into the AmazonPAS() constructor, it will be passed along in this request automatically.

Access

public

Parameters

transaction_idstring (Required) A number that uniquely identifies a transaction.  The retail web site calls this number the Order number.
optarray (Optional) Associative array of parameters which can have the following keys:

Keys for the $opt parameter

THIS IS AN INCOMPLETE LIST.  For the latest information, check the AWS documentation page (noted below), or run the help() method (noted in the examples below).

ContentTypestring (Optional) Specifies the format of the content in the response.  Generally, ContentType should only be changed for REST requests when the Style parameter is set to an XSLT stylesheet.  For example, to transform your Amazon Associates Web Service response into HTML, set ContentType to text/html.  Allows ‘text/xml’ and ‘text/html’.  Defaults to ‘text/xml’.
MerchantIdstring (Optional) An alphanumeric token distributed by Amazon that uniquely identifies a merchant.  Allows ‘All’, ‘Amazon’, ‘FeaturedBuyBoxMerchant’, or a specific Merchant ID.  Defaults to ‘Amazon’.
ResponseGroupstring (Optional) Specifies the types of values to return.  You can specify multiple response groups in one request by separating them with commas.
returnCurlHandleboolean (Optional) A private toggle that will return the CURL handle for the request rather than actually completing the request.  This is useful for MultiCURL requests.
Stylestring (Optional) Controls the format of the data returned in Amazon Associates Web Service responses.  Set this parameter to “XML,” the default, to generate a pure XML response.  Set this parameter to the URL of an XSLT stylesheet to have Amazon Associates Web Service transform the XML response.  See ContentType.
Validateboolean (Optional) Prevents an operation from executing.  Set the Validate parameter to True to test your request without actually executing it.  When present, Validate must equal True; the default value is False.  If a request is not actually executed (Validate=True), only a subset of the errors for a request may be returned because some errors (for example, no_exact_matches) are only generated during the execution of a request.  Defaults to FALSE.
XMLEscapingstring (Optional) Specifies whether responses are XML-encoded in a single pass or a double pass.  By default, XMLEscaping is Single, and Amazon Associates Web Service responses are encoded only once in XML.  For example, if the response data includes an ampersand character (&), the character is returned in its regular XML encoding (&).  If XMLEscaping is Double, the same ampersand character is XML-encoded twice (&amp;).  The Double value for XMLEscaping is useful in some clients, such as PHP, that do not decode text within XML elements.  Defaults to ‘Single’.

Returns

ResponseCore object

Examples

Get a list of all possible options for this operation.
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Get a list of available options
$pas = new AmazonPAS();
$response = $pas->help('TransactionLookup', 'Operation');

// View list
print_r($response);

/** [Expected output] 
All possible options for this operation.
*/
?>
AmazonPAS::transaction_lookup
<?php

// Dependencies
require_once 'cloudfusion.class.php';

// Lookup a given transaction ID.
$pas = new AmazonPAS();
$response = $pas->transaction_lookup('102-6791651-3962628');

// Success?
var_dump($response->isOK());

/** [Expected output] 
bool(true)
*/
?>

See Also

AWS Methodhttp://docs.amazonwebservices.com/AWSECommerceService/latest/DG/TransactionLookup.html
Relatedsimilarity_lookup(), tag_lookup()