Retrieve the current status and result of a generation job. Poll this endpoint until the status is COMPLETED or FAILED.
Path Parameters
The generation job ID returned from the create generation endpoint.
Request
curl "https://your-store.myshopify.com/apps/proxy_genlook-x/public/generation/gen_xyz789abc"
Response
The generation job ID (same as the path parameter).
Current status of the generation. Possible values:
PENDING - Job created but not yet started
PROCESSING - Generation is in progress
COMPLETED - Generation finished successfully
FAILED - Generation failed with an error
URL of the generated try-on image. Only present when status is COMPLETED.
Error message describing what went wrong. Only present when status is FAILED.
ISO 8601 timestamp when the generation job was created.
ISO 8601 timestamp when the generation status was last updated.
{
"generationId": "gen_xyz789abc",
"status": "PENDING",
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
Polling Best Practices
Polling interval: Check status every 2 seconds. Don’t poll more frequently - it won’t speed up generation and wastes resources.
Maximum attempts: Limit polling to 60 attempts (2 minutes total). If generation takes longer, show a timeout message and allow retry.
Stop polling: Once status is COMPLETED or FAILED, stop polling immediately.
Example Polling Implementation
async function pollGenerationStatus(jobId, onStatusChange) {
const maxAttempts = 60;
const pollInterval = 2000; // 2 seconds
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const response = await fetch(
`/apps/proxy_genlook-x/public/generation/${jobId}`
);
const status = await response.json();
if (onStatusChange) {
onStatusChange(status);
}
if (status.status === 'COMPLETED') {
return status;
}
if (status.status === 'FAILED') {
throw new Error(status.errorMessage || 'Generation failed');
}
// Wait before next poll
await new Promise(resolve => setTimeout(resolve, pollInterval));
}
throw new Error('Generation timeout - please try again');
}
// Usage
try {
const result = await pollGenerationStatus('gen_xyz789abc', (status) => {
console.log(`Status: ${status.status}`);
});
console.log('Generated image:', result.resultImageUrl);
} catch (error) {
console.error('Generation failed:', error.message);
}
Error Responses
{
"message": "Generation not found"
}
Status Flow
The typical status progression:
- PENDING → Job created, waiting to start
- PROCESSING → Generation in progress (may take 10-60 seconds)
- COMPLETED → Success!
resultImageUrl is available
- FAILED → Error occurred, check
errorMessage
Most generations complete within 30-60 seconds. If polling exceeds 2 minutes, consider showing a timeout message and allowing the user to retry.