Skip to content

Start a generation

POST /generations

Queue a virtual try-on generation using the customer photo and Shopify product. Save the returned job ID and poll for completion.

Authentication: X-Antla-SDK-Key: YOUR_ANTLA_SDK_KEY. Content-Type: application/json.

Uses the shared IP rate limit. See Errors and rate limits.

Body fieldTypeRequiredDescription
funnelIdnumberYesPositive integer, belonging to this store and assigned to the product.
productIdstring or numberYesProduct numeric ID, numeric string or full Product GID. Prefer a string/GID to avoid precision loss.
variantIdstring or numberYesVariant numeric ID, numeric string or full ProductVariant GID, belonging to this product.
imageUrlstringYesPublicly retrievable customer photo URL.
uniqueUserIdstringNoNon-empty saved Antla visitor ID.
customerEmailstringNoValid email; registers the visitor and supplies generation-linked Klaviyo data. Trim before sending.
moreLooksConsentbooleanNoShopper’s actual consent choice.
Terminal window
curl --fail-with-body -X POST \
"https://app-antla.com/api/headless/generations" \
-H "X-Antla-SDK-Key: YOUR_ANTLA_SDK_KEY" \
-H "Content-Type: application/json" \
--data '{
"funnelId": 123,
"productId": "gid://shopify/Product/123",
"variantId": "gid://shopify/ProductVariant/456",
"imageUrl": "https://YOUR_PUBLIC_IMAGE_HOST/customer-photo.jpg"
}'

HTTP 200, JSON envelope:

{
"data": {
"jobId": "c45451c0-b02c-4c90-8c6e-0779edb01996",
"etaSeconds": 40,
"uniqueUserId": null
}
}

A successful request returns HTTP 200. etaSeconds is an estimate. uniqueUserId can be null. The output image is not in this response.

Before queueing, the server checks the funnel’s store, the product, the tag antla_in_funnel_<id>, variant membership, a product image, the email gate, the customer try-on limit, and merchant credits. It uses the variant image when one exists, otherwise the first product image. It does not check Storefront publication or availableForSale. Check those in your own catalog.

Do not send a model, prompt or garment image override. Those are controlled by the merchant’s Antla funnel/configuration.

Do not automatically retry after an ambiguous network failure or 5xx. No idempotency-key contract is implemented, and a job or credit operation may already have happened.

StatusWhen
400Invalid JSON or body, missing product image, or registration failure such as Unable to identify session or Email already registered.
403The product is not in this funnel. That body is { "error": "Product is not assigned to this funnel" } and has no code. Or code is EMAIL_REQUIRED.
404Funnel, product, or variant is missing or belongs to another store.
429Shared IP limit, or code TRY_ON_LIMIT_REACHED. Only the IP limit includes Retry-After.
500Shopify, credits, or the queue. Credit and queue failures return { "error": "Could not create generation" } and have no credit-specific code.

A sold-out variant is not rejected here. Retry rules are in Errors and rate limits.