> ## 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.

# Share Generation

> Create a shareable link for a virtual try-on result

Create a public share link for a completed generation. Links include Open Graph and Twitter Card metadata for rich social previews. Links expire after 30 days.

## Request

<ParamField body="generationId" type="string" required>
  A generation ID with status `COMPLETED`.
</ParamField>

<ParamField body="effectiveDomain" type="string">
  The customer-facing domain (e.g. `yourstore.com`). Defaults to the Shopify store domain.
</ParamField>

<ParamField body="productUrl" type="string">
  Absolute product page URL captured from the storefront at share time (e.g. `https://yourstore.com/products/blue-shirt`). Used by the public share page product CTA.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://your-store.myshopify.com/apps/proxy_genlook-x/public/share-generation" \
    -H "Content-Type: application/json" \
    -d '{
      "generationId": "gen_xyz789abc",
      "effectiveDomain": "yourstore.com",
      "productUrl": "https://yourstore.com/products/blue-shirt"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('/apps/proxy_genlook-x/public/share-generation', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      generationId: 'gen_xyz789abc',
      effectiveDomain: 'yourstore.com',
      productUrl: 'https://yourstore.com/products/blue-shirt',
    })
  });
  const result = await response.json();
  ```
</RequestExample>

## Response

<ResponseField name="shareToken" type="string" required>
  Unique token for the share link.
</ResponseField>

<ResponseField name="shareUrl" type="string" required>
  Complete shareable URL.
</ResponseField>

<ResponseField name="expiresAt" type="string" required>
  ISO 8601 expiration timestamp.
</ResponseField>

<ResponseExample>
  ```json Success theme={null}
  {
    "shareToken": "abc123xyz789",
    "shareUrl": "https://genlook.app/s/abc123xyz789",
    "expiresAt": "2024-02-15T10:30:00Z"
  }
  ```
</ResponseExample>

<Tip>
  Cache the `shareUrl`. If a share link already exists for a generation, reuse it instead of creating a new one.
</Tip>

## Get shared generation

`GET /public/shared/:token` (public, no auth) returns the try-on image and metadata for the share landing page at `https://genlook.app/s/{token}`.

<ResponseField name="generationId" type="string" required>
  The generation ID backing the share link.
</ResponseField>

<ResponseField name="generatedImageUrl" type="string" required>
  URL of the try-on image shown on the share page.
</ResponseField>

<ResponseField name="merchantShopDomain" type="string" required>
  The Shopify store domain that owns the generation.
</ResponseField>

<ResponseField name="sharedAt" type="string" required>
  ISO 8601 timestamp for when the share link was created.
</ResponseField>

<ResponseField name="expiresAt" type="string" required>
  ISO 8601 expiration timestamp. Share links expire after 30 days.
</ResponseField>

<ResponseField name="productUrl" type="string">
  Product page URL for the share page "Shop this look" CTA. Prefer the URL sent at share creation; falls back to the persisted store product URL when absent.
</ResponseField>

<ResponseField name="productId" type="string">
  External product GID (e.g. `gid://shopify/Product/123`).
</ResponseField>

<ResponseField name="productTitle" type="string">
  Product title shown on the share page.
</ResponseField>

<ResponseField name="effectiveDomain" type="string">
  Customer-facing domain captured when the share link was created.
</ResponseField>
