Ready to get started?

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

 Download Now

Learn more:

ShipStation Icon ShipStation ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with ShipStation.

Automate ShipStation Integration Tasks from PowerShell



Are you in search of a quick and easy way to access ShipStation data from PowerShell? This article demonstrates how to utilize the ShipStation Cmdlets and the CData ADO.NET Provider for ShipStation for tasks like connecting to ShipStation data, automating operations, downloading data, and more.

The CData Cmdlets for ShipStation are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to ShipStation.

PowerShell Cmdlets or ADO.NET Provider?

The Cmdlets are not only a PowerShell interface to ShipStation, but also an SQL interface; this tutorial shows how to use both to retrieve ShipStation data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for ShipStation. To access ShipStation data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for ShipStation.

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

Use the BASIC Authentication standard to connect.

  1. Login to your ShipStation account
  2. Click on the settings icon in the upper right corner. A column menu will show up on the left
  3. Click Account -> API Settings
  4. On the API Settings page, note the API Key and API Secret.

Authenticating to ShipStation

  • APIKey: Set this to the API key from the API settings page.
  • APISecret: Set this to the Secret key from the API settings page.

PowerShell

  1. Install the module:

    Install-Module ShipStationCmdlets
  2. Connect:

    $shipstation = Connect-ShipStation -APIKey "$APIKey" -APISecret "$APISecret"
  3. Search for and retrieve data:

    $customerid = "1368175" $tags = Select-ShipStation -Connection $shipstation -Table "Tags" -Where "CustomerId = `'$CustomerId`'" $tags

    You can also use the Invoke-ShipStation cmdlet to execute SQL commands:

    $tags = Invoke-ShipStation -Connection $shipstation -Query 'SELECT * FROM Tags WHERE CustomerId = @CustomerId' -Params @{'@CustomerId'='1368175'}

ADO.NET

  1. Load the provider's assembly:

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

    $conn= New-Object System.Data.CData.ShipStation.ShipStationConnection("APIKey='YourAPIKey';APISecret='YourAPISecret'") $conn.Open()
  3. Instantiate the ShipStationDataAdapter, execute an SQL query, and output the results:

    $sql="SELECT Id, Color from Tags" $da= New-Object System.Data.CData.ShipStation.ShipStationDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.id $_.color }