Follow the steps below to install the Shopify Connector.
Install the connector as hosted service on an IIS website
Follow the guide Install a eCommerce connector as hosted service
Shopify account
To enable access from the connector to the shop, update the appsettings.json file with the required credentials.
Option 1: Client Credentials (recommended)
Add the following settings:
BaseUri
ClientId
ClientSecret
Option 2: Long-Lived Access Token (legacy)
Shopify previously supported long-lived access tokens. While it is no longer possible to generate new tokens, existing tokens can still be used.
To use a long-lived access token, replace ClientId and ClientSecret with:
BaseUri
AccessToken
Steps to generate Client Credentials:
Create App: Create a new Shopify App via “dev dashboard” https://dev.shopify.com/dashboard/
Click “Create App” and add a new e.g. Perfion Connector and click Create:
Add Scopes:
The minimum Scopes to add is “write_products, read_products, write_publications, read_publications, read_inventory, write_inventory, write_files, read_files, write_translations, read_translations, write_metaobject_definitions, read_metaobject_definitions, write_metaobjects, read_metaobjects, read_locales”
If file_reference is used the write_files, read_files access needed as well.
If the Translations functionality is activated the write_translations, read_translations access needed as well.
If Locations are used the read_locations access needed as well.
Click Release
Get Client Credentials:
Go to the Settings menu and copy the Client ID and Secret and insert this information in the appsettings.json file.
Distribute the App:
Go to the Home menu and click Select distribution method at the right side of the page.
Insert the Store domain and click Generate link
Copy the link
Install the App:
Insert the link in a browser and install the app to the store:
Update Scopes:
To update the scope for the app a new version must be created:
Go to the “dev dashboard” https://dev.shopify.com/dashboard/ and select the app e.g. Perfion Connector.
Go to the Versions menu and click Create a version.
Change the Scopes and click release
Go to the Shopify Admin https://admin.shopify.com/ and search for the App name. Select the app in the search result
Click update to update the app in the store.
Logging and debugging
It is possible to enable logging/debugging via Serilog. To setup Serilog, add serilog configuration to the appsettings.json file. An example of a Serilog setup:
{
"PerfionApi": {
"GetDataUri": "https://<url>/perfion/getdata.asmx",
"PerfionToken": "1234567890JIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJBZG1pbiIsImp0aSI6IjkxYjA0NzNhLWM0Y2MtNDlkMy04YmIwLThmYTBlNTM5YjkxZSIsImlhdCI6MTcwNDg4NzQzNiwibmJmIjoxNzA0ODg3NDM2LCJleHAiOjE3OTEyODc0MzYsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiJBZG1pbiIsIlBlcmZpb25Vc2VyIjoiQWRtaW4iLCJpc3MiOiJQZXJmaW9uLkFQSVNlcnZpY2UiLCJhdWQiOiJQZXJmaW9uLkNsaWVudCJ9.DNtuNhu7-0SSvMDQ3-WJDi-NhdBpZxMET1234567890",
"Channel": "Shopify Channel"
},
"ShopifyApi": {
"BaseUri": "https://test-shop.myshopify.com/",
"TimeOut": 789,
"AccessToken": "shpat_123456789096d4ac1be38deed5ea1271"
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"System": "Warning",
"Microsoft": "Warning"
}
},
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "c:/temp/logs/log.txt",
"rollingInterval": "Day",
"fileSizeLimitBytes": null,
"retainedFileCountLimit": 15,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] [{SourceContext}] [{RequestId}] : {Message} {Exception}{NewLine}"
}
}
]
}
}An example of a Serilog setup for logging to the console:
{
"PerfionApi": {
"GetDataUri": "https://<url>/perfion/getdata.asmx",
"PerfionToken": "1234567890JIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJBZG1pbiIsImp0aSI6IjkxYjA0NzNhLWM0Y2MtNDlkMy04YmIwLThmYTBlNTM5YjkxZSIsImlhdCI6MTcwNDg4NzQzNiwibmJmIjoxNzA0ODg3NDM2LCJleHAiOjE3OTEyODc0MzYsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiJBZG1pbiIsIlBlcmZpb25Vc2VyIjoiQWRtaW4iLCJpc3MiOiJQZXJmaW9uLkFQSVNlcnZpY2UiLCJhdWQiOiJQZXJmaW9uLkNsaWVudCJ9.DNtuNhu7-0SSvMDQ3-WJDi-NhdBpZxMET1234567890",
"Channel": "Shopify Channel"
},
"ShopifyApi": {
"BaseUri": "https://test-shop.myshopify.com/",
"TimeOut": 789,
"AccessToken": "shpat_123456789096d4ac1be38deed5ea1271"
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"System": "Information",
"Microsoft": "Information",
"Perfion.LicenseServer.Utils.ApiKeyAuthenticationHandler": "Information"
}
},
"WriteTo": [ "Console" ]
}
}
Comments
0 comments
Please sign in to leave a comment.