Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Is Cart data available in Powershell?

Is Cart data available in Powershell?

BruceX
Visitor
2 0 0

Hi

I am accessing Products data from Shopify with Powershell with the following powershell script. It works really well.

##############

$apikey = "myapikey"
$password = "mypassword"
$uri = "https://rocky-bay-eppic.myshopify.com/admin/api/2022-01/products.json"
$headers = @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($apikey+":"+$password))}
$jsondata = Invoke-WebRequest -Uri $uri -contentType "application/json" -Method Get -Headers $headers -UseBasicParsing

[string]$json = $jsondata.content

write-host $json

################

But how can I access Shopify Cart data in Powershell? If I simply substitute ‘products’ with ‘cart’ above, I get…

error: The remote server returned an error: (401) Unauthorized.

If cart is managed differently would you be able to let me know please.

Replies 0 (0)