ShopifySalesforce

Connect Shopify with Salesforce

Integrate Shopify and Salesforce to sync customers, orders, and inventory. Technical guide covering OAuth 2.0, webhooks, and REST API implementation for B2B SaaS.

Published20 April 2026
Last Updated30 April 2026
Reading Time12 min read

Implementation Guide

Overview

The synchronization between Shopify and Salesforce represents the gold standard for modern e-commerce architecture. By bridging the gap between a high-volume transactional engine and a robust Customer Relationship Management (CRM) platform, enterprises can achieve a true Customer 360 view. This integration ensures that every customer interaction, from the initial storefront visit to the final fulfillment and subsequent support ticket, is captured within a unified data ecosystem. Technically, this involves orchestrating the Shopify Admin API (REST or GraphQL) with the Salesforce REST API or Bulk API 2.0. The primary objective is to eliminate data silos, ensuring that sales teams have real-time visibility into order history, while marketing teams can leverage purchase behavior for hyper-targeted segmentation.

Core Prerequisites

Before initiating the integration, several technical requirements must be satisfied on both platforms. On the Shopify side, you must create a Custom App within the Shopify Admin to generate an Admin API access token. The required OAuth 2.0 scopes typically include read_orders, read_customers, read_products, and read_inventory. It is critical to use the latest API version (e.g., 2024-01) to ensure compatibility with the newest schema changes.

On the Salesforce side, a Connected App must be configured to facilitate OAuth 2.0 authentication. This app requires the api, refresh_token, and offline_access scopes. Furthermore, the Salesforce user account associated with the integration must have the 'API Enabled' permission and sufficient Object-Level Security (OLS) and Field-Level Security (FLS) to create and update Accounts, Contacts, Opportunities, and custom objects. We recommend creating a dedicated Integration User to maintain a clean audit trail. Additionally, ensure that your Salesforce edition (Enterprise, Unlimited, or Developer) supports REST API access.

Top Enterprise Use Cases

  1. Real-Time Lead and Contact Synchronization: When a new customer checks out on Shopify, the integration triggers a lookup in Salesforce. If no matching record exists based on the email address, a new Lead or Contact is created. This ensures that the sales pipeline is always populated with fresh, high-intent data.

  2. Order-to-Opportunity Mapping: Every Shopify order can be mapped to a Salesforce Opportunity or a custom 'Order' object. This allows for complex revenue reporting within Salesforce, including the calculation of Customer Lifetime Value (CLV) and the tracking of high-value accounts.

  3. Inventory and Product Catalog Alignment: Maintaining parity between Shopify products and Salesforce Price Books is essential for B2B organizations. When a product price or stock level changes in Salesforce (acting as the Master Data Management system), the integration pushes updates to Shopify via the /admin/api/2024-01/products/{product_id}.json endpoint.

  4. Automated Post-Purchase Workflows: By syncing Shopify order tags and fulfillment status to Salesforce, marketing teams can trigger automated journeys in Marketing Cloud or Account Engagement (Pardot) based on specific product purchases or shipping delays.

Step-by-Step Implementation Guide

Step 1: Shopify Webhook Configuration

To achieve real-time updates, configure Shopify webhooks to notify your middleware or Salesforce endpoint. A typical payload for an orders/create event looks like this:

{
  'id': 123456789,
  'email': '[email protected]',
  'total_price': '150.00',
  'currency': 'USD',
  'line_items': [
    {
      'variant_id': 987654,
      'quantity': 1,
      'price': '150.00',
      'sku': 'SKU-001'
    }
  ],
  'customer': {
    'first_name': 'Jane',
    'last_name': 'Doe'
  }
}

Step 2: Salesforce Authentication

The integration must authenticate using the OAuth 2.0 Web Server Flow or JWT Bearer Flow. Upon successful authentication, Salesforce returns an access_token and an instance_url.

Step 3: Data Mapping and Upsert Logic

To prevent duplicate records, use the Salesforce Upsert operation with an External ID. For example, use the Shopify Customer ID as an External ID on the Salesforce Contact object. The HTTP request would look like:

Endpoint: PATCH /services/data/v60.0/sobjects/Contact/Shopify_ID__c/123456789

Payload:

{
  'FirstName': 'Jane',
  'LastName': 'Doe',
  'Email': '[email protected]',
  'MailingCity': 'New York'
}

Step 4: Handling Line Items

For each item in the Shopify line_items array, create a corresponding OpportunityLineItem in Salesforce. This requires looking up the PricebookEntryId associated with the SKU provided by Shopify.

Common Pitfalls & Troubleshooting

1. Rate Limiting (HTTP 429): Shopify employs a 'Leaky Bucket' algorithm for its REST API, allowing for 40 requests per second per app per shop. If you exceed this, Shopify returns an HTTP 429 error. Your integration logic must include a retry mechanism with exponential backoff, monitoring the X-Shopify-Shop-Api-Call-Limit header.

2. Salesforce Concurrent Request Limits: Salesforce limits the number of long-running synchronous requests. If your integration performs complex Apex triggers upon record insertion, you may hit these limits. To mitigate this, consider using Salesforce Platform Events or the Bulk API 2.0 for high-volume data transfers.

3. Data Type Mismatches: A common failure point is the mismatch between Shopify's flexible JSON strings and Salesforce's strict field types (e.g., Picklists or Currency fields). Ensure that your middleware validates and transforms data—such as converting Shopify's ISO 8601 timestamps into the format expected by Salesforce.

4. Authentication Failures (HTTP 401): If the Salesforce access_token expires, the integration must use the refresh_token to obtain a new session. Failure to handle this gracefully will result in data gaps. Always log the full response body of a 401 error to distinguish between an expired token and insufficient permissions.

Need a different integration?

If you can't find the guide you need, submit a request and I'll add it to the publishing queue.

Request an integration →