curl -X POST "https://api.genlook.app/storefront/v1/try-ons" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
-H "Content-Type: application/json" \
-d '{
"userImageId": "customer-media/acc_123/file_abc123xyz.jpg",
"productId": "gid://shopify/Product/1234567890",
"variantId": "gid://shopify/ProductVariant/123456"
}'
const response = await fetch('https://api.genlook.app/storefront/v1/try-ons', {
method: 'POST',
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
'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();
{
"jobId": "gen_xyz789abc",
"message": "Try-on job created successfully"
}
{
"jobId": "",
"message": "Monthly try-on quota exceeded",
"code": "QUOTA_EXCEEDED"
}
Widget API Reference
Create Try-On
Request a virtual try-on combining a customer photo with a product
POST
/
storefront
/
v1
/
try-ons
curl -X POST "https://api.genlook.app/storefront/v1/try-ons" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
-H "Content-Type: application/json" \
-d '{
"userImageId": "customer-media/acc_123/file_abc123xyz.jpg",
"productId": "gid://shopify/Product/1234567890",
"variantId": "gid://shopify/ProductVariant/123456"
}'
const response = await fetch('https://api.genlook.app/storefront/v1/try-ons', {
method: 'POST',
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
'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();
{
"jobId": "gen_xyz789abc",
"message": "Try-on job created successfully"
}
{
"jobId": "",
"message": "Monthly try-on quota exceeded",
"code": "QUOTA_EXCEEDED"
}
Create a virtual try-on job. Returns immediately with a
With the SDK, one call starts the try-on and resolves when the image is ready, polling included:
jobId. Poll Try-On Status for the result.
On JavaScript, the
@genlook/storefront SDK is the recommended integration: it calls this endpoint for you, along with the rest of the try-on flow.SDK
const { imageUrl, generationId } = await genlook.generate({
userImageId: fileId,
productId: "gid://shopify/Product/1234567890",
});
Request
string
required
The
fileId from a previous upload.string
required
Shopify product ID (
gid://shopify/Product/{id}).string
Shopify variant ID (
gid://shopify/ProductVariant/{id}). Uses the default variant if omitted.curl -X POST "https://api.genlook.app/storefront/v1/try-ons" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..." \
-H "Content-Type: application/json" \
-d '{
"userImageId": "customer-media/acc_123/file_abc123xyz.jpg",
"productId": "gid://shopify/Product/1234567890",
"variantId": "gid://shopify/ProductVariant/123456"
}'
const response = await fetch('https://api.genlook.app/storefront/v1/try-ons', {
method: 'POST',
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
'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();
Response
string
required
Try-on job ID. Use it to poll status.
string
required
Status message or reason the try-on was blocked.
string
Present when the try-on was blocked:
QUOTA_EXCEEDED: Monthly quota reachedRATE_LIMIT_EXCEEDED: Too many requestsBILLING_NOT_ALLOWED: Plan expiredPRODUCT_BLOCKED: Try-on is disabled for this productCREATION_FAILED: Job could not be created
{
"jobId": "gen_xyz789abc",
"message": "Try-on job created successfully"
}
{
"jobId": "",
"message": "Monthly try-on quota exceeded",
"code": "QUOTA_EXCEEDED"
}
Next Steps
- Store the
jobId - Poll Try-On Status every 2 seconds
- Display the result when status is
COMPLETED
Was this page helpful?

