Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Mercaline2024/Ecomdrop-ia-connector-2/llms.txt

Use this file to discover all available pages before exploring further.

Features

Ecomdrop IA Connector provides a comprehensive set of features to integrate your Shopify store with Ecomdrop and Dropi platforms. This page covers all major features with examples and use cases.

Product Management

Import Products from Dropi

Browse and import products from Dropi’s extensive catalog directly into your Shopify store.
The product import feature supports both favorite products and private products from your Dropi account.
Key Capabilities:
  • Search Products: Search by product ID, name, or SKU
  • Pagination: Browse through products with efficient pagination (10 products per page)
  • Filters: Toggle between favorite products and private products
  • Product Preview: View product images, prices, stock levels, and warehouse information
// Example: Fetching Dropi products with filters
const params = new URLSearchParams();
params.append("pageSize", "10");
params.append("startData", "0");
params.append("favorite", "true"); // or "privated_product": "true"

const response = await fetch(`/api/dropi/products?${params}`);
const data = await response.json();

Product Association

Link Dropi products with existing Shopify products to enable automatic order processing.

Variant Mapping

Map Dropi product variations to Shopify variants for accurate inventory tracking

Sync Options

Choose what to sync: name, description, images, barcodes, and pricing
Sync Configuration Options:
OptionDescriptionDatabase Field
Save Dropi NameImport product name from DropisaveDropiName
Save Dropi DescriptionImport product descriptionsaveDropiDescription
Use Suggested BarcodeUse Dropi’s suggested barcodeuseSuggestedBarcode
Save Dropi ImagesImport product imagessaveDropiImages

Synchronized Products View

Manage all your synchronized products from a dedicated interface:
  • View Dropi product ID and name
  • View corresponding Shopify product ID and title
  • Delete associations when needed
  • Track sync history with creation and update timestamps
Deleting a product association does not delete the product from Shopify or Dropi. It only removes the link between them.

Ecomdrop Integration

API Key Configuration

Connect your Ecomdrop account by configuring your API key securely.
// API key is stored encrypted per store
const configuration = await db.shopConfiguration.upsert({
  where: { shop: session.shop },
  create: {
    shop: session.shop,
    ecomdropApiKey: apiKey,
  },
  update: {
    ecomdropApiKey: apiKey,
  },
});
Your API key is stored securely and encrypted by store. Each Shopify store has its own isolated configuration.

Flow Configuration

Select which Ecomdrop flows to trigger for specific Shopify events:
Automatically triggered when a customer completes a purchase on your Shopify store.Use Cases:
  • Send order confirmation messages
  • Update customer relationship management (CRM)
  • Trigger fulfillment workflows
  • Send tracking information
Triggered when a customer adds items to cart but doesn’t complete the purchase.Use Cases:
  • Send cart recovery messages
  • Offer special discounts to encourage completion
  • Follow up with personalized recommendations
  • A/B test different recovery strategies

Flow Triggering

Flows are automatically triggered via Shopify webhooks:
// Example: Triggering a flow when an order is created
export async function action({ request }: ActionFunctionArgs) {
  const { topic, shop, session } = await authenticate.webhook(request);
  
  if (topic === "ORDERS_CREATE") {
    const config = await db.shopConfiguration.findUnique({
      where: { shop }
    });
    
    if (config?.nuevoPedidoFlowId) {
      await triggerEcomdropFlow(
        config.ecomdropApiKey,
        config.nuevoPedidoFlowId,
        orderData
      );
    }
  }
}

Dropi Integration

Store Configuration

Configure your Dropi integration with three required fields:
  1. Store Name: Your Dropi store identifier
  2. Country: Operating country (supports CO, EC, CL, GT, MX, PA, PE, PY)
  3. Token: Your secure Dropi API token
The Dropi token is validated with Ecomdrop’s bot field API to ensure proper integration.

Country-Specific Bot Fields

Each country has a specific bot field ID for integration:
const DROPI_COUNTRY_FIELD_MAP: Record<string, string> = {
  'CO': '640597',  // Colombia
  'EC': '805359',  // Ecuador
  'CL': '665134',  // Chile
  'GT': '747995',  // Guatemala
  'MX': '641097',  // México
  'PA': '742965',  // Panamá
  'PE': '142979',  // Perú
  'PY': '240677',  // Paraguay
};

Product Data Structure

Dropi products include rich information:
  • Basic Info: ID, SKU, name, description
  • Pricing: Sale price, suggested price, cost
  • Inventory: Stock levels across multiple warehouses
  • Images: Gallery with CDN-hosted images
  • Variations: Color, size, and other options
  • Categories: Product categorization
  • Warehouse: Associated warehouse information

AI Assistant Configuration

Basic Information

Customize your AI assistant’s identity:

Agent Name

Give your AI assistant a friendly name (e.g., “Andrés”, “Sofia”)

Company Name

Your business name that the AI will represent

Company Description

Detailed description of what your business does

Company Policies

Return policies, shipping policies, and terms of service

Payment Methods

Configure accepted payment methods with enable/disable toggles:
interface PaymentMethod {
  id: string;
  name: string;      // e.g., "Credit Card", "PayPal"
  enabled: boolean;  // Whether this method is currently active
}
You can temporarily disable payment methods without deleting them. This is useful during maintenance or when testing new payment gateways.

Frequently Asked Questions (FAQs)

Create two types of FAQs: Pre-Sale FAQs: Questions customers ask before purchasing
  • Product information
  • Shipping costs and times
  • Payment options
  • Return policies
Post-Sale FAQs: Questions customers ask after purchasing
  • Order tracking
  • Returns and exchanges
  • Warranty claims
  • Product support
interface FAQ {
  id: string;
  question: string;  // The customer's question
  answer: string;    // The AI's response
}

Business Rules

Define rules that guide the AI’s behavior:
  • When to escalate to a human agent
  • How to handle special requests
  • Discount authorization limits
  • Product recommendations criteria
interface Rule {
  id: string;
  text: string;  // Rule description
}

Notification Settings

Configure notifications for different event types:
  • Cancelación: Order cancellations
  • Confirmación de Compra: Purchase confirmations
  • Cambio de Datos: Customer data changes
  • Otra Compra: Repeat purchases
  • Solicitud de Asesor: Agent request
  • Comprobante de Pago: Payment receipts
  • Garantía: Warranty claims
  • Error Open AI: AI system errors
Each notification can have:
  • Type (from predefined list)
  • Phone number (with country code)
  • Contact name
interface Notification {
  id: string;
  type: string;      // Notification type
  country: string;   // Country code (CO, MX, etc.)
  phone: string;     // Phone number with country code
  name: string;      // Contact person name
}
Each notification type can only be configured once. The system prevents duplicate notification types.

Theme Management

Install and manage Shopify themes from Git repositories.

Supported Git Providers

  • GitHub
  • GitLab
  • Bitbucket

Theme Installation

Themes are installed programmatically using the Shopify Admin API:
  1. Clone theme from Git repository
  2. Package theme files
  3. Upload to Shopify
  4. Optionally publish theme
// Theme configuration via environment variables
const themeConfig = {
  repo: process.env.THEME_2_5_GIT_REPO,
  branch: process.env.THEME_2_5_GIT_BRANCH,
  provider: process.env.THEME_2_5_GIT_PROVIDER,
  token: process.env.THEME_2_5_GIT_TOKEN,
};

Order Processing

Webhook Handlers

The app registers webhooks for:
  • orders/create - New order created
  • draft_orders/create - Draft order created
  • app/uninstalled - App uninstalled (cleanup)
  • app/scopes_update - Permission scopes updated

Order Flow

When an order is created:
1

Webhook Received

Shopify sends order data to the app via webhook
2

Database Lookup

App retrieves store configuration and product associations
3

Flow Trigger

If configured, trigger the “New Order” flow in Ecomdrop
4

Dropi Processing

If product is linked to Dropi, send order to Dropi for fulfillment

Status Dashboard

Monitor all your integrations from a unified dashboard:

Configuration Status

Ecomdrop Status

Shows if API key is configured and when last updated

Dropi Status

Displays store name, country, and token status

Active Flows

Lists which flows are configured for each event type

Next Steps

Provides guidance on what to configure next

Visual Indicators

  • Green: Configuration complete and active
  • Gray: Not yet configured
  • Amber: Requires attention or update

Database Models

All data is stored in a MySQL database using Prisma ORM:

Session

Stores Shopify app sessions and authentication tokens.

ShopConfiguration

Stores integration settings:
  • Ecomdrop API key
  • Flow IDs for new orders and abandoned carts
  • Dropi store name, country, and token

ProductAssociation

Links Dropi products with Shopify products:
  • Product IDs and names from both platforms
  • Import type and variant mappings
  • Sync configuration options

AIConfiguration

Stores AI assistant settings:
  • Agent and company information
  • Payment methods (JSON)
  • FAQs (JSON)
  • Business rules (JSON)
  • Notification settings (JSON)
All configurations are isolated per Shopify store, ensuring multi-tenant security.

API Endpoints

The app provides several API endpoints:
EndpointMethodPurpose
/api/dropi/productsGETFetch Dropi products with filters
/api/shopify/productsGETFetch Shopify products
/api/shopify/product/variantsGETFetch variants for a product
/api/products/importPOSTImport/link Dropi product to Shopify
/api/products/association/deletePOSTDelete product association
/api/integrations/dropi/savePOSTSave Dropi configuration
/api/theme/installPOSTInstall theme from Git
/api/ecomdrop/callbackPOSTHandle Ecomdrop callbacks

Security Features

Encrypted Storage

API keys and tokens are stored encrypted in the database

Session Management

Shopify session storage with automatic token refresh

HMAC Verification

All webhook requests are verified using HMAC signatures

Scoped Access

App only requests necessary Shopify permissions

Caching Strategy

The app implements intelligent caching:
// Flow cache to prevent rate limiting
const flowsCache = new Map<string, { data: any; timestamp: number }>();
const CACHE_DURATION = 60000; // 1 minute

if (cached && Date.now() - cached.timestamp < CACHE_DURATION) {
  return cached.data; // Return cached data
}
Cache is automatically cleared when you sync flows to ensure fresh data.

User Interface

Built with modern, responsive components:
  • shadcn/ui components for consistent design
  • Tailwind CSS for utility-first styling
  • Lucide React icons for visual clarity
  • React Phone Number Input for international phone support
  • Responsive design that works on all devices

Component Library

Available UI components:
  • Button (multiple variants and sizes)
  • Card (container for content sections)
  • Dialog (modal dialogs)
  • Input (form inputs with validation)
  • Select (dropdown selections)
  • Badge (status indicators)
  • Separator (visual dividers)
  • Textarea (multi-line text input)

View Documentation

Explore the API reference

See Architecture

Understand system design

Get Started

Start building

Build docs developers (and LLMs) love