curl "https://api.genlook.app/storefront/v1/try-ons/gen_xyz789abc" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..."
const response = await fetch(`https://api.genlook.app/storefront/v1/try-ons/${jobId}`, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const status = await response.json();
{
"generationId": "gen_xyz789abc",
"status": "COMPLETED",
"resultImageKey": "generations/gen_xyz789abc.jpg",
"resultImageUrl": "https://storage.googleapis.com/bucket-name/generations/gen_xyz789abc.jpg?X-Goog-Signature=...",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:32:15Z"
}
{
"generationId": "gen_xyz789abc",
"status": "FAILED",
"errorMessage": "Failed to process image: Invalid image format",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:45Z"
}
{
"generationId": "gen_xyz789abc",
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Widget API Reference
Try-On Status
Check the status of a virtual try-on job
GET
/
storefront
/
v1
/
try-ons
/
{id}
curl "https://api.genlook.app/storefront/v1/try-ons/gen_xyz789abc" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..."
const response = await fetch(`https://api.genlook.app/storefront/v1/try-ons/${jobId}`, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const status = await response.json();
{
"generationId": "gen_xyz789abc",
"status": "COMPLETED",
"resultImageKey": "generations/gen_xyz789abc.jpg",
"resultImageUrl": "https://storage.googleapis.com/bucket-name/generations/gen_xyz789abc.jpg?X-Goog-Signature=...",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:32:15Z"
}
{
"generationId": "gen_xyz789abc",
"status": "FAILED",
"errorMessage": "Failed to process image: Invalid image format",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:45Z"
}
{
"generationId": "gen_xyz789abc",
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Poll this endpoint until status is
With the SDK there is nothing to poll:
COMPLETED or FAILED. Recommended interval: every 2 seconds, max 60 attempts.
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.generate() resolves when the try-on completes, and the tryon:generation_succeeded / tryon:generation_failed events fire along the way.
Path Parameters
string
required
The
jobId from the create try-on response.curl "https://api.genlook.app/storefront/v1/try-ons/gen_xyz789abc" \
-H "Authorization: Bearer pk_your_key_here" \
-H "X-Genlook-Anonymous-Id: anon_..."
const response = await fetch(`https://api.genlook.app/storefront/v1/try-ons/${jobId}`, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const status = await response.json();
Response
string
required
The try-on job ID.
string
required
PENDING | PROCESSING | COMPLETED | FAILEDstring
Storage key of the generated image. Present when
COMPLETED.string
Temporary signed URL of the generated image. Present when
COMPLETED.string
Error description. Present when
FAILED.string
required
ISO 8601 timestamp.
string
required
ISO 8601 timestamp.
{
"generationId": "gen_xyz789abc",
"status": "COMPLETED",
"resultImageKey": "generations/gen_xyz789abc.jpg",
"resultImageUrl": "https://storage.googleapis.com/bucket-name/generations/gen_xyz789abc.jpg?X-Goog-Signature=...",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:32:15Z"
}
{
"generationId": "gen_xyz789abc",
"status": "FAILED",
"errorMessage": "Failed to process image: Invalid image format",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:45Z"
}
{
"generationId": "gen_xyz789abc",
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Polling Example
async function pollTryOn(jobId) {
for (let i = 0; i < 60; i++) {
const res = await fetch(`https://api.genlook.app/storefront/v1/try-ons/${jobId}`, {
headers: {
'Authorization': `Bearer ${PUBLISHABLE_KEY}`,
'X-Genlook-Anonymous-Id': anonymousId,
},
});
const data = await res.json();
if (data.status === 'COMPLETED') return data;
if (data.status === 'FAILED') throw new Error(data.errorMessage);
await new Promise(r => setTimeout(r, 2000));
}
throw new Error('Try-on timeout');
}
Most try-ons finish in 10 to 20 seconds. Allow up to 60 seconds before treating a try-on as unusually slow.
Was this page helpful?

