Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →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 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.
- Login to your ShipStation account
- Click on the settings icon in the upper right corner. A column menu will show up on the left
- Click Account -> API Settings
- 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
-
Install the module:
Install-Module ShipStationCmdlets
-
Connect:
$shipstation = Connect-ShipStation -APIKey "$APIKey" -APISecret "$APISecret"
-
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
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for ShipStation\lib\System.Data.CData.ShipStation.dll")
-
Connect to ShipStation:
$conn= New-Object System.Data.CData.ShipStation.ShipStationConnection("APIKey='YourAPIKey';APISecret='YourAPISecret'") $conn.Open()
-
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 }