> ## 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 Try-On

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

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

<Note>
  On JavaScript, the [`@genlook/storefront` SDK](/docs/virtual-tryon/sdk) is the recommended integration: it calls this endpoint for you, along with the rest of the try-on flow.
</Note>

With the SDK:

```javascript SDK theme={null}
const url = await genlook.getShareUrl(entryId);
```

## Request

<ParamField path="id" type="string" required>
  A try-on 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://api.genlook.app/storefront/v1/try-ons/gen_xyz789abc/share" \
    -H "Authorization: Bearer pk_your_key_here" \
    -H "X-Genlook-Anonymous-Id: anon_..." \
    -H "Content-Type: application/json" \
    -d '{
      "effectiveDomain": "yourstore.com",
      "productUrl": "https://yourstore.com/products/blue-shirt"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(`https://api.genlook.app/storefront/v1/try-ons/${jobId}/share`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
      'X-Genlook-Anonymous-Id': anonymousId,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      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 try-on, reuse it instead of creating a new one.
</Tip>

## Get a shared try-on

`GET /storefront/v1/shares/{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 try-on 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 try-on.
</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>
