Automate Amazon Marketplace Integration Tasks from PowerShell

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Are you in search of a quick and easy way to access Amazon Marketplace data from PowerShell? This article demonstrates how to utilize the Amazon Marketplace Cmdlets for tasks like connecting to Amazon Marketplace data, automating operations, downloading data, and more.

The CData ADO.NET Provider for Amazon Marketplace is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Amazon Marketplace.

ADO.NET Provider

The ADO.NET Provider provides a SQL interface for Amazon Marketplace; this tutorial shows how to use the Provider to retrieve Amazon Marketplace data.

Once you have acquired the necessary connection properties, accessing Amazon Marketplace data in PowerShell can be enabled in three steps.

To connect to the Amazon Marketplace Webservice (MWS), AWSAccessKeyId, MWSAuthToken, AWSSecretKey and SellerId are required. You can optionally set the Marketplace property. For more information on obtaining values for these properties, refer to the Help documentation.

  1. Load the provider's assembly:

    
    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Amazon Marketplace\lib\System.Data.CData.AmazonMarketplace.dll")
        
  2. Connect to Amazon Marketplace:

     
    $conn= New-Object System.Data.CData.AmazonMarketplace.AmazonMarketplaceConnection("AWS Access Key Id=myAWSAccessKeyId;AWS Secret Key=myAWSSecretKey;MWS Auth Token=myMWSAuthToken;Seller Id=mySellerId;Marketplace=United States;")
    $conn.Open()
    
  3. Instantiate the AmazonMarketplaceDataAdapter, execute an SQL query, and output the results:

    
    $sql="SELECT AmazonOrderId, OrderStatus from Orders"
    
    $da= New-Object System.Data.CData.AmazonMarketplace.AmazonMarketplaceDataAdapter($sql, $conn)
    $dt= New-Object System.Data.DataTable
    $da.Fill($dt)
    
    $dt.Rows | foreach {
    	Write-Host $_.amazonorderid $_.orderstatus
    }
      

Ready to get started?

Download a free trial of the Amazon Marketplace Data Provider to get started:

 Download Now

Learn more:

Amazon Marketplace Icon Amazon Marketplace ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Amazon Marketplace data including InventoryItems, Orders, Products, and more!