Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wearo.io/llms.txt

Use this file to discover all available pages before exploring further.

POST /tryon

Generate a virtual try-on by combining a shopper photo with a product image.

Endpoint

POST https://api.wearo.io/v1/tryon

Request body

FieldTypeRequiredDescription
userPhotostringYesShopper photo — URL or Base64 (see formats below)
productImageUrlstringYesPublic URL of the product image
clothingTypestringNoCategory hint (e.g., "T-shirt", "Dress", "Jacket")

userPhoto formats

URL (recommended for server-to-server):
{
  "userPhoto": "https://example.com/customer-photo.jpg",
  "productImageUrl": "https://mystore.com/products/shirt.jpg"
}
Base64 with data URI prefix:
{
  "userPhoto": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
  "productImageUrl": "https://mystore.com/products/shirt.jpg"
}
Base64 raw (without prefix):
{
  "userPhoto": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
  "productImageUrl": "https://mystore.com/products/shirt.jpg"
}

Success response — 200 OK

{
  "success": true,
  "tryOnId": "73df6de0-ab9e-41d2-8828-60c2800bbf91",
  "resultUrl": "https://api.wearo.io/results/user123/result_1234567890.jpg",
  "creditsRemaining": 849
}
FieldTypeDescription
successbooleantrue for successful requests
tryOnIdstringUnique identifier for this generation
resultUrlstringPublic URL of the generated image (permanent, no expiration)
creditsRemainingnumberRemaining credit balance after this request

Error responses

HTTPErrorCause
400userPhoto (base64 or URL) and productImageUrl are requiredMissing required fields
400Failed to fetch user photo from URLURL not publicly accessible
400Failed to fetch product image from URLURL not publicly accessible
401API key is requiredMissing X-API-Key header
401Invalid API keyKey not found or typo
402Insufficient creditsNo credits remaining
403Domain not authorized for this API keyOrigin not whitelisted
500AI generation failedAI model error — retry
Full error reference →

Code examples

See Code examples → for curl, Node, Python, PHP, and Ruby.