> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genlook.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Collect Email

> Collect customer email addresses and marketing consent

Collect a customer email and sync it to your Shopify store as a customer record. The customer is tagged `genlook-user` and joins the "Virtual Try-On Users by Genlook" customer segment.

<Note>
  Treat this as a fire-and-forget call. Don't block user flow on errors.
</Note>

## Request

<ParamField body="email" type="string" required>
  Customer's email address.
</ParamField>

<ParamField body="marketingConsent" type="boolean">
  Whether the customer consented to marketing emails. Defaults to `false`.
</ParamField>

<ParamField body="checkboxDisplayed" type="boolean">
  Whether the consent checkbox was shown. Useful for compliance tracking.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://your-store.myshopify.com/apps/proxy_genlook-x/public/collect-email" \
    -H "Content-Type: application/json" \
    -d '{
      "email": "customer@example.com",
      "marketingConsent": true
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch('/apps/proxy_genlook-x/public/collect-email', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: 'customer@example.com',
      marketingConsent: true,
    })
  });
  ```
</RequestExample>

## Response

<ResponseField name="success" type="boolean" required>
  Whether the email was collected.
</ResponseField>

<ResponseField name="message" type="string" required>
  Status message.
</ResponseField>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "message": "Email collected successfully"
  }
  ```
</ResponseExample>
