> ## Documentation Index
> Fetch the complete documentation index at: https://docs.famulor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify Integration

> Real-time access to Shopify orders and e-commerce data directly during customer calls for optimal customer service

# Shopify Integration Template

Integrate the Shopify e-commerce platform into your Mid-call Actions and enable your AI assistant to retrieve order details, check shipping status, and perform order management during customer conversations.

## Overview & Features

<CardGroup cols={2}>
  <Card title="Order Management" icon="box">
    * Real-time access to order details and status
    * Shipping and fulfillment tracking
    * Customer information and order history
    * Inventory and product availability checks
  </Card>

  <Card title="Customer Service Excellence" icon="headset">
    * Instant order status updates
    * Returns and refund management
    * Upselling and cross-selling opportunities
    * Proactive problem resolution
  </Card>
</CardGroup>

## Shopify Admin API Setup

### 1. Shopify App & API Access

<Steps>
  <Step title="Create Private App">
    * Log in as admin to your Shopify store
    * Navigate to "Apps" → "App and sales channel settings"
    * Click "Develop apps" → "Create an app"
    * App name: "Famulor Mid-Call Integration"
  </Step>

  <Step title="Admin API Permissions">
    ```yaml theme={null}
    Required API scopes:
      Orders:
        - read_orders (for order details)
        - write_orders (for order updates)
      
      Customers:
        - read_customers (for customer info)
        
      Products:
        - read_products (for product details)
        
    Optional for advanced features:
      - read_inventory (inventory levels)
      - read_fulfillments (shipping details)
      - read_shipping (shipping options)
    ```
  </Step>

  <Step title="Generate Access Token">
    ```yaml theme={null}
    Token generation:
      1. "Admin API access token" → "Install app"
      2. Copy the access token (very long)
      3. Store the token securely as {{SHOPIFY_ACCESS_TOKEN}}
      4. Note the store name as {{SHOPIFY_STORE}} (without .myshopify.com)
    ```
  </Step>

  <Step title="API Version & Endpoints">
    * Use the current API version: `2024-01`
    * Base URL: `https://store-name.myshopify.com/admin/api/2024-01/`
    * Observe rate limits: 2 calls/second (standard plan)
  </Step>
</Steps>

## Configure Mid-call Action

### Configuration in the Famulor Interface

<Tabs>
  <Tab title="Tool Details">
    | Field                      | Value                                                                                                                                            |
    | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
    | **Name**\*                 | `Shopify Bestellung abrufen`                                                                                                                     |
    | **Description**            | "Fetches detailed order information from Shopify for customer service and order management"                                                      |
    | **Function Name**\*        | `get_shopify_order`                                                                                                                              |
    | **Function Description**\* | "Retrieves details of an order from Shopify. Use this when customers ask about order status, shipping info, or product details of their orders." |
    | **HTTP Method**            | `GET`                                                                                                                                            |
    | **Timeout (ms)**           | `5000`                                                                                                                                           |
    | **Endpoint**\*             | `https://{{SHOPIFY_STORE}}.myshopify.com/admin/api/2024-01/orders/{order_id}.json`                                                               |
  </Tab>

  <Tab title="Header Configuration">
    ```json theme={null}
    {
      "X-Shopify-Access-Token": "{{SHOPIFY_ACCESS_TOKEN}}",
      "Content-Type": "application/json"
    }
    ```
  </Tab>
</Tabs>

### Advanced Parameter Schema

```json theme={null}
{
  "type": "object", 
  "properties": {
    "order_id": {
      "type": "string",
      "description": "Shopify order ID or order name",
      "examples": ["12345678", "#1001", "1234567890123"]
    },
    "include_fulfillments": {
      "type": "boolean",
      "description": "Include fulfillment details?",
      "default": true
    },
    "include_transactions": {
      "type": "boolean", 
      "description": "Include payment transaction details?",
      "default": false
    }
  },
  "required": ["order_id"]
}
```

## Practical Use Cases

### Scenario 1: Order Status Inquiry

<AccordionGroup>
  <Accordion title="Standard Order Query">
    **Typical customer service conversation**:

    ```yaml theme={null}
    Customer: "Where is my order #1001?"

    AI: "I am looking up order #1001..."

    get_shopify_order:
      order_id: "1001"

    Response integration:
      "Your order #1001 for €149.99 was shipped on January 12th. 
       The shipment contains 2 items and should arrive tomorrow. 
       The tracking number is DHL123456789."
    ```
  </Accordion>

  <Accordion title="Problem Resolution">
    **Delayed Delivery**:

    ```yaml theme={null}
    Shopify response analysis:
      fulfillment_status: "unfulfilled"
      days_since_order: 5
      expected_shipping: "1-2 business days"
      
    Proactive communication:
      "I see your order is delayed. I'm sorry about that! 
       We usually ship within 1-2 business days. 
       I am escalating this to our fulfillment team and you will 
       get an update today."

    Automatic actions:
      - Notify fulfillment team
      - Trigger customer compensation workflow
      - Shipping delay analysis for process improvement
    ```
  </Accordion>
</AccordionGroup>

### Scenario 2: Upselling & Cross-Selling

<Tabs>
  <Tab title="Order History Analysis">
    ```yaml theme={null}
    Customer purchase pattern:
      
    Historical orders analysis:
      - Frequently bought together products
      - Average order value trends
      - Seasonal purchase patterns
      - Category preferences

    Real-time recommendations:
      When customer asks about order:
        "Your order for the laptop stand arrives tomorrow. 
         By the way, many customers also buy our ergonomic 
         mouse pad. Are you interested?"
    ```
  </Tab>

  <Tab title="Inventory-Based Offers">
    ```yaml theme={null}
    Stock level integration:
      
    When product inventory is low:
      "Your ordered model is very popular and almost sold out. 
       If you need more, we should order today."

    When related products are available:
      "These accessories perfectly complement your order: 
       [Product Name] is on sale now - 20% off until the weekend."
    ```
  </Tab>
</Tabs>

## Shopify Response Processing

### Full Order Response

```json theme={null}
{
  "order": {
    "id": 12345678,
    "name": "#1001",
    "email": "max@beispiel.de",
    "created_at": "2024-01-12T10:30:00-05:00",
    "updated_at": "2024-01-12T14:20:00-05:00",
    "total_price": "149.99",
    "subtotal_price": "124.99", 
    "tax_lines": [{"price": "25.00", "rate": 0.2, "title": "VAT"}],
    "currency": "EUR",
    "financial_status": "paid",
    "fulfillment_status": "fulfilled",
    "customer": {
      "id": 987654321,
      "first_name": "Max",
      "last_name": "Mustermann",
      "email": "max@beispiel.de",
      "phone": "+49123456789",
      "total_spent": "1249.85",
      "orders_count": 8
    },
    "shipping_address": {
      "first_name": "Max",
      "last_name": "Mustermann", 
      "address1": "Musterstraße 123",
      "city": "Munich",
      "zip": "80331",
      "country": "Germany"
    },
    "line_items": [
      {
        "id": 123456,
        "title": "Ergonomic Laptop Stand",
        "quantity": 1,
        "price": "124.99",
        "sku": "STAND-ERG-001"
      }
    ],
    "fulfillments": [
      {
        "id": 456789,
        "status": "success",
        "tracking_company": "DHL",
        "tracking_number": "DHL123456789",
        "tracking_url": "https://tracking.dhl.de/..."
      }
    ]
  }
}
```

### Natural Language Response

<AccordionGroup>
  <Accordion title="Comprehensive Order Summary">
    **Template**: `"Order {{order_number}} for {{customer_name}}, total amount: {{total}}, status: {{status}}"`

    **Enhanced Customer Communication**:

    ```yaml theme={null}
    Full information:
      "Hello Mr. {{customer_name}}! Your order {{order_number}} 
       for €{{total}} has {{#if fulfillment_status}}already shipped{{else}}been prepared{{/if}}.
       
       {{#if tracking_number}}
       The shipment is with DHL and has the tracking number {{tracking_number}}.
       {{/if}}
       
       {{#if financial_status == 'paid'}}
       The payment has been confirmed.
       {{else}}
       The payment is still being processed.
       {{/if}}"
    ```
  </Accordion>

  <Accordion title="Problem-Solving Integration">
    ```yaml theme={null}
    Context-aware responses:
      
    If fulfillment_status == "unfulfilled":
      "Your order is currently being prepared for shipping. 
       Given current order volumes, this takes about 1-2 business days."
      
    If days_since_order > 5 AND status == "unfulfilled":
      "This is taking unusually long. I will check immediately 
       what's going on and you will receive an update within an hour."
      
    If customer.orders_count > 10:
      "As a loyal customer with {{orders_count}} orders, you of course 
       have priority. How can I assist you today?"
    ```
  </Accordion>
</AccordionGroup>

## Performance & Analytics

### E-Commerce Service KPIs

| Metric                          | Description                                   | Target |
| ------------------------------- | --------------------------------------------- | ------ |
| **Order Lookup Success Rate**   | % of successful Shopify queries               | >98%   |
| **Customer Service Resolution** | % of order inquiries resolved immediately     | >85%   |
| **Cross-sell Conversion**       | % of additional purchases via mid-call offers | >12%   |
| **Customer Satisfaction**       | Rating after order service calls              | >4.7/5 |

## Advanced Shopify Features

### Multi-Store Management

<AccordionGroup>
  <Accordion title="Shopify Plus Features">
    ```yaml theme={null}
    Multi-store configuration:
      
    Regional stores:
      EU Store: "shop-eu.myshopify.com"
      US Store: "shop-us.myshopify.com" 
      UK Store: "shop-uk.myshopify.com"
      
    Automatic store detection:
      - Customer phone number → region detection
      - Order ID pattern → store identification
      - Currency preference → store routing
    ```
  </Accordion>

  <Accordion title="B2B Features for Shopify Plus">
    ```yaml theme={null}
    B2B order features:
      - Company account management
      - Bulk order tracking
      - Custom pricing tiers
      - Purchase order numbers
      
    Integration enhancements:
      - Include company name in customer communication
      - Bulk discount calculations
      - B2B-specific order status messages
      - Account manager assignment logic
    ```
  </Accordion>
</AccordionGroup>

***

<Warning>
  **API Rate Limits**: The Shopify API enforces strict rate limits (2 calls/second standard, 4 calls/second Shopify Plus). Implement smart caching for frequently queried orders.
</Warning>

<Info>
  **Customer Service Tip**: Use the customer total spent and orders count from the API for personalized communication and VIP treatment decisions.
</Info>

<Tip>
  Related pages: [Introduction](/en/automation-platform/introduction) and [Building Flows](/en/automation-platform/building-flows), and [Debugging Runs](/en/automation-platform/debugging-runs).
</Tip>

<Tip>
  Need a whole toolset instead of building HTTP actions one by one? Connect an external **MCP server** — tools are discovered automatically. See [MCP Servers](/en/platform/mcp-servers).
</Tip>
