Shopify Grid Integration

The Shopify Grid integration allows e-commerce and sales teams to view, search, add, inline-edit, delete, and download records from Shopify (Products, Orders, and Customers) directly inside AppColab Grid.

Shopify Live Grid Preview


What’s Deployed

Component Name Purpose
Named Credential Shopify Connects to your store’s https://YOUR_STORE.myshopify.com endpoint
External Credential Shopify Custom authentication with X-Shopify-Access-Token: <token>
Apex Client ShopifyClient.cls REST client supporting listResources, getResource, createResource, updateResource, deleteResource
Apex Data Provider ShopifyGridDataProvider.cls Implements appcg.GridDataProviderV1 and appcg.GridDataMutationProviderV1 with full CRUD for Products/Customers and Read for Orders
Permission Set Integration_Admin Grants access to Shopify → ApiKey external credential principal

One-Time Manual Setup

1. Generate Your Shopify Admin API Access Token

[!NOTE] Shopify supports two app creation methods depending on your store type:

Option A: Modern Developer Dashboard (dev.shopify.com — Recommended for Partner/Dev Stores)

  1. Open your app in dev.shopify.com (or click Create app).
  2. Under Versions, create or edit a version:
    • App URL: https://localhost
    • Embed app in Shopify admin: Unchecked
    • API access scopes: Select read_products, write_products, read_orders, read_customers, write_customers.
    • Click Release.
  3. Under App settings, copy your Client ID and Client Secret.
  4. Open the authorization link in your browser:
    https://admin.shopify.com/store/YOUR_STORE_NAME/oauth/authorize?client_id=YOUR_CLIENT_ID&scope=read_products,write_products,read_orders,read_customers,write_customers&redirect_uri=https://localhost
    
  5. Click Install app. The browser will redirect to https://localhost/?code=YOUR_CODE&.... Copy the code from the browser address bar.
  6. Exchange the code for your permanent offline token (shpat_...):
    • PowerShell:
      curl -X POST "https://YOUR_STORE_NAME.myshopify.com/admin/oauth/access_token" -H "Content-Type: application/json" -d '{\"client_id\":\"YOUR_CLIENT_ID\",\"client_secret\":\"YOUR_CLIENT_SECRET\",\"code\":\"YOUR_CODE\"}'
      
    • Postman / cURL: Send a POST request to https://YOUR_STORE_NAME.myshopify.com/admin/oauth/access_token with JSON body:
      {
        "client_id": "YOUR_CLIENT_ID",
        "client_secret": "YOUR_CLIENT_SECRET",
        "code": "YOUR_CODE"
      }
      
  7. Copy the access_token (shpat_...) from the response.

Option B: Store Admin Custom App (admin.shopify.com — Production Stores)

  1. In your Shopify Store Admin, navigate to:
    https://admin.shopify.com/store/YOUR_STORE_NAME/settings/apps/development
    (or go to Settings ⚙️ → Apps and sales channels → Develop apps).
  2. Click Create an app (e.g. AppColab Grid).
  3. Under the Configuration tab, click Configure next to Admin API integration:
    • Enable scopes: read_products, write_products, read_orders, read_customers, write_customers.
    • Click Save.
  4. Go to the API credentials tab → click Install app → confirm Install.
  5. Under Admin API access token, click Reveal token once and copy the token (shpat_...).

Shopify App Setup


2. Configure Credentials in Salesforce Setup

2.1 Create the External Credential

  1. Go to Setup (gear icon ⚙️ → Setup).
  2. In the Quick Find box, enter Named Credentials and select Named Credentials.
  3. Click the External Credentials tab → click New:
    • Label: Shopify
    • Name: Shopify
    • Authentication Protocol: Custom
    • Click Save.
  4. In the Principals section, click New:
    • Parameter Name: ApiKey
    • Sequence: 1
    • Click Save.
  5. In the Custom Headers section, click New:
    • Name: X-Shopify-Access-Token
    • Value: shpat_YOUR_TOKEN (paste the token copied from Step 1)
    • Sequence Number: 1
    • Click Save.

Shopify External Credential Setup

2.2 Create the Named Credential

  1. Click the Named Credentials tab (next to External Credentials) → click New:
    • Label: Shopify
    • Name: Shopify
    • URL: Enter your store’s URL (e.g. https://your-store.myshopify.com)
    • External Credential: Select Shopify
    • Generate Authorization Header: Leave Unchecked
    • Allow Formulas in HTTP Header: Checked
  2. Click Save.

Shopify Named Credential Setup


3. Assign Permission Set Access

  1. In Salesforce Setup, enter Permission Sets in Quick Find.
  2. Select Integration Admin (or Appcolab Grid Admin).
  3. Click External Credential Principal Access → click Edit.
  4. Add Shopify - ApiKey to Enabled External Credential Principals.
  5. Click Save and verify the permission set is assigned to your Salesforce users.

Creating a Shopify Grid Definition

  1. In Salesforce, open AppColab Grid app → Grid Definitions tab → click New Grid Definition.
  2. Fill in:
    • Grid Settings Name: Shopify_Products_Grid
    • Grid Label: Shopify Products
    • Is Active?: Checked
    • Data Provider Class: ShopifyGridDataProvider
    • Data Provider Configuration:
      {
        "resource": "products"
      }
      

      Tip: Change "resource" to "customers" or "orders" to create dedicated grids for those entities.

  3. Click Save & Next → proceed to Preview.
  4. All Shopify products load live with Title, Vendor, Product Type, Status, and Creation Date!

Shopify Grid Definition


Supported Grid Features

Resource Supported Actions Columns
Products View, Search, Inline Edit, Add Product, Delete Title, Product Type, Vendor, Status, Tags, Created At
Orders View, Search, Filter, Export Order Name, Customer, Email, Total Price, Financial Status, Fulfillment Status, Date
Customers View, Search, Inline Edit, Add Customer, Delete First Name, Last Name, Email, Phone, Orders Count, Total Spent, State

Troubleshooting

  • 401 Unauthorized / [API] Invalid API key or access token: Verify that the header name is exactly X-Shopify-Access-Token and the token begins with shpat_.
  • 403 Forbidden / [API] This action requires merchant approval: Check that your Shopify private app has the requested Admin API scopes (read_products, read_orders, etc.).