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
| Field | Type | Required | Description |
|---|
userPhoto | string | Yes | Shopper photo — URL or Base64 (see formats below) |
productImageUrl | string | Yes | Public URL of the product image |
clothingType | string | No | Category hint (e.g., "T-shirt", "Dress", "Jacket") |
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
}
| Field | Type | Description |
|---|
success | boolean | true for successful requests |
tryOnId | string | Unique identifier for this generation |
resultUrl | string | Public URL of the generated image (permanent, no expiration) |
creditsRemaining | number | Remaining credit balance after this request |
Error responses
| HTTP | Error | Cause |
|---|
| 400 | userPhoto (base64 or URL) and productImageUrl are required | Missing required fields |
| 400 | Failed to fetch user photo from URL | URL not publicly accessible |
| 400 | Failed to fetch product image from URL | URL not publicly accessible |
| 401 | API key is required | Missing X-API-Key header |
| 401 | Invalid API key | Key not found or typo |
| 402 | Insufficient credits | No credits remaining |
| 403 | Domain not authorized for this API key | Origin not whitelisted |
| 500 | AI generation failed | AI model error — retry |
Full error reference →
Code examples
See Code examples → for curl, Node, Python, PHP, and Ruby.