Skip to main content
POST
/
public
/
collect-email
curl -X POST "https://your-store.myshopify.com/apps/proxy_genlook-x/public/collect-email" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "marketingConsent": true,
  }'
{
  "success": true,
  "message": "Email collected successfully"
}
Collect customer email addresses for CRM purposes. This endpoint creates or updates customer records in your Shopify store and can be used for email marketing campaigns.

Request

email
string
required
Customer’s email address. Must be a valid email format.
Whether the customer consented to marketing emails. Defaults to false if not provided.
curl -X POST "https://your-store.myshopify.com/apps/proxy_genlook-x/public/collect-email" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "marketingConsent": true,
  }'

Response

success
boolean
required
Whether the email was collected successfully.
message
string
required
Success message confirming the email was collected.
{
  "success": true,
  "message": "Email collected successfully"
}

Customer Record Creation

When you collect an email:
  1. Customer Lookup: The system checks if a customer with this email already exists
  2. Create or Update: Creates a new customer record or updates existing one
  3. Shopify Integration: Customer is synced to your Shopify store
  4. CRM Tagging: Customer is tagged for segmentation and marketing campaigns
This endpoint uses a fire-and-forget pattern. Errors are logged but don’t block the user flow. Don’t show errors to users - treat this as a background operation.

Error Handling

This endpoint is designed to not block user flow. If collection fails, the error is logged but the request still returns success. Don’t show error messages to users.
{
  "success": false,
  "message": "Invalid email format"
}

Best Practices

Timing: Collect emails at strategic points - after first generation, before sharing, or when credits are low.
Privacy: Ensure your privacy policy is accessible and explains how email addresses are used.

Shopify Customer Segments

Collected emails are automatically added to a Shopify customer segment called “Genlook Widget Leads”. You can use this segment for:
  • Email marketing campaigns (Klaviyo, Mailchimp, etc.)
  • Retargeting ads
  • Customer analysis
  • Conversion tracking
The customer segment is created automatically when you first collect an email. You can find it in Shopify Admin → Customers → Segments.