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.
Overview
This page provides detailed documentation for each Prisma model, including field descriptions, constraints, relationships, and usage examples.All models are defined in
/prisma/schema.prisma and managed through Prisma ORM for type-safe database access.Session Model
Manages Shopify OAuth sessions for authenticated store connections. Supports both online (user-specific) and offline (app-level) access tokens.Schema Definition
Field Descriptions
Primary Key - Unique session identifier generated during OAuth flow.Format: Combination of shop domain and session type (online/offline).
Shop Domain - The myshopify.com domain of the connected store.
- Max length: 255 characters
- Indexed for fast lookups
- Example:
"example-store.myshopify.com"
OAuth State - Security token used during OAuth flow to prevent CSRF attacks.
- Max length: 255 characters
- Validated during callback
Session Type - Determines if this is a user-specific (online) or app-level (offline) session.
true: Online session (expires, user-specific)false: Offline session (permanent, app-level access)
OAuth Scopes - Comma-separated list of Shopify API permissions granted.
- Stored as TEXT field
- Example:
"read_products,write_products,read_orders"
Expiration Time - When the session expires (online sessions only).
- Null for offline sessions
- Used to determine if re-authentication is needed
Access Token - Shopify API access token for making authenticated requests.
- Stored as TEXT (encrypted in production)
- Required for all Shopify API calls
User ID - Shopify user ID for online sessions.
- Null for offline sessions
- Links session to specific Shopify admin user
User’s first name from Shopify account (max 255 chars).
User’s last name from Shopify account (max 255 chars).
User’s email address from Shopify account (max 255 chars).
Owner Status - Indicates if the user is the shop owner.
- Used for permission checks
- Only shop owners can access certain features
User Locale - Language/region preference (max 10 chars).
- Example:
"en-US","es-MX" - Used for localization
Indicates if the user is a collaborator (staff member).
Whether the user’s email has been verified by Shopify.
Usage Examples
ShopConfiguration Model
Stores platform-specific configuration and API credentials for Ecomdrop and Dropi integrations.Schema Definition
Field Descriptions
Primary Key - Auto-generated UUID.Format: Standard UUID v4
Shop Domain - Unique shop identifier.
- Max length: 255 characters
- Unique constraint ensures one config per shop
- Example:
"example-store.myshopify.com"
Ecomdrop API Key - Authentication key for Ecomdrop platform.
- Stored as TEXT (encrypted recommended)
- Required for flow automation features
- Obtained from Ecomdrop dashboard
New Order Flow ID - Ecomdrop flow identifier for new order automation.
- Max length: 255 characters
- Triggers when new orders are created
- Configured in Ecomdrop platform
Abandoned Cart Flow ID - Ecomdrop flow identifier for cart abandonment.
- Max length: 255 characters
- Triggers for abandoned cart recovery
- Configured in Ecomdrop platform
Dropi Store Name - Store identifier in Dropi platform.
- Max length: 255 characters
- Used for product catalog access
- Example:
"my-dropshipping-store"
Dropi Country - Country/region for Dropi operations.
- Max length: 10 characters
- ISO country code recommended
- Example:
"MX","US"
Dropi Authentication Token - API token for Dropi platform access.
- Stored as TEXT (encrypted recommended)
- Required for product imports and order fulfillment
- Obtained from Dropi account settings
Creation Timestamp - When the configuration was first created.Auto-generated on record creation.
Update Timestamp - Last modification time.Auto-updated on any field change.
Usage Examples
Security Best Practice: Always encrypt sensitive fields like
ecomdropApiKey and dropiToken before storing in the database.ProductAssociation Model
Tracks the relationship between Dropi products and imported Shopify products, including import settings and preferences.Schema Definition
Field Descriptions
Primary Key - Auto-generated UUID.
Shop Domain - The store this association belongs to.
- Max length: 255 characters
- Indexed for filtering by shop
Dropi Product ID - Unique identifier from Dropi catalog.
- Max length: 255 characters
- Indexed for reverse lookups
- Part of composite unique constraint
Shopify Product ID - GraphQL GID of the imported product.
- Max length: 255 characters
- Format:
"gid://shopify/Product/123456789" - Indexed for product updates
- Part of composite unique constraint
Original Dropi Name - Product name from Dropi catalog.
- Max length: 500 characters
- Stored for reference and sync
Shopify Title - Current product title in Shopify.
- Max length: 500 characters
- May differ from Dropi name if customized
Import Type - Method used to import the product.
- Max length: 50 characters
- Values:
"single","bulk","auto" - Used for tracking and analytics
Variant Mappings - JSON data mapping Dropi variants to Shopify variants.
- Stored as TEXT
- Format: JSON string with variant IDs and SKUs
- Used for order fulfillment routing
Save Name Preference - Whether to use Dropi’s product name.
true: Use Dropi namefalse: Use custom name
Save Description Preference - Whether to use Dropi’s description.
true: Import Dropi descriptionfalse: Use custom description
Custom Pricing - Custom price override or markup formula.
- Max length: 50 characters
- Examples:
"29.99","cost*1.5","+10"
Barcode Preference - Whether to use Dropi’s suggested barcode.
true: Use Dropi barcodefalse: Generate or use custom barcode
Image Import Preference - Whether to import product images from Dropi.
true: Import Dropi imagesfalse: Use custom images
Import Timestamp - When the product was first associated.
Last Sync Time - Last time the association was updated.
Usage Examples
The composite unique constraint
[shop, dropiProductId, shopifyProductId] ensures that each Dropi product can only be associated with a specific Shopify product once per shop.AIConfiguration Model
Stores AI agent configuration, knowledge base, and behavioral rules for personalized customer support.Schema Definition
Field Descriptions
Primary Key - Auto-generated UUID.
Shop Domain - Unique shop identifier.
- Max length: 255 characters
- Unique constraint ensures one AI config per shop
AI Agent Name - Custom name for the chatbot/assistant.
- Max length: 255 characters
- Example:
"Sofia","Support Assistant" - Displayed to customers during interactions
Company Name - Store or business name.
- Max length: 255 characters
- Used in AI responses for personalization
- Example:
"TechGadgets Store"
Business Description - Overview of the business and offerings.
- Stored as TEXT (no length limit)
- Provides context for AI responses
- Includes mission, values, product categories
Payment Methods - Accepted payment options.
- Stored as TEXT
- Format: Free-form or structured (JSON)
- Example:
"Credit cards, PayPal, Mercado Pago, OXXO"
Store Policies - Return, shipping, and general policies.
- Stored as TEXT
- Includes return windows, shipping times, warranty info
- Used by AI to answer policy questions
Pre-Sale FAQ - Common questions before purchase.
- Stored as TEXT
- Format: Question-answer pairs
- Topics: Product info, sizing, availability
Post-Sale FAQ - Questions about orders and support.
- Stored as TEXT
- Topics: Order tracking, returns, exchanges
- Used for customer support automation
AI Behavior Rules - Guidelines for AI agent behavior.
- Stored as TEXT
- Example:
"Always be friendly and professional" - Defines tone, escalation triggers, boundaries
Notification Settings - Configuration for alerts and notifications.
- Stored as TEXT
- Format: JSON recommended
- Controls when/how to notify store owners
Configuration Created - Initial setup timestamp.
Last Modified - Last time the configuration was updated.
Usage Examples
Best Practice: Store FAQ data as JSON for easier parsing and updating. This allows structured querying and better AI context management.
Common Patterns
Multi-Shop Support
All models useshop as a key field for multi-tenancy:
Timestamps
Models withcreatedAt and updatedAt provide automatic timestamp tracking:
Upsert Operations
Use upsert for create-or-update logic:Related Documentation
- Database Schema - Schema overview and ER diagram