Developers

Try-On API

JSON in, JSON out. Secret keys (vk_test_… / vk_live_…) go in Authorization: Bearer from your server. The publishable key (vp_…) is for the widget on your pages. Your catalogue is keyed by your own SKUs.

Getting started

  1. Load your catalogue by SKU: images and a size chart for each product, with PUT /api/v1/products/{sku}, a CSV import, or the Shopify import in the dashboard.
  2. Add one tag to your theme. On each page it finds the product's SKU and shows a Try it on button only when that SKU is live.
  3. Optionally recognise signed-in customers so their measurements follow them across devices.
<script src="https://tryon.vidrip.app/widget.js" data-key="vp_…" defer></script>

Products

PUT/products/{sku}GET/products/{sku}GET/productsDELETE/products/{sku}POST/products/import

Your catalogue, keyed by your own SKU. PUT creates a product or updates it; fields you leave out are kept, and null clears one. A new product needs an image and starts live. Status is live (shoppers can try it on), draft (only you, from the dashboard) or off. We read each product's kind, fit and fabric from its photos for the size recommendation; set fit or fabric to override them.

PUT /api/v1/products/TEE-001
{ "name": "Wave Tee", "category": "tops",
  "image_url": "https://…/front.jpg", "back_image_url": "https://…/back.jpg",
  "product_url": "https://store.example/products/wave-tee",
  "fit": "regular", "fabric": "jersey",           // optional: compression | fitted | regular | relaxed | oversized | outer
  "status": "live",                               // live | draft | off
  "size_chart": { "unit": "in", "measurements_of": "body",
                  "sizes": [{ "size": "S", "chest": "35-37", "waist": "29-31" },
                            { "size": "M", "chest": "38-40", "waist": "32-34" }] } }
→ 201 created | 200 updated
{ "id", "sku": "TEE-001", "status": "live", …, "detected": { "kind": "top", "fit": "regular", "fabric": "jersey" } }

GET    /api/v1/products/TEE-001
GET    /api/v1/products?status=live&q=tee&limit=50&offset=0   → { products, total }
DELETE /api/v1/products/TEE-001                                → { deleted: true }   past try-ons keep their record

Size charts give body measurements (the person each size is made for) or garment measurements (the item laid flat, doubled), in cm or inches. Each value is a number or a range: "37-38", [37, 38] or { "min": 37, "max": 38 }. URL-encode SKUs with slashes or spaces.

Many at once. POST /api/v1/products/import takes a CSV (one row per size; product columns on each SKU's first row; template) or JSON { "products": [...] }. Every row is checked first and nothing is written unless all of them pass; add ?dry_run=1 to only check.

curl -X POST https://tryon.vidrip.app/api/v1/products/import \
  -H "Authorization: Bearer vk_live_…" -H "Content-Type: text/csv" --data-binary @catalogue.csv
→ 200 { "created": 12, "updated": 3 }
→ 422 { "error": "nothing was imported", "errors": [{ "row": 7, "sku": "TEE-004", "error": "size M: chest "3x" should be a number or a range like 37-38" }] }

Photo try-on

POST/tryonsGET/tryons/:idGET/jobs/:id

Give us a photo of the shopper and the product, get back an image of them wearing it. Jobs are asynchronous: you get a 202 with an id, then a webhook or a poll.

POST /api/v1/tryons
Authorization: Bearer vk_test_…
Idempotency-Key: order-123-tee

{ "person_image": "https://…/shopper.jpg",
  "sku": "TEE-001",                 // or "garment_id", or "garment_image": "https://…/tee.jpg" with "category"
  "quality": "performance" }        // performance (default, ~2 s) | balanced (~3 s) | quality (~5 s)

200 { "id": "…", "status": "done", "image_url": "https://…(signed, 7 days)", … }   usually: the request waits for the picture
202 { "id": "…", "status": "processing", "eta_seconds": 3, … }                     when it takes longer

GET /api/v1/tryons/:id   → { "status": "done", "image_url": "https://…(signed, 7 days)", "cost_cents": 8 }
GET /api/v1/jobs/:id     → { "status", "position", "eta_seconds", "result" }

Outcomes. When you know what the shopper kept, tell us, and the dashboard shows how often the recommended size was the one they kept.

POST /api/v1/tryons/:id/outcome   { "size_kept": "M", "returned": false }
→ { "size_recommended": "M", "size_kept": "M", "matched": true }

Reliability. Every try-on has automatic fallbacks: if the first route is down or fails, it is resubmitted on a second route and then on a backup model before it's reported failed. Limits: 60 try-ons a minute and 1,000 an hour per store, 300 product changes a minute, 20 imports an hour; a 429 carries retry_after in seconds. Size recommendations and shopper profiles cost nothing extra; a repeat of the same photo and product within a week is served from cache and not billed.

Errors are { error, code }. Images that fail moderation return 422 with person_image_rejected or garment_image_rejected. A try-on usually finishes in about two seconds, and the request waits for it: the response is the finished try-on (200, status: "done"). When it takes longer you get 202 with status: "processing", then the tryon.completed webhook or a GET. The same photo with the same garment within a week returns the finished result at once (cached: true, status: "done" in the first response). image_url is our own signed copy, good for a week (now and then a provider's temporary URL for the first few seconds, until our copy lands).

Photo to video

POST/videosGET/videos/:idGET/videos

Turn a finished photo try-on into a slow-motion clip of the shopper in the garment on a plain studio backdrop (the photo's own background is removed): a natural turn to each side and round to the back, ending facing the camera (five seconds of motion, played at half speed over about ten). Pass the try-on's id; it may still be running, and the video starts when it lands. Switch it on in the dashboard (Settings → Try-on → Photo to video).

POST /api/v1/videos
Authorization: Bearer vk_test_…
Idempotency-Key: order-123-tee-video

{ "tryon_id": "…",                  // the shopper, dressed: POST /tryons first
  "back_tryon_id": "…",             // optional: a try-on of a photo from behind, for a truer back view
  "quality": "standard" }           // standard (default, ~1.5 min, sides and back) | fast (~1 min, a smaller turn)

202 { "id": "…", "status": "dressing", "eta_seconds": 155, … }

GET /api/v1/videos/:id
→ { "id", "status": "done", "quality": "standard", "tryon_id", "back_tryon_id", "garment_id",
    "video_url": "https://…(signed, 7 days)", "poster_url": "https://…(signed, 7 days)",
    "output": { "seconds": 10.1, "fps": 24, "width": 480, "height": 832 },
    "error": null, "cost_cents": 150, "eta_seconds": null, "created_at", "finished_at", "expires_at" }

GET /api/v1/videos?limit=20   → { "videos": [ … ] }   newest first

Status. dressing (waiting for the photo try-on), then queued, processing, and done or error. eta_seconds counts the queue ahead of you. You get video.completed or video.failed by webhook, or poll every 10 to 30 seconds. Portrait photos give a 480×832 clip, landscape 832×480, at 24 fps. Videos and their files are deleted after 30 days.

Photos that work. The shopper standing, from the waist up or full body, facing the camera, with their arms away from the body and nothing in front of them. Seated photos and close-ups of the face don't turn well. Without back_tryon_id the back of the garment is inferred from the product image. The hosted try-on page offers this too: before the video starts, the shopper can add an optional photo from behind, which is dressed with the product's back image and passed as back_tryon_id.

Errors. 403 video_disabled (switched off for the store), 404 tryon_not_found, 409 tryon_failed (make a new try-on first). Limits: 200 videos an hour per store; in the hosted page, 3 an hour per shopper. A failed video is not billed. The same Idempotency-Key returns the same video.

Sizes and shopper profiles

GET/sizePUT/shoppers/{customer_ref}GET/shoppers/{customer_ref}DELETE/shoppers/{customer_ref}

Every product with a size chart gets a size recommendation from the shopper's measurements: chest, waist and hips against each size, allowing for the room the design is meant to have and how much the fabric gives. Charts can be body or garment measurements, in cm or inches. The answer comes with a reason and a confidence: low when the chart misses what the item is sized by, so you can say "likely M" instead of "your size is M".

GET /api/v1/size?sku=TEE-001&chest=101&waist=88&hips=100&height=178        (units=in for inches)
→ { "recommended_size": "M", "confidence": "high",
    "reason": "M fits as designed. L would fit too, with more room.",
    "sizes": [{ "size": "S", "fit": "tight", "note": "S is tight across the chest" }, …] }

Bras are sized by band and cup instead. Give the chart underbust (the band) and bust columns, or just name the sizes the standard way (34C, 36DD, 75B) with no measurements: we work out the shopper's own size from their underbust and bust (modern method, no +4) and pick that size, or its nearest sister size (band up one, cup down one) when you don't stock it. Bra sizes need the shopper's underbust; without it the size is null with a reason asking for it.

"size_chart": { "unit": "cm", "measurements_of": "body",
                "sizes": [{ "size": "34B", "underbust": "73-77", "bust": "88-90" },
                          { "size": "34C", "underbust": "73-77", "bust": "90-92" }] }
GET /api/v1/size?sku=BRA-001&underbust=75&chest=91      (chest is the bust)
→ { "recommended_size": "34C", "confidence": "high", "reason": "34C fits as designed. …" }

Shoppers enter their measurements once in the hosted page, or measure themselves from their photo (only the numbers are kept). To make a profile follow a signed-in customer across devices, use your own customer id. Measurements are the shopper's: you can set them and ask for a size, but reads return the size, never the numbers.

PUT    /api/v1/shoppers/{customer_ref}     { "measurements": { "height": 178, "chest": 101, "waist": 88, "hips": 100 }, "units": "cm" }
GET    /api/v1/shoppers/{customer_ref}?sku=TEE-001   → { "has_profile": true, "source": "manual", "size": { … } }
DELETE /api/v1/shoppers/{customer_ref}
POST   /api/v1/tryons  { …, "customer_ref": "c_8812" }   → the try-on, plus "size" for that customer

In the browser, the widget needs proof that the customer id came from your server: sign it with the identity secret from the dashboard (Install tab) and pass both to identify. Unsigned ids are refused.

// server
const signature = crypto.createHmac('sha256', VIDRIP_IDENTITY_SECRET).update(customer.id).digest('hex');
// page
VidripTryOn.identify({ customerId: customer.id, signature });
VidripTryOn.size('TEE-001').then(({ size, confidence }) => …);   // null without a profile

The widget and hosted sessions

POST/sessions

Paste the tag once into your theme. On each page it looks for the product's SKU (Shopify's product data, JSON-LD product data, SKU meta tags, data-sku attributes), asks which of those are live in your catalogue, and shows a Try it on button next to Add to cart only when one is. It works only on sites you allowed in the dashboard.

<script src="https://tryon.vidrip.app/widget.js" data-key="vp_…" defer></script>

<!-- or name the product in the tag itself (e.g. Shopify: data-sku="{{ product.selected_or_first_available_variant.sku }}") -->
<script src="https://tryon.vidrip.app/widget.js" data-key="vp_…" data-sku="TEE-001" defer></script>

<!-- optional: place the button yourself, and name the product there if the page doesn't -->
<div data-vidrip-tryon data-sku="TEE-001"></div>

VidripTryOn.ready.then(({ skus }) => …);                 // the live SKUs found on this page
VidripTryOn.onAddToBag(({ sku, size }) => cart.add(sku, size));
VidripTryOn.refresh();                                  // after a variant change or client-side navigation

A session is the hosted try-on page the widget opens. You can also mint one from your server with the secret key and send the shopper to its url.

POST /api/v1/sessions
{ "skus": ["TEE-001"], "return_url": "https://store.example/cart", "customer_ref": "c_8812", "metadata": { "cart": "c_9" } }
→ 201 { "id", "url": "https://tryon.vidrip.app/try/…", "embed_url": "…/embed/…", "expires_at" }

Live mirror Experimental

In the hosted try-on page, shoppers can see themselves in their own camera wearing the item, photoreal and live, for up to three minutes. Their camera streams to one of our GPUs, which draws the garment on them and streams the picture back, about one and a half seconds behind. Switch it on in the dashboard (Settings → Try-on → Live mirror). There is no API for it: it lives in the hosted page, and the button shows for tops, trousers, shorts, dresses and jumpsuits (not skirts or jackets yet) and only while a live mirror server is online. When every mirror is busy, the shopper waits in line.

Billed per started minute of streaming; streams under ten seconds are free. Nothing is recorded: frames are processed in memory and dropped. The first frame is dressed by the photo try-on model to set the look, under the same rules as any try-on photo.

Webhooks

Set an endpoint in the dashboard; you get a signing secret once. Each delivery carries a vidrip-signature: t=…,v1=… header: HMAC-SHA256 of `${t}.${body}` with your secret. Reject anything older than five minutes. Retries back off over a day.

EventWhen
tryon.completed / tryon.failedA try-on finished. Payload is the try-on object.
video.completed / video.failedA photo-to-video clip finished. Payload is the video object.
product.created / product.updated / product.deletedA product changed through the API or the dashboard. Payload is the product.
products.importedAn import finished: { created, updated, skus }.
session.convertedThe shopper tapped "Add to bag" in the hosted page: { session_id, garment_id, sku, size, metadata }.
pingSent from the dashboard to test your endpoint.