Set up Shopify using public apps
Learn how to set up the Shopify integration using the public apps approach to merchant data connection
Set up the Shopify integration to retrieve commerce data from customers who sell their products on Shopify's ecommerce software.
This article explains how to set up the Shopify integration using the public apps approach.
You will learn how to...
Before you begin
Before setting up the integration, make sure that you:
- Understand how public apps work.
- Have built an endpoint that can be used to identify a merchant on your system.
Create a public Shopify app
When the app is created, you can view the app's secure credentials.
-
Log in to the Shopify Partners site using your Shopify partner account credentials.
Shopify partner accountCreate a partner account if you don't already have one.
-
In the side panel, click Apps.
-
On the Apps page, click Create app.
-
In the Use Shopify Partners box, click Create app manually.
-
On the Create an app manually page, enter the requested information:
- App name: enter a name for your app. Do not use Shopify as part of the app name.
- App URL: enter
https://commerceintegration.codat.io/publicApp/{your-client-id}
- Allowed redirection URL(s): enter
https://commerceintegration.codat.io/oauth/callback
-
Click Create app. Your app is created and the app page is displayed.
-
In the side panel, click App setup to view the app's configuration settings.
-
Optional: if you plan to use Codat's
commerce-customers
data type, do the following on the App setup page:- In the Protected customer data access box, click Request access.
- Enter the details requested in the dialog, then submit your request to Shopify.
This is required because this data type requests customer data including name, address, phone, or email fields.
-
Optional: if you need to access over 60 days' of orders, do the following on the App setup page:
- In the Read all orders scope box, click Request access.
- Enter the details requested in the dialog, then submit your request to Shopify.
-
In the GDPR mandatory webhooks section, enter the following Codat webhook URLs:
- Customer data request endpoint:
https://commerceintegration.codat.io/webhooks/{your-client-id}/customer/request
- Customer data erasure endpoint:
https://commerceintegration.codat.io/webhooks/{your-client-id}/customer/redact
- Shop data erasure endpoint:
https://commerceintegration.codat.io/webhooks/{your-client-id}/shop/redact
- Click the Save button that appears at the top of the page.
Your app's API key and API secret key are shown in the App credentials section of the App setup page. You'll need these when you add your app's credentials to the integration.
If you plan to charge for your app, you will need to integrate to Shopify's billing API.
Submit your app to Shopify for approval
Your public app must be approved by Shopify before you can use the integration with a Production Store. The review and approval process might take up to two weeks.
In the Shopify Partners site:
- Click the name of your app.
- In the side panel, click Distribution.
- On the Distribution page, click Choose Shopify App Store, then confirm your selection in the dialog that appears.
-
Click Create listing.
-
Select your Shopify partner account at the authentication prompt. The App listing page for your app opens.
-
Click App visibility.
-
In the Manage app visibility dialog, select Unlisted, unless you want your app to be visible in the public Shopify App Store, then click Save.
Differences between listed and unlisted appsYou can make your Shopify app listed (fully visible in the Shopify App Store) or unlisted (it will not appear in Shopify App Store search engines or results). Both types of apps have a public Shopify App Store URL.
-
Click Start listing. The English listing page is displayed.
-
Enter all the required listing information and save the form.
-
On the App listing page, click the Submit app button at the top right. The button is not available until you've completed all the required listing information.
Your app is then sent to Shopify for review and approval.
Additionally, if you need access to over 60 days of orders from Shopify stores, you must submit a Read all orders request, as noted in Create a Shopify public app. You'll receive an email from Shopify when your request has been processed. This might take up to seven business days.
Codat can't guarantee that Shopify will approve your public app or grant access to over 60 days of order data.
Build an app for merchant authorization
When a merchant adds your app to their store, we need to be able to identify them. To do that, we will redirect them to the App Redirect URL endpoint you entered in the integration settings at the end of the auth flow.
We will generate and include a code
query string parameter in the initial redirect to maintain context. Allow the user to authenticate themselves on the redirect page, and then create (or use an existing) Codat company and data connection. The data connection response will contain a linkURL
. Append the code
to the query string of the URL and redirect the user to complete their auth flow with us.
Add your app's credentials to the Shopify integration
In the Codat Portal, add the secure credentials for your Shopify app to the integration.
-
On the navigation bar, select Settings > Integrations > Commerce.
-
Click Set up next to the Shopify integration.
The Integration settings page is displayed.
-
Enter your app's credentials from Shopify (to find these, see Create a Shopify public app).
- For Client ID, enter the API key from Shopify.
- For Client secret, enter the API secret key from Shopify.
- For App Redirect URL, enter the location of your authentication endpoint.
-
If you requested access to over 60 days of orders and your access was approved, turn on Has request to read all orders. Otherwise leave this setting turned off.
-
Under Access to company data, configure the permitted sync frequency for the integration. Select Allow one-off data sync… or Allow continuous data sync.
-
Click Save.
Enable the Shopify integration
- In the Codat Portal, go to the Commerce integrations page.
- Locate Shopify and click the toggle to enable the integration.
You can also click Manage to view the integration's settings page and then enable the integration from there.
Check the commerce sync settings
All commerce data types must be enabled before you can read commerce transactions from Shopify to Codat. Follow the steps in Commerce sync settings. You only need to do this once.
Next steps
Test your Shopify integration before sending Link URLs to merchants.