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

# Try On

> Generate a virtual try-on image from a user photo and product image URLs, or Shopify product identifiers.



## OpenAPI

````yaml /api-reference/openapi.json post /api/try-on
openapi: 3.1.0
info:
  title: Hemsy API
  description: Hemsy API allows you to generate virtual try-ons for your products.
  version: 1.0.0
  contact:
    name: Hemsy Support
    url: https://hemsy.ai
    email: support@hemsy.ai
servers:
  - url: https://hemsy.ai
security: []
paths:
  /api/try-on:
    post:
      summary: Try On
      description: >-
        Generate a virtual try-on image from a user photo and product image
        URLs, or Shopify product identifiers.
      operationId: tryOn
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - userPhoto
                - products
              properties:
                userPhoto:
                  type: string
                  description: Public URL or base64 data URL of the user image.
                products:
                  type: array
                  minItems: 1
                  items:
                    description: >-
                      For each product, choose one option: `variantId` or
                      `images`.
                    oneOf:
                      - title: Variant ID
                        type: object
                        required:
                          - variantId
                        properties:
                          variantId:
                            type:
                              - string
                              - number
                            description: Shopify variant ID (numeric ID or gid).
                      - title: Images
                        type: object
                        required:
                          - images
                        properties:
                          images:
                            type: array
                            description: >-
                              Product image sources. Supports HTTPS URLs and
                              base64 data URLs.
                            items:
                              type: string
                              format: uri
                            minItems: 1
                          title:
                            type: string
                            description: Optional product title.
                          category:
                            type: string
                            description: Optional product category.
            examples:
              usingVariantId:
                summary: Use variantId
                value:
                  userPhoto: https://cdn.example.com/user-photo.jpg
                  products:
                    - variantId: '44772123456789'
              usingImages:
                summary: Use image URLs
                value:
                  userPhoto: https://cdn.example.com/user-photo.jpg
                  products:
                    - title: Black Mini Dress
                      category: dress
                      images:
                        - >-
                          https://cdn.example.com/products/black-mini-dress-front.jpg
      responses:
        '200':
          description: Successful try-on
          content:
            application/json:
              schema:
                type: object
                properties:
                  image:
                    type: string
                  code:
                    type: string
                  error:
                    type: string
                  message:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````