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

NameTypeDescription
Shopify TokenCredentialsShopify 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 DomainCredentialsShopify store subdomain (e.g. 'your-store' without .myshopify.com). Will be removed in favour of dg_flow_module_login.
Customer EmailOptional StringCustomer email address to look up. Either email or customerId must be provided.
Customer IDOptional StringShopify customer ID (numeric or gid://shopify/Customer/123 format). Takes precedence over email if both are provided.
Include ActivityOptional BooleanEnable the ACTIVITY category: order patterns, engagement, churn detection. Default: true. Requires read_orders scope.
Include RiskOptional BooleanEnable the RISK category: fraud signals, chargebacks, disputes, abuse detection. Default: false. Requires read_orders scope.
Include FinancialsOptional BooleanEnable 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 JSONOptional StringJSON 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

NameTypeDescription
Customer FoundBooleanWhether a customer matching the email or ID was found in Shopify.
ErrorStringError message if the lookup failed. Format: [ERROR_CODE] message. Null on success.
ProfileObjectCore customer profile (always returned): identity, phone, default address, lifetime spend, custom_spend_tier, Shopify ML predictions, tags, marketing consent, frequent_code_usage flag.
ActivityObjectShopping behaviour: recency, frequency, is_churning, payment/fulfillment status breakdowns, discount codes used on orders, channels. Null when include_activity is false.
RiskObjectTrust signals: has_chargebacks, has_active_returns, high/medium risk order counts, disputes, billing mismatches, excessive_refunder. Null when include_risk is false.
FinancialsObjectFinancial 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 CreditsObjectDiscount 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.

API reference