Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Thursday, May 29
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Salesforce»Integration»How to Seamlessly Integrate Shopify with Salesforce

    How to Seamlessly Integrate Shopify with Salesforce

    Dhanik Lal SahniBy Dhanik Lal SahniJune 26, 2024No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Salesforce Shopify Integration - Salesforce
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Shopify is an excellent platform to start an e-commerce business with ease. It provides tools and features for setting up a website, managing products, processing payments, handling shipping, and tracking sales. Businesses also want to track Shopify orders in Salesforce to provide better customer service to the customer. For this, we have to sync Shopify orders into Salesforce. This post will explain how to integrate Shopify with Salesforce CRM seamlessly.

    We can integrate Shopify with Salesforce using Apex REST API to manually sync Shopify orders and other related records or set up a webhook in Shopify to notify newly created data to Salesforce. We have another post-Shopify integration with Salesforce using Webhook that shows how to integrate Shopify and Salesforce using Webhook. This post will integrate Shopify using REST API callout in Salesforce.

    Use Case to Integrate Shopify with Salesforce

    We want to sync Shopify products into the Salesforce Product object. Records should be synced daily to update quantity information.

    Solution

    To handle the above requirement we will follow the below steps and Integrate Shopify with Salesforce.

    1. Setup Shopify and get API Credential
    2. Setup Named and External Credentials in Salesforce
    3. Prepare a Custom Object for the Product Sync
    4. Create Apex Class to Integrate Shopify
    5. Test Functionality

    1. Setup Shopify and get API Credential

    We need an API credential to integrate Shopify into Salesforce. We can get these details from Shopify Admin. If you want to set up yourself then follow these steps in Shopify.

    1. 1 Create a Developer App in Shopify

    Open Shopify admin and go to the settings page. Select Apps and sales channels menu to open the App creation page.

    Shopify App Creation for Salesforce Integration - Salesforce Shopify Integration

    Click the Develop Apps button to create a new application for Salesforce integrations. Click Create an app button to create a new Salesforce integrations app.

    Shopify App Creation for Salesforce  -  Shopify Salesforce Integration

    1. 2 Setup Admin Access

    Once the App is created, open its configuration page. We will provide access to this app so that Salesforce or any third-party application can retrieve records. As we need to get all products, we will provide access to read_products API access. Similar to this we can provide multiple API access in the same app,

    Shopify Admin Access for Salesforce Integration- Salesforce Shopify

    1.3 Get Admin Access Key

    Create an admin access key from the API credential tab of the app. Once Admin access is created, scroll down to the same tab page to see the Admin API credential.

    Shopify Admin Key for Salesforce Integration

    2. Setup Named and External Credentials in Salesforce

    Salesforce’s Named Credentials securely store and manage authentication credentials for external services or endpoints. Let us create a Named Credential and External Credential for the Shopify API.

    Create an External Credential in Salesforce

    External Credentials hold authentication protocols, authentication parameters and permission set-related information for calling external systems. Let us create an external credential Shopify EC(ShopifyEC) for the Shopify System.

    External Credential in Salesforce - Integrate Shopify with Salesforce

    We will use admin credentials to connect Shopify API. Admin key will be stored in External Credential as an Authentication parameter. We also need to create a Principal that will be used to assign external credentials in permission sets. Refer to our other post Accessing External Credential Parameters of Named Credential in Salesforce Apex to use authentication parameters.

    External Credential Parameters in Salesforce - Integrate Shopify with Salesforce

    Create Named Credential

    Create a named credential Shopify Sync NC (ShopifySyncNC) and assign the above-created External Credential to it. Check Generate Authorization Header and Allow Formulas in HTTP Header in Callout Options to pass external credential parameters at runtime to callout.

    Named Credential in Salesforce  -Integrate Shopify with Salesforce

    Create a Permission Set and Assign it to yourself

    Create a permission set Shopify User PS and add the above external credentials to the External Credential Principal Access section. Once the permission set is created assign this to the required user.

    3. Prepare a Custom Object for the Product Sync

    Create a custom object to Sync Shopify API into Salesforce Org. You can also sync API records into any existing custom object or standard object like Product2.

    For this post, I have created a custom object named Shopify Products (ShopifyProduct__c) and below custom fields to store Shopify Information. You can create custom fields based on your requirements.

    Field LabelField APIType
    ActiveActive__cCheckbox
    Product NumberNameAuto Number
    DescriptionDescription__cRich Text Area
    Product NameProductName__cText
    Product TypeProductType__cText
    VendorVendor__cText
    TagsTags__cText

    4. Create an Apex Class to Integrate Shopify API

    Create an apex class ShopifyProductSyncService that will integrate Shopify API in Salesforce. The complete code for this class is added below. We can also add the apex class ShopifyProductSyncController to provide an invocable method. This method can be called from Flow Action.

    We can also use a generic apex class to connect any Shopify system. You can refer generic code from the post Generic Apex class for Calling External System.

    I have used the ApplicationException class to log any runtime exception. You can check our post Exception Logging in Custom Object : Salesforce Apex to learn about logging exceptions in custom objects. You can use your architecture to log runtime errors to manage integration.

    As product sync should be a daily activity, you can set up this class as a scheduled class and run it regularly.

    Test Functionality

    You can test the above-created apex class using Screen Flow or Apex execution. I have called the above class from another class and can sync product records.

    Shopify Synced Records in Salesforce

    References

    Shopify Product API

    Shopify REST API Authentication

    Related Posts

    Shopify integration with Salesforce using Webhook

    Accessing External Credential Parameters of Named Credential in Salesforce Apex

    Generic Apex class for Calling External System

    Download S3 File in Salesforce using AWS Signature Version 4.0

    Use Named Credential to Upload File in S3

    Displaying Tabular Data with GraphQL in Lightning Web Component

     Automating data synchronization between Salesforce and Amazon Seller

    Need Help?

    Need some kind of help in implementing this feature, connect on my LinkedIn profile Dhanik Lal Sahni.

    apex architecture integration rest api salesforce salesforce apex shopify admin api shopify api
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleUltimate Guide to URL Accessibility in LWC
    Next Article Ultimate Guide to Integrate Stripe with Salesforce CRM
    Dhanik Lal Sahni
    • Website
    • Facebook
    • X (Twitter)

    With over 18 years of experience in web-based application development, I specialize in Salesforce technology and its ecosystem. My journey has equipped me with expertise in a diverse range of technologies including .NET, .NET Core, MS Dynamics CRM, Azure, Oracle, and SQL Server. I am dedicated to staying at the forefront of technological advancements and continuously researching new developments in the Salesforce realm. My focus remains on leveraging technology to create innovative solutions that drive business success.

    Related Posts

    By Dhanik Lal Sahni4 Mins Read

    How to Build a Generic Modal Window in Lightning Web Component

    May 26, 2025
    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • How to Build a Generic Modal Window in Lightning Web Component
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (111) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) file upload (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (30) Lightning web component (62) lwc (51) named credential (8) news (4) optimize apex code (4) Permission set (4) pmd (3) Queueable (9) rest api (23) S3 Server (4) salesforce (141) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.