The Webhooks API handles incoming webhook events from Shopify. These endpoints are automatically called by Shopify when certain events occur.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.
Order Created Webhook
Triggered when a new order is created in Shopify. Sends order data to Ecomdrop for processing.Webhook Topic
ORDERS_CREATE (GraphQL API webhook)
Payload
Shopify sends order data in GraphQL format. The webhook handler processes:Processing Flow
- Configuration Check: Verifies Ecomdrop API key and Flow ID are configured
- Data Transformation: Converts GraphQL order data to Ecomdrop format
- Callback URL: Adds callback URL for status notifications
- Flow Trigger: Sends data to Ecomdrop flow for processing
- Tag Update: Adds error tag if immediate failure occurs
Response
The webhook always returns 200 OK to prevent Shopify from retrying. Errors are logged but not returned to Shopify.
Ecomdrop Integration
When configured, the webhook:- Transforms order data to Ecomdrop-compatible format
- Includes callback URL:
{SHOPIFY_APP_URL}/api/ecomdrop/callback - Sends API key in payload for callback authentication
- Triggers the configured “Nuevo Pedido” flow ID
- Waits for async callback to update order tags
Order Data Sent to Ecomdrop
Draft Order Created Webhook
Triggered when a draft order (abandoned cart) is created in Shopify. Sends data to Ecomdrop for abandoned cart recovery flows.Webhook Topic
DRAFT_ORDERS_CREATE (GraphQL API webhook)
Payload
Shopify sends draft order data in GraphQL format.Processing Flow
- Configuration Check: Verifies “Carrito Abandonado” flow ID is configured
- Data Transformation: Converts draft order data to Ecomdrop format
- Flow Trigger: Sends to abandoned cart recovery flow
Response
Draft Order Data Sent to Ecomdrop
App Uninstalled Webhook
Triggered when the app is uninstalled from a Shopify store. Cleans up all store data.Webhook Topic
APP_UNINSTALLED
Processing Flow
- Session Cleanup: Deletes all sessions for the shop
- Configuration Cleanup: Removes shop configuration
- Product Associations: Deletes all product associations
- AI Configuration: Removes AI settings
Response
Data Cleaned Up
- All session records
- Shop configuration (Ecomdrop/Dropi settings)
- Product associations
- AI configuration
This webhook ensures GDPR compliance by removing all shop data when the app is uninstalled.
App Scopes Update Webhook
Triggered when the app’s permission scopes are updated in Shopify.Webhook Topic
APP_SCOPES_UPDATE
Payload
Array of current permission scopes granted to the app
Processing Flow
- Extract Scopes: Gets current scopes from payload
- Update Session: Updates the session record with new scopes
Response
Example Payload
This webhook ensures the app’s stored session data stays in sync with Shopify’s current permissions.
Webhook Configuration
To set up these webhooks in your Shopify app:Required Webhooks
| Topic | Endpoint | Purpose |
|---|---|---|
ORDERS_CREATE | /webhooks/orders/create | New order processing |
DRAFT_ORDERS_CREATE | /webhooks/draft_orders/create | Abandoned cart recovery |
APP_UNINSTALLED | /webhooks/app/uninstalled | Data cleanup |
APP_SCOPES_UPDATE | /webhooks/app/scopes_update | Permission sync |