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

# Create Generation

> Request a virtual try-on generation combining a customer photo with a product

Create a virtual try-on generation job. Returns immediately with a `jobId`. Poll [Generation Status](/docs/virtual-tryon/endpoints/generation-status) for the result.

## Request

<ParamField body="userImageId" type="string" required>
  The `fileId` from a previous upload.
</ParamField>

<ParamField body="productId" type="string" required>
  Shopify product ID (`gid://shopify/Product/{id}`).
</ParamField>

<ParamField body="variantId" type="string">
  Shopify variant ID (`gid://shopify/ProductVariant/{id}`). Uses the default variant if omitted.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://your-store.myshopify.com/apps/proxy_genlook-x/public/fitting-room" \
    -H "Content-Type: application/json" \
    -d '{
      "userImageId": "customer-media/acc_123/file_abc123xyz.jpg",
      "productId": "gid://shopify/Product/1234567890",
      "variantId": "gid://shopify/ProductVariant/123456"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('/apps/proxy_genlook-x/public/fitting-room', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      userImageId: 'customer-media/acc_123/file_abc123xyz.jpg',
      productId: 'gid://shopify/Product/1234567890',
      variantId: 'gid://shopify/ProductVariant/123456'
    })
  });
  const result = await response.json();
  ```
</RequestExample>

## Response

<ResponseField name="jobId" type="string" required>
  Generation job ID. Use it to poll status.
</ResponseField>

<ResponseField name="message" type="string" required>
  Status message or reason the generation was blocked.
</ResponseField>

<ResponseField name="code" type="string">
  Present when generation was blocked:

  * `QUOTA_EXCEEDED`: Monthly quota reached
  * `RATE_LIMIT_EXCEEDED`: Too many requests
  * `BILLING_NOT_ALLOWED`: Plan expired
  * `CREATION_FAILED`: Job could not be created
</ResponseField>

<ResponseExample>
  ```json Success theme={null}
  {
    "jobId": "gen_xyz789abc",
    "message": "Generation job created successfully"
  }
  ```

  ```json Blocked theme={null}
  {
    "jobId": "",
    "message": "Monthly generation quota exceeded",
    "code": "QUOTA_EXCEEDED"
  }
  ```
</ResponseExample>

## Next Steps

1. Store the `jobId`
2. Poll [Generation Status](/docs/virtual-tryon/endpoints/generation-status) every 2 seconds
3. Display the result when status is `COMPLETED`
