Shopify Customer Profiler
Builds a configurable customer profile from Shopify, covering identity, value segmentation, shopping behaviour, risk signals and financials. Use it to understand a shopper before deciding how to handle their ticket.
What it does
- Looks up a Shopify customer by email or customer ID.
- Always returns a core profile, and optionally adds activity, risk and financial categories.
- Lets you customise spend tiers and thresholds through a config JSON.
Inputs
| Name | Type | Description |
|---|---|---|
| Shopify Token | Credentials | Shopify access token (shpat_...). Required scopes: read_customers. Optional: read_orders, read_discounts, read_store_credit_accounts, read_returns. Will be removed in favour of dg_flow_module_login. |
| Shopify Domain | Credentials | Shopify store subdomain (e.g. 'your-store' without .myshopify.com). Will be removed in favour of dg_flow_module_login. |
| Customer Email | Optional String | Customer email address to look up. Either email or customerId must be provided. |
| Customer ID | Optional String | Shopify customer ID (numeric or gid://shopify/Customer/123 format). Takes precedence over email if both are provided. |
| Include Activity | Optional Boolean | Enable the ACTIVITY category: order patterns, engagement, churn detection. Default: true. Requires read_orders scope. |
| Include Risk | Optional Boolean | Enable the RISK category: fraud signals, chargebacks, disputes, abuse detection. Default: false. Requires read_orders scope. |
| Include Financials | Optional Boolean | Enable the FINANCIALS category: refunds, returns, discount code details, store credits, net revenue. Default: false. Requires read_orders. Optional: read_discounts, read_store_credit_accounts. |
| Config JSON | Optional String | JSON string for per-client customisation. Keys: spend_tiers (low_max, medium_max, high_max), discount_monitoring (window_days, min_codes), churn_risk (inactivity_days), risk_thresholds (high_refund_order_count), recent_orders_limit. All optional with sensible defaults. |
Outputs
| Name | Type | Description |
|---|---|---|
| Customer Found | Boolean | Whether a customer matching the email or ID was found in Shopify. |
| Error | String | Error message if the lookup failed. Format: [ERROR_CODE] message. Null on success. |
| Profile | Object | Core customer profile (always returned): identity, phone, default address, lifetime spend, custom_spend_tier, Shopify ML predictions, tags, marketing consent, frequent_code_usage flag. |
| Activity | Object | Shopping behaviour: recency, frequency, is_churning, payment/fulfillment status breakdowns, discount codes used on orders, channels. Null when include_activity is false. |
| Risk | Object | Trust signals: has_chargebacks, has_active_returns, high/medium risk order counts, disputes, billing mismatches, excessive_refunder. Null when include_risk is false. |
| Financials | Object | Financial data: refund amounts, net revenue, return status breakdown. Contains nested discount_codes and store_credits objects (null when no data). Null when include_financials is false. |
| Issued Credits | Object | Discount codes issued to this customer (from custom.issued_credits metafield). Each code with amount, dates, used/expired status. Aggregate metrics for total/used/unused. Null if no metafield exists. |
Notes
- Provide either Customer Email or Customer ID; Customer ID takes precedence if both are given.
- Each optional category (activity, risk, financials) needs the matching Shopify read scopes on the token.