{"openapi":"3.1.0","info":{"title":"WEARFITS Virtual Try-On API","version":"1.2.0","description":"AI-powered virtual try-on and digital twin generation service.\n\n## Features\n- **Virtual Fitting Pipeline**: Create a twin from face and body inputs, or reuse an existing twin, then generate a try-on image\n- **Digital Twin Caching**: 30-day cache for faster subsequent requests with same inputs\n- **Virtual Try-On**: Clothing (top, bottom, dress) and shoes try-on\n- **Digital Twin**: Generate reusable avatar images from face plus body photo, silhouette, measurements or clothing size\n- **Estimated Size Fitting**: Compare eligible twin body profiles with body-range size charts. Scores are estimates and can reveal underlying measurement information; they are not a privacy boundary\n- **Reference Images**: Support for packshot + on-model reference pairs for better results\n\n## Garment Images\nEach garment slot (`topGarment`, `bottomGarment`, `fullBodyGarment`, `shoes`) accepts either a single image URL/base64 string, or an array of 1-2 images:\n- **`[0]`** (required) — **packshot**: the primary product image used for try-on\n- **`[1]`** (optional) — **on-model reference**: an additional photo (e.g. garment worn by a model) to help AI understand fit and draping\n\nOrder matters, naming does not. Examples:\n```json\n{\n  \"personImages\": [\"https://example.com/person.jpg\"],\n  \"topGarment\": [\"https://example.com/shirt-packshot.jpg\", \"https://example.com/shirt-on-model.jpg\"]\n}\n```\n\n## Retrying Failed Jobs\nIf a job fails (`job.failed` webhook), inspect its error before retrying. Correct permanent input or account problems first. Resubmission may incur usage; endpoint-specific deduplication and caches can reuse existing jobs or results. Failed jobs have reached a terminal outcome after applicable retries, or stopped early on a non-retryable failure.\n\nFor `POST /api/v1/digitization/batches`, send a stable `Idempotency-Key` when retrying the same submission. Within seven days, the same ownership context, key and request replay the accepted batch. Different content under the same key returns 409; a concurrent or unconfirmed submission returns 503 with `Retry-After`. Always retry with the same key, including with `options.skipCache: true`. Without the header, each successful POST creates a new batch.\n\n## Authentication\nThis OpenAPI document applies `apiKey` as its default security requirement.\nProtected operations require an API key in `X-API-Key` unless their operation-level\n`security` overrides that default. Scoped storefront tokens (wfs1.) can use\n`X-API-Key` on their allowed routes. Account tokens (wfa1.) belong in\n`X-Wearfits-Account` alongside a service API key; they are rejected in `X-API-Key`.\nThese authentication modes have different route permissions. Renewed tokens retain\njob access only within the same account and authentication mode; API-key jobs require\nthe original individual key. Public\noperations and routes that use a separate credential declare those exceptions\nat operation level; check each operation's effective security instead of\nassuming one authentication scheme for every route. An empty operation\n`security` array means the operation needs no API key.\n\nCredential kinds:\n1. **User keys** — created at dash.wearfits.com. Count both API-key usage and the monthly AI quota.\n2. **Storefront tokens** (`wfs1.`) — short-lived, minted at `POST /api/v1/storefront/tokens`. Browser widget only: `POST /api/v1/virtual-fitting` and `GET /api/v1/jobs/{id}`. Count the AI quota, not the key-usage counter.\n3. **Service keys** — server-to-server. Uncounted unless paired with `X-Wearfits-Account: wfa1.` (then the AI quota is counted).\n4. **Account tokens** (`wfa1.`) — never sent as `X-API-Key`; only as `X-Wearfits-Account` next to a service key.\n5. **Usage tokens** (`wfu1.`) — analytics-only attribution, minted only with the usage-token handshake issued by WEARFITS, sent as `X-Wearfits-Usage-Account` next to a service key. No quota, no change to job or model ownership; ignored when invalid, refused anywhere else.\n\nDo not embed an account-issued dashboard key in a shopper page. Mint a storefront token server-side, or proxy with a service key plus `X-Wearfits-Account`.\n\n### Job ownership (same-key polling)\n\nJobs are owned by the **credential that submitted them**, not by a shared service key. `GET /api/v1/jobs/{jobId}` and `DELETE /api/v1/jobs/{jobId}` compare the caller's key hash against the submitting hash; any other credential — including another valid key on the same account — receives the **same 404** as a non-existent job (never 403, so the response cannot be used to probe job ids).\n\nStorefront and account-attribution tokens hash a stable per-account namespace (`storefront:<userId>` / `account:<userId>`), so reminting still polls in-flight jobs for that merchant, and two merchants sharing a service key cannot see each other's jobs.\n\n**Key-rotation caveat:** rotating a database-backed merchant key orphans jobs that are still in flight — the new key gets 404 for them. Finish polling (and cancelling) in-flight jobs with the key that submitted them, then switch. Long-running jobs such as shoe-3d, which can take several minutes, are the practical case to watch.\n\n## File Access\nInternal files (cached digital twins) are not accessible via the API.\nResult files are delivered as URLs inside job responses and webhooks; use them\nas returned. A URL that carries signed query parameters needs no API key and is\ntime-limited; any other result URL needs the same `X-API-Key` that submitted the job.\n\n## Rate Limits\n- Job submission: 50 requests/minute\n- Job status (and published-model size updates): 500 requests/minute\n- File downloads: 300 requests/minute\n\nAn additional shared per-IP limit applies before authentication: 6,000 reads, 1,200 writes, 600 uploads, and 3,000 result-file requests per 60 seconds. Users behind one proxy or NAT can share an IP allowance; counts are approximate by location. An early limit rejection returns 429 with `Retry-After: 60` and `X-Request-ID`; temporary limit-service failures can return 503 with `X-Request-ID`.\n\nPolling a single job (`GET`/`HEAD /api/v1/jobs/{id}`) also has an approximate limit of 60 requests per 60 seconds per IP and job; polling every 3 seconds stays within it. A refusal returns 429 with `Retry-After: 60`.\n\nSubmission limits: an account (all merchant keys and account tokens of that account together) can have 5 active jobs at once; a job is active from acceptance until it completes or fails. Above that, a submit returns 429 `ACCOUNT_CONCURRENCY_LIMIT` with `Retry-After`. Each API key can also make 20 generation submissions per 5 minutes and 60 per hour; above that, a submit returns 429 `KEY_RATE_LIMIT_EXCEEDED` with `Retry-After` giving the seconds until a submission is possible. A submission refused by a limit does not count against these windows; one that fails for another reason may still count. A result served from cache holds no active job but counts as a submission. A digitization batch holds no active jobs and counts as one submission. A job submission other than a digitization batch can also return 429 `SERVICE_BUSY` with `Retry-After` when the service is temporarily overloaded. Honor `Retry-After` on all of them and retry with the same input.\n\nDaily per-account / per-API-key quota: 50 3D generations (shoe-3d, generate-3d; each digitization batch product counts), 50 other generation requests, and 1,000 file uploads (scaling with higher agreed 3D limits) per UTC day, unless your account has a different agreed limit (for authenticated accounts, keys belonging to the same account share the daily quota). Over the quota, a submit returns 429 `DAILY_QUOTA_EXCEEDED` with `Retry-After` (seconds until 00:00 UTC), `X-Quota-Limit` and `X-Quota-Remaining`; a batch larger than the remaining 3D quota is refused as a whole. Monthly plan-allowance exhaustion also returns 429 (`*_LIMIT_EXCEEDED`). Accepted submits carry the same quota headers. Job polling and batch status reads do not consume this daily quota; the rate limits above still apply.\n\nWhen an account pool is enabled for a verified key, shoe-3d, generate-3d and digitization batch creation share that account's requests-per-minute, models-per-minute, models-per-hour and models-per-UTC-day limits instead of the per-key 50/minute and per-key daily 3D pool. A minute refusal is 429 `GENERATION_REQUEST_RATE_LIMITED` or `GENERATION_MODEL_RATE_LIMITED` (`X-RateLimit-Reset` and `X-Generation-Model-Reset` are Unix seconds). An hour refusal is 429 `GENERATION_MODEL_HOURLY_LIMITED` with `Retry-After` until enough of the last 60 minutes frees. A batch larger than the full limit is 422 `GENERATION_BATCH_TOO_LARGE`. If the limit cannot be decided, the submit is 503 `GENERATION_LIMITER_UNAVAILABLE` and no job is created. Technical keys without an account keep the per-key limits.\n\nEndpoint-limit headers `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` are available when the endpoint limit runs, but are not guaranteed on early 429 or 503 responses.\n\n## Webhooks\nYou can provide a webhook URL when submitting requests to receive notifications when jobs complete.\nWebhooks are signed with HMAC-SHA256 via `X-Webhook-Signature` header using a **per-client signing secret**.\n\n**Ordinary private API-key submissions:** use the UTF-8 bytes of the lowercase hexadecimal SHA-256 digest of the submitting API key as the HMAC key. Do not decode that hex string into binary bytes. The signature header is `sha256=` followed by lowercase hexadecimal HMAC output.\n\n**Account/storefront attribution:** the signing value is instead SHA-256 of `account:<userId>` or `storefront:<userId>`. These identifier-derived values are not private secrets and must not be treated as proof of webhook origin. Prefer authenticated polling for these modes. Legacy records without an ownership hash emit an unsigned checksum; do not accept it as authentication.\n\nThe signed bytes differ by callback type:\n- **Job callbacks** (job.completed/job.failed): parse JSON, recursively sort object keys while preserving array order, then serialize compactly with JavaScript JSON.stringify semantics and UTF-8 encode. JavaScript object enumeration, Unicode and number serialization must be preserved; generic sorted JSON in another language is not necessarily equivalent. Do not sign the received raw job body.\n- **Batch callbacks** (batch.completed): sign the exact received body bytes, without sorting or reserialization.\n\nCompare signatures in constant time, validate X-Webhook-Timestamp against the signed payload timestamp and your replay window, and deduplicate by job/batch ID and event. Job deliveries make up to three attempts; batch delivery has no retry recovery. Keep polling as a fallback. See https://api.wearfits.com/llms-full.txt for the same authentication and callback contract.","contact":{"name":"WEARFITS Support","url":"https://wearfits.com/contact?s=support"}},"servers":[{"url":"https://api.wearfits.com","description":"Production"}],"tags":[{"name":"Health","description":"Health check endpoints"},{"name":"Virtual Fitting","description":"Complete pipeline: face + silhouette/photo/measurements → digital twin → try-on (with 30-day caching)"},{"name":"Try-On","description":"Virtual try-on for clothing and shoes"},{"name":"Digital Twin","description":"Generate a reusable digital twin from a face photo plus a body photo, silhouette, measurements or clothing size"},{"name":"Size Fitting","description":"Synchronous, non-billable estimated size recommendations for eligible measurement-based twins"},{"name":"Jobs","description":"Job management endpoints. Virtual-fitting and digital-twin progress is indeterminate until completion (100%); render a spinner when percentage is absent."},{"name":"Storefront","description":"Mint short-lived storefront (`wfs1.`) and account-attribution (`wfa1.`) tokens so a shopper browser never holds an exhaustible dashboard API key."},{"name":"Shoe 3D","description":"Generate a 3D shoe model (GLB) from product photos, with an optional AR try-on link."},{"name":"Digitization","description":"Bulk shoe-to-3D processing. Submit many products in one request and poll a batch endpoint for progress. Each item gets the same processing as a single shoe-3d request (validation, AI correction, optional WEARFITS upload), at lower priority than real-time traffic. Up to 500 products per batch; results expire after 7 days."},{"name":"Files","description":"Upload temporary input files, such as a GLB model passed as `glbInput` to `POST /api/v1/shoe-3d`. Uploaded files expire automatically."}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"WEARFITS API key in X-API-Key. Scoped storefront tokens (wfs1.) may use this header on allowed routes. Account tokens (wfa1.) must instead use X-Wearfits-Account alongside a service API key; they are rejected in X-API-Key."}},"schemas":{"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"timestamp":{"type":"string","format":"date-time"},"version":{"type":"string"}},"required":["status","timestamp","version"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","example":"VALIDATION_ERROR"},"message":{"type":"string","example":"Invalid request body"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"]}}},"required":["code","message"]}},"required":["success","error"]},"TryOnResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"jobId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","enum":["queued","completed"]},"estimatedProcessingTime":{"type":"number","description":"Estimated processing time in seconds","example":30},"statusUrl":{"type":"string","format":"uri","description":"URL to check job status","example":"https://api.wearfits.com/api/v1/jobs/550e8400-e29b-41d4-a716-446655440000"},"results":{"type":"array","items":{"$ref":"#/components/schemas/JobResult"},"description":"Results (returned immediately if cached)"}},"required":["success","jobId","status","estimatedProcessingTime","statusUrl"]},"JobResult":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://results.wearfits.com/result-123.png"},"expiresAt":{"type":"string","format":"date-time","example":"2024-01-02T12:00:00Z"},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"ID of the generated or reused digital twin (SHA-256 hex), reusable while its cache entry remains available"}},"required":["url","expiresAt"]},"ClothingTryOnRequest":{"type":"object","properties":{"personImages":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":3,"description":"Person photos (URLs or base64) used as the identity and body reference. Required if digitalTwinId is not provided.","example":["https://example.com/person.jpg"]},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Unique identifier for a previously generated digital twin (SHA-256 hex hash)","example":"24e73099501085bae09d26bcdc53624142cac544d5b015c599e498df8a9f6b5e"},"topGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Top garment (shirt, blouse, etc.) - single URL or array of [packshot, on-model-reference]","example":["https://example.com/top-packshot.jpg","https://example.com/top-on-model.jpg"]},"bottomGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Bottom garment (pants, skirt, etc.) - single URL or array of [packshot, on-model-reference]","example":"https://example.com/bottom.jpg"},"fullBodyGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Full-body garment (dress, jumpsuit, etc.) - single URL or array of [packshot, on-model-reference]","example":["https://example.com/dress-packshot.jpg","https://example.com/dress-on-model.jpg"]},"shoes":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Optional shoes to add to any outfit - single URL or array of [packshot, on-model-reference]","example":"https://example.com/heels.jpg"},"productImage":{"type":"string","description":"Single product image (explicit opt-in for the single-product path). Pair with `personImages` (no digital twin) OR `digitalTwinId` (the saved twin is used as the person). Cannot be combined with garment slot fields (`topGarment`, `bottomGarment`, `fullBodyGarment`, `shoes`).","example":"https://example.com/product.jpg"},"backgroundImage":{"type":"string","description":"Optional scene photo used as the try-on background (URL or base64). A portrait 9:16 photo works best. Only the scene is used: people and products in it are not copied. Works with every person input mode and with both garment slots and `productImage`. When set, `options.preserveBackground` is ignored.","example":"https://example.com/street-scene.jpg"},"productCategory":{"type":"string","enum":["auto","top","bottom","full-body","shoe"],"default":"auto","description":"Category hint for productImage (`auto` infers it from the image).","example":"auto"},"options":{"type":"object","properties":{"quality":{"type":"string","enum":["draft","standard","high"],"default":"standard","description":"Output quality level"},"preserveBackground":{"type":"boolean","default":true,"description":"Whether to preserve the original background. Ignored when `backgroundImage` is set."},"skipResultCache":{"type":"boolean","default":false,"description":"If true, skip final result cache and always generate fresh try-on"},"provider":{"type":"string","enum":["openrouter","openai","xai"],"description":"Specific provider to use (optional)"},"model":{"type":"string","description":"Pin a specific image-generation model id (testing and A/B comparisons only; production traffic should leave this unset). When set, the default model chain is bypassed and only this model is used. A pinned model that cannot accept the reference images this request needs is rejected with `INPUT_REFERENCE_LIMIT` before generation."},"promptPreset":{"type":"string","enum":["clothing-1"],"default":"clothing-1","description":"Prompt style preset for clothing try-on."}}},"webhookUrl":{"type":"string","format":"uri","description":"Webhook URL (HTTPS only) to notify when job is complete","example":"https://your-app.com/webhooks/wearfits"}}},"ShoeTryOnRequest":{"type":"object","properties":{"personImages":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Person/feet photos (URLs or base64). Required if digitalTwinId is not provided.","example":["https://example.com/feet.jpg"]},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Unique identifier for a previously generated digital twin (SHA-256 hex hash)","example":"24e73099501085bae09d26bcdc53624142cac544d5b015c599e498df8a9f6b5e"},"shoeImages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"angle":{"type":"string","enum":["front","side","back"],"description":"Angle of the shoe image"}},"required":["url"]},"minItems":1,"maxItems":4,"description":"Shoe images (URLs or base64) from various angles","example":[{"url":"https://example.com/shoe-front.jpg","angle":"front"}]},"options":{"type":"object","properties":{"quality":{"type":"string","enum":["draft","standard","high"],"default":"standard"},"provider":{"type":"string","enum":["openrouter","openai","xai"]},"model":{"type":"string","description":"Pin a specific image-generation model id. When set, the default model chain is bypassed. Intended for testing."}}},"webhookUrl":{"type":"string","format":"uri","description":"Webhook URL (HTTPS only) to notify when job is complete","example":"https://your-app.com/webhooks/wearfits"}},"required":["shoeImages"]},"DigitalTwinResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"jobId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","completed"]},"estimatedProcessingTime":{"type":"number","description":"Estimated time in seconds"},"statusUrl":{"type":"string","format":"uri"},"mode":{"type":"string","enum":["direct","photo","measurements","clothing_size"],"description":"Processing mode: direct (pre-rendered silhouette), photo (from a full-body photo), measurements (from body measurements), or clothing_size (from clothing size)"},"digitalTwinId":{"type":"string","description":"Unique ID for the generated digital twin (returned immediately if cached)"}},"required":["success","jobId","status","estimatedProcessingTime","statusUrl","mode"]},"DigitalTwinRequest":{"type":"object","properties":{"faceImage":{"type":"string","description":"Face photo for identity preservation (URL or base64). Use a well-lit, front-facing photo. Required in every mode, together with exactly one of bodyPhotoUrl, silhouetteImage, bodyMeasurements or clothingSize. Height and weight may accompany bodyPhotoUrl and refine the generated body.","example":"https://example.com/face-selfie.jpg"},"bodyPhotoUrl":{"type":"string","description":"**[Photo Mode - RECOMMENDED]** Full-body photo (URL or base64) taken with a camera/phone.\n\n**What to provide:** A normal photograph showing the entire person standing, from head to toe.\n\n**What happens:** The API creates the digital twin from this photo in a standard try-on pose (see `poseId` and `options.preservePose`).\n\n**Requirements:**\n- Must show FULL BODY (head to feet visible)\n- Person should be standing\n- Good lighting, minimal obstructions\n\n**Optional:** Add `bodyMeasurements` with only `height` and/or `weight`. They can refine the generated body.\n\n**Use this if:** You're building a consumer app where users upload photos from their phone.","example":"https://example.com/user-full-body-photo.jpg"},"poseId":{"type":"string","enum":["standing_arms_down","man_pose","girl_pose","shoe_girl_pose","walking_pose","men_relaxed","women_relaxed","default"],"default":"default","description":"[Photo, Measurements and Clothing Size Modes] Target pose for a new digital twin. Ignored for a pre-rendered silhouette. Each resolved pose creates a separately cached twin.\n\n**Available poses:**\n- `default`: Resolved from deployment configuration and gender\n- `girl_pose`: Default female standing pose\n- `standing_arms_down`: Natural standing with arms at sides\n- `man_pose`: Default male standing pose\n- `men_relaxed`: Relaxed front standing pose, weight on one leg, arms naturally at sides\n- `women_relaxed`: Relaxed front standing pose, weight on one leg, hands loosely together at the waist\n- `walking_pose`: Walking pose with a slight turn\n- `shoe_girl_pose`: Pose optimized for shoe try-on (visible feet)\n\n**Caching:** Same face + body + pose = same cached digitalTwinId. Different poses create different twins.","example":"default"},"silhouetteImage":{"type":"string","description":"**[Direct Mode - Advanced]** Pre-rendered full-body silhouette image (URL or base64) in the WEARFITS silhouette format (NOT a regular photo).\n\n**Use this if:** You are a partner who received the silhouette format specification from WEARFITS.\n\n**Note:** Most applications should use Photo Mode (bodyPhotoUrl) instead.","example":"https://example.com/silhouette.png"},"bodyMeasurements":{"type":"object","properties":{"height":{"type":"number","minimum":140,"maximum":210,"description":"Body height in cm (140-210)","example":170},"chest":{"type":"number","minimum":70,"maximum":160,"description":"Chest/bust circumference in cm (70-160)","example":90},"waist":{"type":"number","minimum":55,"maximum":170,"description":"Waist circumference in cm (55-170)","example":70},"hip":{"type":"number","minimum":70,"maximum":170,"description":"Hip circumference in cm (70-170)","example":95},"inseam":{"type":"number","minimum":60,"maximum":100,"description":"Inseam length in cm (60-100)","example":75},"weight":{"type":"number","minimum":30,"maximum":250,"description":"Body weight in kg (30-250)","example":65}},"description":"**[Measurements Mode]** Create the digital twin from body measurements instead of a photo.\n\n**What to provide:** At least 2 body measurements:\n- height: Body height (140-210 cm)\n- chest: Chest/bust circumference (70-160 cm)\n- waist: Waist circumference (55-170 cm)\n- hip: Hip circumference (70-170 cm)\n- inseam: Inseam length (60-100 cm)\n- weight: Body weight (30-250 kg)\n\nThese are validation bounds. Any value inside them is accepted; unusual combinations of\nmeasurements produce a less precise body estimate. Supplying `gender` improves the result.\n\n**What happens:** The API creates a digital twin whose body proportions reflect the supplied measurements, in the pose selected by `poseId`.\n\n**Use this if:** You have body measurement data (e.g., from a sizing profile) but no full-body photo.\n\n**Note:** The generated body is an estimate based on the supplied measurements.\n\n**With `bodyPhotoUrl`:** Only `height` and/or `weight` are allowed, and one of them is enough. The request stays in Photo Mode: they can refine the generated body."},"clothingSize":{"$ref":"#/components/schemas/ClothingSize"},"gender":{"type":"string","enum":["male","female","neutral"],"description":"Gender of the person. If not provided, a neutral presentation is used.","example":"female"},"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Optional additional styling instructions (e.g. clothing, background).","example":"wearing casual jeans and white t-shirt, outdoor setting"},"options":{"type":"object","properties":{"background":{"type":"string","enum":["white","dark"],"default":"white","description":"Studio background for a new digital twin: white (default) or dark (medium-dark neutral graphite studio with soft even lighting). Different backgrounds create separately cached twins."},"quality":{"type":"string","enum":["draft","standard","high"],"default":"standard","description":"Quality tier affects processing time"},"seed":{"type":"integer","description":"Random seed for reproducible generation (not guaranteed with all models)"},"skipCache":{"type":"boolean","default":false,"description":"If true, skip cache and always generate fresh digital twin"},"promptPreset":{"type":"string","enum":["twin-1"],"default":"twin-1","description":"Prompt style preset for digital twin generation."},"preservePose":{"type":"boolean","default":false,"description":"[Photo Mode only] If true, preserve the original pose from bodyPhotoUrl instead of applying a standard pose. Useful when you want the digital twin to match the exact pose in the input photo."},"provider":{"type":"string","enum":["openrouter","openai"],"description":"Image provider override for digital twin generation."}},"description":"Generation options"},"webhookUrl":{"type":"string","format":"uri","description":"Webhook URL (HTTPS only) to notify when job is complete","example":"https://your-app.com/webhooks/wearfits"}}},"ClothingSize":{"type":"object","properties":{"height":{"type":"number","minimum":140,"maximum":210,"description":"Body height in cm (140-210)","example":170},"size":{"type":"string","enum":["XS","S","M","L","XL","XXL","3XL"],"description":"Typical clothing size worn (XS, S, M, L, XL, XXL, 3XL)","example":"M"}},"required":["height","size"],"description":"**[Clothing Size Mode]** Create the digital twin from a clothing size instead of exact measurements.\n\n**What to provide:**\n- height: Body height in cm (140-210)\n- size: Clothing size (XS, S, M, L, XL, XXL, 3XL)\n\n**What happens:** The API creates a digital twin whose body proportions are estimated from the given size and height.\n\n**Use this if:** You only know the user's clothing size, not their exact measurements.\n\n**Note:** Requires `gender` field to be set (defaults to female if not provided)."},"DigitalTwinStatusResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"digitalTwinId":{"type":"string","description":"The digital twin ID that was checked"},"valid":{"type":"boolean","description":"Whether the digital twin exists and is available for use"},"createdAt":{"type":"string","description":"When the digital twin was created (ISO 8601)"},"expiresAt":{"type":"string","description":"When the digital twin will expire (ISO 8601)"}},"required":["success","digitalTwinId","valid"]},"Shoe3DResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"jobId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued"]},"models":{"type":"array","items":{"type":"string"},"description":"Models that will be used for generation"},"estimatedProcessingTime":{"type":"number","description":"Estimated time in seconds (based on slowest model)"},"statusUrl":{"type":"string","format":"uri"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/JobWarning"},"description":"Non-fatal notices; absent when there are none. `DUPLICATE_INPUT_IMAGES`: duplicate input images (same URL) were ignored. Also returned on the job."}},"required":["success","jobId","status","models","estimatedProcessingTime","statusUrl"]},"JobWarning":{"type":"object","properties":{"code":{"type":"string","example":"DUPLICATE_INPUT_IMAGES"},"message":{"type":"string","example":"1 duplicate image(s) were ignored. Each image in a job should be a distinct file."},"droppedIndexes":{"type":"array","items":{"type":"integer","minimum":0},"description":"0-based indexes (original request order) of the input images that were dropped","example":[2]},"sourceJobId":{"type":"string","description":"`SHARED_GENERATION` only: the earlier job of the same account whose result this job reused"}},"required":["code","message"]},"Shoe3DValidationError":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["SHOE_IMAGE_VALIDATION_FAILED"]},"message":{"type":"string","description":"Human-readable error message","example":"No suitable shoe image found."},"details":{"type":"array","items":{"$ref":"#/components/schemas/ShoeValidationIssue"},"description":"Detailed list of validation issues"}},"required":["code","message","details"]},"validation":{"type":"object","properties":{"isValid":{"type":"boolean","enum":[false]},"bestImageIndex":{"type":"integer","minimum":0},"isRightShoe":{"type":"boolean","nullable":true},"confidence":{"type":"number","minimum":0,"maximum":1},"issues":{"type":"array","items":{"$ref":"#/components/schemas/ShoeValidationIssue"}},"processingTimeMs":{"type":"number"}},"required":["isValid","bestImageIndex","isRightShoe","confidence","issues","processingTimeMs"],"description":"Full validation result for debugging"}},"required":["success","error","validation"]},"ShoeValidationIssue":{"type":"object","properties":{"code":{"type":"string","enum":["BAD_LIGHTING","BUSY_BACKGROUND","MULTIPLE_SHOES","SHOE_NOT_FULL_FRAME","SHOE_CROPPED","REFLECTIVE_LIGHTS","PEOPLE_OR_HANDS","TEXT_OR_WATERMARKS","BLURRY_IMAGE","NOT_A_SHOE","BACK_VIEW_ONLY","SOLE_VIEW_ONLY"],"description":"Issue code identifying the problem"},"message":{"type":"string","description":"Human-readable description of the issue"},"severity":{"type":"string","enum":["error","warning"],"description":"Severity level - errors prevent processing, warnings are informational"}},"required":["code","message","severity"]},"Shoe3DRequest":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string"},"maxItems":10,"description":"Product images as URLs or base64 data URLs (up to 10). Image validation selects the best input for generation; AI correction can combine reference images. Supply images for photo-based generation, or omit them when processing glbInput. For bags and other products, set options.productType to other or auto.","example":["https://example.com/shoe-front.jpg","https://example.com/shoe-side.jpg"]},"models":{"type":"array","items":{"type":"string","enum":["fal-ai/hunyuan-3d/v3.1/pro/image-to-3d","fal-ai/tripo3d/h3.1/image-to-3d"]},"minItems":1,"maxItems":1,"default":["fal-ai/hunyuan-3d/v3.1/pro/image-to-3d"],"description":"Primary 3D generation model. Kept as a single-element array for backwards-compatibility. Supported values: `fal-ai/hunyuan-3d/v3.1/pro/image-to-3d` (default) and `fal-ai/tripo3d/h3.1/image-to-3d` (alternate). On model-scoped generation failures the pipeline automatically falls back to the other model once. Account-level provider failures stop the chain immediately. Optional — the default is used if omitted."},"glbInput":{"type":"string","description":"Optional URL or base64 data URL to an existing GLB model. Skips AI geometry generation. Very dense models may be simplified before processing (best effort; not an enforced limit). Further processing follows options.enhanceTexture, options.smoothNormals and options.uploadToWearFits. Prefer uploading through POST /api/v1/files/upload and passing the returned URL to avoid large JSON payloads.","example":"https://example.com/shoe.glb"},"options":{"type":"object","properties":{"modelName":{"type":"string","minLength":1,"maxLength":50,"description":"Display name for the model uploaded to WEARFITS (up to 50 characters)."},"uploadToWearFits":{"type":"boolean","default":false,"description":"Upload the generated 3D model to WEARFITS for shoe try-on"},"validateInQueue":{"type":"boolean","default":true,"description":"If true (default), run image validation and AI correction asynchronously in the queue. The request returns immediately with a job ID, and validation/correction happens during processing. If false, validation runs synchronously and returns 400 if no valid image is found."},"skipCache":{"type":"boolean","default":false,"description":"If true, skip cache and always generate a fresh 3D model."},"correctImage":{"type":"boolean","default":true,"description":"If true (default), use AI to generate a clean packshot from the uploaded photo(s) before validation and 3D generation. The generated image will have a clean background, proper framing, and studio-quality lighting. This can improve 3D generation results for user photos that have suboptimal backgrounds or lighting. Set to false to skip correction."},"enhanceTexture":{"type":"boolean","default":true,"description":"Enhance the GLB texture using AI, with the input images as references. Runs before WEARFITS upload. Falls back to the original GLB on failure. Enabled by default."},"refineLogo":{"type":"boolean","default":false,"description":"Run a second AI pass focused on fixing logos, brand text, and emblems after texture enhancement. Requires enhanceTexture to be enabled. Works with both genaiQuality settings."},"smoothNormals":{"type":"boolean","default":true,"description":"Apply automatic smooth normals to the final GLB before WEARFITS upload. Enabled by default — improves lighting/shading for rendering. **Disable this if the GLB is going to be edited manually afterwards** (for example in Blender): otherwise it can cause problems when using Merge by Distance or sculpting tools. Reason: smoothing splits vertices at sharp edges into coincident duplicates to carry different normals (a glTF limitation — no per-face-corner/loop normals), so Merge by Distance destroys the sharp-edge shading, and sculpting brushes move only one of the duplicates leaving holes."},"genaiQuality":{"type":"string","enum":["default","high"],"default":"high","description":"AI quality for image correction and texture enhancement. Defaults to \"high\". \"default\" is faster and cheaper; \"high\" gives fuller texture coverage at higher quality and is slower. Both use fallback chains for reliability."},"sessionId":{"type":"string","description":"Optional session ID to be passed to WEARFITS as token during shoe upload. Used for compatibility with frontend apps that have user sessions, ensuring uploaded objects are correctly assigned to the user in their WEARFITS account. Takes precedence over the account resolved from the API credential: when a sessionId is sent it becomes the only ownership claim on the upload."},"gapFillReproject":{"type":"boolean","description":"Fill texture areas the enhancement could not cover. Defaults to true whenever enhanceTexture is on (the server can disable the default); send false to opt out. true with enhanceTexture: false is rejected with 400; false is always accepted. The enhanced result and the WEARFITS link are cached per effective option set, so different settings never share a cached texture."},"aoBake":{"type":"string","enum":["baked","off"],"description":"Bake ambient occlusion into the base color texture during AI texture enhancement. Defaults to \"baked\" whenever enhanceTexture is on (the server can disable the default); send \"off\" to opt out. \"baked\" with enhanceTexture: false is rejected with 400; \"off\" is always accepted. Same cache behavior as gapFillReproject."},"aoStrength":{"type":"number","minimum":0,"maximum":1,"description":"Ambient-occlusion strength 0..1 (server default 0.7 when omitted). Ignored when aoBake is off."},"pipelineVariant":{"type":"string","enum":["A","B"],"default":"A","description":"**BETA — opt-in, not recommended for production.** \"A\" (default) = standard pipeline. \"B\" = experimental high-detail variant; its final model has the same polygon budget as A. Do not use B in production until a clear quality improvement is demonstrated."},"productType":{"type":"string","enum":["shoe","other","auto"],"default":"shoe","description":"\"shoe\" (default): shoe-specific processing and orientation. \"other\": generic product processing. \"auto\": footwear is detected automatically from the uploaded images; anything else is processed as generic."},"longestSideCm":{"type":"number","minimum":5,"maximum":150,"description":"Real length of the product's longest horizontal side (width or depth, never the height) in centimetres (5-150, stored with 0.1 cm precision). The AR try-on displays the product at this size. Applies to productType \"other\"; ignored for shoes.","example":32.5}}},"webhookUrl":{"type":"string","format":"uri","description":"Webhook URL (HTTPS only) to notify when job is complete","example":"https://your-app.com/webhooks/wearfits"}}},"VirtualFittingResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Unique identifier for a previously generated digital twin (SHA-256 hex hash)","example":"24e73099501085bae09d26bcdc53624142cac544d5b015c599e498df8a9f6b5e"},"jobId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","completed"]},"estimatedProcessingTime":{"type":"number","description":"Estimated time in seconds"},"statusUrl":{"type":"string","format":"uri"},"mode":{"type":"string","enum":["direct","photo","measurements","clothing_size","twin_id"],"description":"Processing mode used for the request"},"twinCached":{"type":"boolean","description":"Whether the digital twin was retrieved from cache (faster processing)"},"results":{"type":"array","items":{"$ref":"#/components/schemas/JobResult"},"description":"Results (returned immediately if cached)"}},"required":["success","jobId","status","estimatedProcessingTime","statusUrl","mode","twinCached"]},"VirtualFittingRequest":{"type":"object","properties":{"faceImage":{"type":"string","description":"Face/head photo for identity preservation (URL or base64). Required when generating a new twin from silhouetteImage, photoUrl, bodyMeasurements or clothingSize. Not needed when reusing digitalTwinId.","example":"https://example.com/face.jpg"},"silhouetteImage":{"type":"string","description":"[Direct Mode] Pre-rendered body silhouette image in the WEARFITS silhouette format (URL or base64), paired with faceImage. Choose this or another body source; faceImage alone does not require this particular mode.","example":"https://example.com/silhouette.png"},"photoUrl":{"type":"string","description":"[Photo Mode] Full-body photo (URL or base64) showing the person head to toe. Pair with faceImage: both are required to generate a new photo-mode twin. A photoUrl-only request can pass schema validation but fails asynchronously with MISSING_INPUTS. poseId is optional.","example":"https://example.com/full-body-photo.jpg"},"poseId":{"type":"string","enum":["standing_arms_down","man_pose","girl_pose","shoe_girl_pose","walking_pose","men_relaxed","women_relaxed","default"],"default":"default","description":"Pose used when generating a new twin from photoUrl, bodyMeasurements or clothingSize. Choose men_relaxed for relaxed front standing with weight on one leg and arms naturally at sides, women_relaxed for relaxed front standing with hands loosely together at the waist, or walking_pose for a walking pose. Ignored for an existing digitalTwinId or pre-rendered silhouette. To change an existing twin pose, create a new twin. The default pose is resolved from deployment configuration and gender; male default remains man_pose; female default remains girl_pose.","example":"default"},"bodyMeasurements":{"$ref":"#/components/schemas/BodyMeasurements"},"clothingSize":{"allOf":[{"$ref":"#/components/schemas/ClothingSize"},{"description":"**[Clothing Size Mode]** Create the digital twin from a clothing size instead of exact measurements.\n\n**What to provide:**\n- height: Body height in cm (140-210)\n- size: Clothing size (XS, S, M, L, XL, XXL, 3XL)\n\n**What happens:** The API creates a digital twin whose body proportions are estimated from the given size and height, and applies the requested garments.\n\n**Use this if:** You only know the user's clothing size, not their exact measurements.\n\n**Note:** Requires `gender` field to be set (defaults to female if not provided)."}]},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Unique identifier for a previously generated digital twin (SHA-256 hex hash)","example":"24e73099501085bae09d26bcdc53624142cac544d5b015c599e498df8a9f6b5e"},"gender":{"type":"string","enum":["male","female","neutral"],"description":"Gender of the person. If not provided, a neutral presentation is used.","example":"female"},"topGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Top garment (shirt, blouse, etc.) - single URL or array of [packshot, on-model-reference]","example":["https://example.com/top-packshot.jpg","https://example.com/top-on-model.jpg"]},"bottomGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Bottom garment (pants, skirt, etc.) - single URL or array of [packshot, on-model-reference]","example":"https://example.com/bottom.jpg"},"fullBodyGarment":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Full-body garment (dress, jumpsuit, etc.) - single URL or array of [packshot, on-model-reference]","example":["https://example.com/dress-packshot.jpg","https://example.com/dress-on-model.jpg"]},"shoes":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2,"description":"Array of 1-2 images (URLs or base64): first is packshot, second (optional) is on-model reference","example":["https://example.com/packshot.jpg","https://example.com/on-model.jpg"]}],"description":"Optional shoes to add to any outfit - single URL or array of [packshot, on-model-reference]","example":"https://example.com/heels.jpg"},"productImage":{"type":"string","description":"Single product image shortcut (explicit opt-in for the single-product path). When provided (and no slot garments), the try-on uses the person/digital twin and this one product image. Use productCategory as a hint.","example":"https://example.com/product.jpg"},"backgroundImage":{"type":"string","description":"Optional scene photo used as the try-on background (URL or base64). A portrait 9:16 photo works best. Only the scene is used: people and products in it are not copied. Works with every person input mode and with both garment slots and `productImage`. When set, `options.preserveBackground` is ignored.","example":"https://example.com/street-scene.jpg"},"productCategory":{"type":"string","enum":["auto","top","bottom","full-body","shoe"],"default":"auto","description":"Category for productImage. Use `auto` to have the wearable product type inferred from the image.","example":"auto"},"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Optional additional styling instructions (e.g. clothing, background).","example":"wearing casual jeans and white t-shirt, outdoor setting"},"options":{"type":"object","properties":{"background":{"type":"string","enum":["white","dark"],"default":"white","description":"Studio background for a newly generated twin: white (default) or dark (medium-dark neutral graphite studio with soft even lighting). Ignored when reusing digitalTwinId; create a new twin to change its background."},"preserveBackground":{"type":"boolean","default":false,"description":"If true, preserve the twin background in outfit try-ons. Defaults to false (white studio for outfit generation). Single-product try-ons preserve the person background. Ignored when `backgroundImage` is set."},"quality":{"type":"string","enum":["draft","standard","high"],"default":"standard","description":"Quality tier affects processing time"},"seed":{"type":"integer","description":"Random seed for reproducible generation (not guaranteed with all models)"},"skipCache":{"type":"boolean","default":false,"description":"If true, skip digital twin cache and always generate fresh"},"skipResultCache":{"type":"boolean","default":false,"description":"If true, skip final result cache and always generate fresh try-on"},"preservePose":{"type":"boolean","default":false,"description":"[Photo Mode only] If true, preserve the original pose from photoUrl instead of applying a standard pose."},"provider":{"type":"string","enum":["openrouter","openai"],"description":"Image provider override for both digital twin and try-on steps."}},"description":"Generation options"},"webhookUrl":{"type":"string","format":"uri","description":"Webhook URL (HTTPS only) to notify when job is complete","example":"https://your-app.com/webhooks/wearfits"}}},"BodyMeasurements":{"type":"object","properties":{"height":{"type":"number","minimum":140,"maximum":210,"description":"Body height in cm (140-210)","example":170},"chest":{"type":"number","minimum":70,"maximum":160,"description":"Chest/bust circumference in cm (70-160)","example":90},"waist":{"type":"number","minimum":55,"maximum":170,"description":"Waist circumference in cm (55-170)","example":70},"hip":{"type":"number","minimum":70,"maximum":170,"description":"Hip circumference in cm (70-170)","example":95},"inseam":{"type":"number","minimum":60,"maximum":100,"description":"Inseam length in cm (60-100)","example":75},"weight":{"type":"number","minimum":30,"maximum":250,"description":"Body weight in kg (30-250)","example":65}},"description":"**[Measurements Mode]** Create the digital twin from body measurements instead of a photo.\n\n**What to provide:** At least 2 body measurements:\n- height: Body height (140-210 cm)\n- chest: Chest/bust circumference (70-160 cm)\n- waist: Waist circumference (55-170 cm)\n- hip: Hip circumference (70-170 cm)\n- inseam: Inseam length (60-100 cm)\n- weight: Body weight (30-250 kg)\n\nThese are validation bounds. Any value inside them is accepted; unusual combinations of\nmeasurements produce a less precise body estimate. Supplying `gender` improves the result.\n\n**What happens:** The API creates a digital twin whose body proportions reflect the supplied measurements, in the pose selected by `poseId`, and applies the requested garments.\n\n**Use this if:** You have body measurement data (e.g., from a sizing profile) but no full-body photo.\n\n**Note:** The generated body is an estimate based on the supplied measurements."},"StorefrontTokenResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"token":{"type":"string"},"audience":{"type":"string","enum":["storefront","account","usage"]},"expiresAt":{"type":"string","format":"date-time"}},"required":["success","token","audience","expiresAt"]},"StorefrontTokenRequest":{"type":"object","properties":{"audience":{"type":"string","enum":["storefront","account","usage"],"description":"`storefront` is the browser widget token (`wfs1.`). `account` is the server-to-server attribution token (`wfa1.`) sent as `X-Wearfits-Account` next to a service key. `usage` (`wfu1.`, minted only with the usage-token handshake issued by WEARFITS as `handshake`, at most 2 hours) is analytics-only attribution sent as `X-Wearfits-Usage-Account`: it grants no quota, ownership or access.","example":"storefront"},"ttlSeconds":{"type":"integer","minimum":1,"maximum":86400,"description":"Lifetime in seconds. Defaults to 7200 for storefront and 3600 for account. Capped at 86400.","example":7200},"handshake":{"type":"string","minLength":1,"description":"Server-to-server bootstrap: the integration handshake issued by WEARFITS (for `audience: \"usage\"`: the separate usage-token handshake, which mints nothing else). Required when minting without a resolved merchant account (no merchant key / no `X-Wearfits-Account`)."},"userId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$","description":"SaaS `user_id` to mint for. Required with `handshake`. Ignored when the caller already authenticated as that merchant.","example":"clxxxxxxxxxxxxxxxxxxxx"}}},"SizeFittingResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"available":{"type":"boolean"},"reason":{"type":"string","enum":["body_profile_unavailable","profile_quality_too_low"]},"confidence":{"type":"string","enum":["estimated"]},"recommendations":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"category":{"type":"string","enum":["top","bottom","fullBody"]},"recommendedSize":{"type":"string"},"sizes":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"dimensions":{"type":"object","properties":{"height":{"type":"object","properties":{"status":{"type":"string","enum":["fit","loose","tight"]},"score":{"type":"number","minimum":-5,"maximum":5}},"required":["status","score"]},"chest":{"type":"object","properties":{"status":{"type":"string","enum":["fit","loose","tight"]},"score":{"type":"number","minimum":-5,"maximum":5}},"required":["status","score"]},"waist":{"type":"object","properties":{"status":{"type":"string","enum":["fit","loose","tight"]},"score":{"type":"number","minimum":-5,"maximum":5}},"required":["status","score"]},"hip":{"type":"object","properties":{"status":{"type":"string","enum":["fit","loose","tight"]},"score":{"type":"number","minimum":-5,"maximum":5}},"required":["status","score"]},"inseam":{"type":"object","properties":{"status":{"type":"string","enum":["fit","loose","tight"]},"score":{"type":"number","minimum":-5,"maximum":5}},"required":["status","score"]}}}},"required":["label","dimensions"]}}},"required":["productId","category","recommendedSize","sizes"]}}},"required":["success","available","recommendations"],"example":{"success":true,"available":true,"confidence":"estimated","recommendations":[{"productId":"shirt-123","category":"top","recommendedSize":"M","sizes":[{"label":"S","dimensions":{"chest":{"status":"tight","score":-1.38},"waist":{"status":"tight","score":-1.25}}},{"label":"M","dimensions":{"chest":{"status":"fit","score":0.75},"waist":{"status":"fit","score":0.5}}}]}]}},"SizeFittingRequest":{"type":"object","properties":{"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$"},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"category":{"type":"string","enum":["top","bottom","fullBody"]},"sizeChart":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"basis":{"type":"string","enum":["body"]},"unit":{"type":"string","enum":["cm","in"]},"sizes":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":32},"measurements":{"type":"object","properties":{"height":{"type":"object","properties":{"min":{"type":"number","minimum":1,"maximum":500},"max":{"type":"number","minimum":1,"maximum":500}},"required":["min","max"]},"chest":{"type":"object","properties":{"min":{"type":"number","minimum":1,"maximum":500},"max":{"type":"number","minimum":1,"maximum":500}},"required":["min","max"]},"waist":{"type":"object","properties":{"min":{"type":"number","minimum":1,"maximum":500},"max":{"type":"number","minimum":1,"maximum":500}},"required":["min","max"]},"hip":{"type":"object","properties":{"min":{"type":"number","minimum":1,"maximum":500},"max":{"type":"number","minimum":1,"maximum":500}},"required":["min","max"]},"inseam":{"type":"object","properties":{"min":{"type":"number","minimum":1,"maximum":500},"max":{"type":"number","minimum":1,"maximum":500}},"required":["min","max"]}},"additionalProperties":false}},"required":["label","measurements"],"additionalProperties":false},"minItems":1,"maxItems":30}},"required":["version","basis","unit","sizes"],"additionalProperties":false}},"required":["id","category","sizeChart"],"additionalProperties":false},"minItems":1,"maxItems":20}},"required":["digitalTwinId","products"],"additionalProperties":false,"example":{"digitalTwinId":"c3721f86f03c1d7035f0728cad2ca97d027781dc7e1722cf92901e10f56007c0","products":[{"id":"shirt-123","category":"top","sizeChart":{"version":1,"basis":"body","unit":"cm","sizes":[{"label":"S","measurements":{"chest":{"min":86,"max":94},"waist":{"min":70,"max":78}}},{"label":"M","measurements":{"chest":{"min":94,"max":102},"waist":{"min":78,"max":86}}}]}}]}},"JobStatusResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","validating","processing","uploading","completed","failed"]},"mode":{"type":"string","enum":["clothing","shoes","digital-twin","virtual-fitting","shoe-3d"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"results":{"type":"array","items":{"$ref":"#/components/schemas/JobResult"}},"digitalTwinId":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"ID of the generated or reused digital twin (SHA-256 hex)"},"wearfitsTryOn":{"$ref":"#/components/schemas/WearFitsTryOn"},"wearfitsError":{"type":"string"},"shoe3dModelResults":{"type":"array","items":{"$ref":"#/components/schemas/Shoe3DModelResult"},"description":"Per-model results for shoe-3d jobs (includes enhancedGlbUrl if texture enhancement was enabled)"},"error":{"$ref":"#/components/schemas/JobError"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/JobWarning"},"description":"Non-fatal notices; absent when there are none. `DUPLICATE_INPUT_IMAGES`: duplicate input images were ignored and the job ran on the distinct ones. `SHARED_GENERATION`: the result was reused from an earlier job of the same account (`sourceJobId`)."},"progress":{"$ref":"#/components/schemas/JobProgress"}},"required":["id","status","mode","createdAt","updatedAt"]},"WearFitsTryOn":{"type":"object","properties":{"modelId":{"type":"string","description":"WEARFITS model ID"},"colorId":{"type":"string","description":"WEARFITS color ID"},"viewerUrl":{"type":"string","format":"uri","description":"URL to the WEARFITS AR try-on viewer"},"glbUrl":{"type":"string","format":"uri","description":"URL to the WEARFITS-hosted GLB after autofit positioning (fitting-room-ready, carries embedded fit metadata). Distinct from the generation GLB in `results[].url`. Present only for shoe uploads once autofit reports \"finished\"."}},"required":["modelId","colorId","viewerUrl"]},"Shoe3DModelResult":{"type":"object","properties":{"model":{"type":"string","description":"Identifier of the model that generated this result"},"status":{"type":"string","enum":["queued","processing","completed","failed"],"description":"Status of this specific model generation"},"glbUrl":{"type":"string","format":"uri","description":"URL to the generated GLB 3D model file"},"zipUrl":{"type":"string","format":"uri","description":"URL to the generated ZIP archive (for models that output zip)"},"thumbnailUrl":{"type":"string","format":"uri","description":"URL to a thumbnail preview image"},"renderGridUrl":{"type":"string","format":"uri","description":"Multi-angle preview image URL for quality inspection"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"description":"Error details if generation failed"},"timeMs":{"type":"number","description":"Generation time in milliseconds"},"providerJobId":{"type":"string","description":"Provider-specific job ID for tracking"},"statusUrl":{"type":"string","description":"Provider status URL for checking generation progress"},"enhancedGlbUrl":{"type":"string","format":"uri","description":"URL to AI texture-enhanced GLB (if enhanceTexture was enabled)"},"textureEnhancementError":{"type":"string","description":"Error message if texture enhancement failed (original GLB used as fallback)"},"logoGridOutputUrl":{"type":"string","format":"uri","description":"URL to the logo-refinement preview image (if refineLogo was enabled)"},"logoModelUsed":{"type":"string","description":"AI model used for logo refinement pass"}},"required":["model","status"]},"JobError":{"type":"object","properties":{"code":{"type":"string","example":"PROVIDER_ERROR"},"message":{"type":"string","example":"External provider returned an error"},"retryable":{"type":"boolean","example":true}},"required":["code","message","retryable"]},"JobProgress":{"type":"object","properties":{"stage":{"type":"string","example":"processing"},"percentage":{"type":"number","minimum":0,"maximum":100,"example":50,"description":"Absent for virtual-fitting/digital-twin until completed (100). Render indeterminate progress when absent."}},"required":["stage"]},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]},"SetModelSizeResponse":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"modelId":{"type":"string","example":"abc123"},"longestSideCm":{"type":"number","nullable":true,"description":"The size now stored on the model, in cm; null when it was removed.","example":32.5}},"required":["modelId","longestSideCm"]}},"required":["success","data"]},"SetModelSizeRequest":{"type":"object","properties":{"longestSideCm":{"type":"number","nullable":true,"minimum":5,"maximum":150,"description":"Real length of the product's longest horizontal side (width or depth, never the height) in centimetres (5-150, stored with 0.1 cm precision). `null` removes the size: the try-on keeps the model's own scale when it is plausible for a bag (between 10 and 100 cm across) and shows it at 40 cm otherwise.","example":32.5}},"required":["longestSideCm"],"additionalProperties":false}}},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health check","description":"Returns the health status of the API","security":[],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/v1/files/upload":{"post":{"tags":["Files"],"security":[{"apiKey":[]}],"summary":"Upload a file","description":"Upload a file via multipart/form-data. A verified account token is accepted only on this route and stores the file permanently under sources/ for later 3D generation. API-key uploads retain their temporary signed URL behavior.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"The binary file payload to upload","format":"binary"}}}}}},"responses":{"201":{"description":"File uploaded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"key":{"type":"string"},"url":{"type":"string","format":"uri","description":"Public source URL or temporary signed URL"},"filename":{"type":"string","description":"Original filename"},"size":{"type":"number","description":"File size in bytes"}},"required":["success","key","url","filename","size"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tryon/clothing":{"post":{"tags":["Try-On"],"summary":"Submit clothing try-on request","description":"Generate a virtual try-on image without creating a digital twin. Use a raw person photo or load an existing twin image.\n\n## Person Input (choose ONE)\n\n**Option 1: `digitalTwinId` (Recommended)**\nUse a pre-generated digital twin to reuse the same face and body reference image across try-ons. Generated results can still vary.\nFirst create a twin via `POST /api/v1/digital-twin`, then use the returned ID here.\n\n```json\n{ \"digitalTwinId\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\", \"topGarment\": \"https://example.com/shirt.jpg\" }\n```\n\n**Option 2: `personImages` (Direct mode — no digital twin)**\nSend a person photo directly with the try-on request. **Warning:** Face may vary between requests.\n\n```json\n{ \"personImages\": [\"https://example.com/person.jpg\"], \"topGarment\": \"https://example.com/shirt.jpg\" }\n```\n\n**Option 2b: `productImage` (single product)**\nSingle packshot — same behaviour as `virtual-fitting` `productImage`. Pair with either\n`personImages` (no twin, raw photo) or `digitalTwinId` (the saved twin is used as the person).\n\n```json\n{\n  \"personImages\": [\"https://example.com/model.jpg\"],\n  \"productImage\": \"https://example.com/jacket.jpg\",\n  \"productCategory\": \"top\"\n}\n```\n\n```json\n{\n  \"digitalTwinId\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n  \"productImage\": \"https://example.com/jacket.jpg\",\n  \"productCategory\": \"top\"\n}\n```\n\n> **Important:** You cannot use both `digitalTwinId` and `personImages` in the same request.\n\n## Garment Types\n\n- `productImage`: Single product (cannot mix with slot garments below)\n- `topGarment`: Shirts, blouses, jackets\n- `bottomGarment`: Pants, skirts, shorts\n- `fullBodyGarment`: Dresses, jumpsuits, rompers\n- `shoes`: Optional footwear to add to any outfit\n\n## Background\n\nOptional `backgroundImage` (URL or base64): scene photo used as the try-on background; portrait 9:16 works best. Only the scene is used (people/products in it are not copied). Works with `personImages` or `digitalTwinId`, garment slots and `productImage`; when set, `options.preserveBackground` is ignored.\n\n## Garment Image Formats\n\n- Single URL: `\"https://example.com/garment.jpg\"`\n- Array with reference: `[\"packshot.jpg\", \"on-model.jpg\"]` - helps AI understand fit and drape\n\n## Valid Garment Combinations\n\n- Top only, Bottom only, or Top + Bottom\n- Full-body garment (dress/jumpsuit)\n- Any combination above + optional Shoes\n- A single productImage with productCategory shoe for standalone shoe image try-on","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClothingTryOnRequest"}}}},"responses":{"201":{"description":"Job created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryOnResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `ACCOUNT_CONCURRENCY_LIMIT`: the account already has 5 active jobs across its keys; retry after `Retry-After` seconds or when one finishes. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `SERVICE_BUSY`: the service is temporarily overloaded; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tryon/shoes":{"post":{"tags":["Try-On"],"summary":"Submit shoe try-on request","description":"Generate a shoe try-on image without creating a digital twin. Supply personImages or an existing digitalTwinId (not both), plus shoeImages as objects with url and optional angle. This endpoint does not accept productImage; use /api/v1/tryon/clothing for that shortcut. Returns a job ID for tracking. This is image generation, not a live AR viewer.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShoeTryOnRequest"}}}},"responses":{"201":{"description":"Job created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TryOnResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `ACCOUNT_CONCURRENCY_LIMIT`: the account already has 5 active jobs across its keys; retry after `Retry-After` seconds or when one finishes. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `SERVICE_BUSY`: the service is temporarily overloaded; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digital-twin":{"post":{"tags":["Digital Twin"],"summary":"Generate a reusable digital twin avatar","description":"Create a digital twin avatar for reuse in virtual try-ons. Every mode requires faceImage plus exactly one body source: bodyPhotoUrl, silhouetteImage, bodyMeasurements or clothingSize. Height and weight may accompany bodyPhotoUrl; see Photo Mode.\n\nSet `options.background` to `white` (default) or `dark` (medium-dark neutral graphite studio with soft even lighting). Each background creates a separate twin. To keep its background in later outfit try-ons, send `options.preserveBackground: true` to POST /api/v1/virtual-fitting.\n\n## Photo Mode (Recommended for most apps)\n\nUse this when your users upload regular photos from their phone/camera.\n\n**Request:**\n```json\n{\n  \"faceImage\": \"https://example.com/face-selfie.jpg\",\n  \"bodyPhotoUrl\": \"https://example.com/full-body-photo.jpg\"\n}\n```\n\n**What happens:** The API builds the digital twin from the face photo and the full-body photo, in the requested pose (or in the original pose with `options.preservePose: true`).\n\n**Preserve original pose:**\nBy default, a standard pose is applied. To keep the original pose from the photo, set `options.preservePose: true`:\n```json\n{\n  \"faceImage\": \"https://example.com/face.jpg\",\n  \"bodyPhotoUrl\": \"https://example.com/body.jpg\",\n  \"options\": { \"preservePose\": true }\n}\n```\n\n**Photo requirements:**\n- `faceImage`: Clear face photo (selfie works great)\n- `bodyPhotoUrl`: Full-body photo showing head to feet, person standing\n\n**Choose a pose for try-on:**\nSpecify `poseId` to control the avatar pose:\n- `default`: Resolved from deployment configuration and gender\n- `girl_pose`: Female standing pose\n- `man_pose`: Male standing pose\n- `men_relaxed`: Relaxed front standing pose, weight on one leg, arms naturally at sides\n- `women_relaxed`: Relaxed front standing pose, weight on one leg, hands loosely together at the waist\n- `shoe_girl_pose`: Pose with visible feet (for shoe try-ons)\n- `standing_arms_down`: Arms at sides\n- `walking_pose`: Walking pose with a slight turn\n\n**Height and weight:** You may add `bodyMeasurements` containing only `height` and/or `weight`. They can refine the generated body. Any other measurement alongside `bodyPhotoUrl` is a validation error.\n\n**Important:** Each pose creates a **separate cached twin**. If you need the same person in multiple poses, create a twin for each pose. The `digitalTwinId` includes the pose - you cannot change it later.\n\n---\n\n## Direct Mode (Advanced - partner silhouette format)\n\nUse this only if you received the WEARFITS silhouette format specification.\n\n**Request:**\n```json\n{\n  \"faceImage\": \"https://example.com/face.jpg\",\n  \"silhouetteImage\": \"https://example.com/silhouette.png\"\n}\n```\n\nThe `silhouetteImage` must be a pre-rendered silhouette in the WEARFITS silhouette format, NOT a regular photo.\n\n---\n\n## Response\n\nAn uncached request returns a job ID and status URL. Poll the completed job for its `digitalTwinId` (64-character hex string). A twin-cache hit returns the ID immediately.\n\n**Use the ID for subsequent try-ons:**\nSend the saved ID as `digitalTwinId` with garment inputs to either POST /api/v1/virtual-fitting or POST /api/v1/tryon/clothing.\n\n## Measurements and clothing size\n\nInstead of a body photo, pair `faceImage` with `bodyMeasurements` (at least two supported measurements) or `clothingSize` (size and height). These modes can store a body profile for estimated size fitting. Photo and direct-silhouette twins are not eligible for that profile-based feature. Check POST /api/v1/size-fitting for availability and chart requirements.\n\n**Benefits:**\n- Reuses the generated face and body image across try-ons\n- Cached for 30 days\n- No need to re-upload photos for each try-on\n- Skips twin generation on subsequent try-ons; try-on image generation still takes time\n\n## Processing Time\nProcessing time varies with input mode, provider load and cache availability. The response's estimatedProcessingTime is an estimate, not a deadline. Poll the job until a terminal status.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalTwinRequest"}}}},"responses":{"201":{"description":"Job created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalTwinResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `ACCOUNT_CONCURRENCY_LIMIT`: the account already has 5 active jobs across its keys; retry after `Retry-After` seconds or when one finishes. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `SERVICE_BUSY`: the service is temporarily overloaded; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digital-twin/{id}":{"get":{"tags":["Digital Twin"],"summary":"Check if a digital twin ID is valid","description":"Check if a digital twin ID exists and is available for use in try-on or virtual-fitting requests.\n\nUse this endpoint to verify a cached digital twin is still valid before submitting a job.\nDigital twins expire after 30 days from creation.","parameters":[{"schema":{"type":"string","minLength":1,"description":"The digital twin ID to check","example":"c3721f86f03c1d7035f0728cad2ca97d027781dc7e1722cf92901e10f56007c0"},"required":true,"description":"The digital twin ID to check","name":"id","in":"path"}],"responses":{"200":{"description":"Digital twin status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalTwinStatusResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/shoe-3d":{"post":{"tags":["Shoe 3D"],"summary":"Generate 3D models of shoes from photos","description":"Generate 3D models of shoes from one or more 2D photos using AI.\n\n## Overview\n\nThis endpoint converts shoe photographs into 3D GLB models, with optional AI texture enhancement and optional WEARFITS AR upload.\n\n**Automatic model fallback:** if the primary model fails in a **model-scoped** way, the API automatically falls back to the alternate supported model (see `options.models`) and re-submits once. Clients do not need to retry on `job.failed` caused by a single-model outage — the fallback chain has already been exhausted. Per-attempt history is returned in `shoe3dModelResults[].fallbackAttempts`.\n\n**Exception — account-level provider failures:** when the generation provider reports an account-level problem on the WEARFITS side, the remaining fallback attempts are **skipped** and the job fails right away, because further attempts cannot succeed and would only delay the failure. The failure still carries `ALL_FALLBACKS_FAILED`, with fewer entries in `fallbackAttempts` than the full chain and a neutral message — provider account/billing prose is redacted from client payloads, while `error.code` and `error.retryable` are never rewritten.\n\n## Basic Usage\n\n```json\n{\n  \"images\": [\"https://example.com/shoe.jpg\"]\n}\n```\n\n## Image Recommendations\n\n- **Input:** Clear photo of the shoe with good lighting\n- **Angle:** Show front and side of the shoe for best results\n- **Background:** Plain/solid background works best\n- **Resolution:** Minimum 512x512, recommended 1024x1024\n\n## Image Validation & AI Correction (Default: In-Queue)\n\nBy default, image validation and AI correction run **asynchronously in the queue** after the job is created. This allows for faster API response times.\n\n**Photo requirements checked (during queue processing):**\n- Good, constant lighting (no harsh shadows)\n- Clean, neutral background\n- Only ONE shoe visible\n- Shoe fills the entire frame (no cropping)\n- No reflective lights, people, hands, or watermarks\n\n**Left/Right shoe detection:** The validator detects whether the shoe is a left or a right shoe.\n\n**Multiple images:** When providing multiple photos, the best image is automatically selected for 3D generation.\n\n**Validation strictness when `correctImage: true` (default):** Only `NOT_A_SHOE` causes a hard failure. Quality issues (cropped frame, back/sole-only view, poor lighting, etc.) are tolerated — the AI corrector is given the chance to generate a proper packshot from the best available image, and if correction fails the original image is passed directly to 3D generation. Use `correctImage: false` for strict quality gating.\n\n## AI Image Correction (Default: Enabled)\n\nUser-uploaded photos are automatically turned into clean studio packshots before 3D generation. This significantly improves 3D model quality:\n\n- Clean white background\n- Consistent framing\n- Studio-quality lighting\n- Colors, textures and brand details preserved\n\nThe corrected image is then validated and used as input for 3D generation.\n\nTo disable correction and use original images directly:\n```json\n{\n  \"images\": [\"https://example.com/shoe.jpg\"],\n  \"options\": {\n    \"correctImage\": false\n  }\n}\n```\n\n## Synchronous Validation Mode\n\nFor use cases where immediate feedback on validation is needed, set `validateInQueue: false`:\n\n```json\n{\n  \"images\": [\"https://example.com/shoe.jpg\"],\n  \"options\": {\n    \"validateInQueue\": false\n  }\n}\n```\n\nWith `validateInQueue: false`:\n- Validation and correction run synchronously during the API request\n- Returns 400 error immediately if validation fails\n- A provider billing block returns 503 without queueing a job; correction over\n  the per-key minute/day limit is handed to queue processing, which can use\n  the original photo and report a `CORRECTION_SKIPPED_*` warning\n- Slower response time due to synchronous processing\n\nWith `validateInQueue: true` (default):\n- The request returns immediately with job ID (no pre-validation)\n- Validation runs asynchronously in the queue\n- Hard failure (`SHOE_IMAGE_VALIDATION_FAILED`) only when no image is a shoe (`NOT_A_SHOE`); quality issues (cropped, poor angle, etc.) are tolerated when `correctImage: true`\n\n## Custom GLB Bypassing (Memory-Safe Uploads)\n\nIf you already possess a custom 3D model, `glbInput` skips AI geometry generation. Very dense models may be simplified before processing (best effort; not an enforced limit). Texture enhancement and WEARFITS publication follow their respective options; texture enhancement can still invoke AI.\n\nLarge GLB models (30MB+) should not be sent as Base64 JSON; use the dedicated streaming upload endpoint.\n\n**Step 1: Upload the GLB Model**\n```bash\ncurl -X POST 'https://api.wearfits.com/api/v1/files/upload' \\\n  -H 'X-API-Key: your_api_key' \\\n  -F \"file=@my_model.glb\"\n```\n*(Returns a temporary `url`)*\n\n**Step 2: Run the Pipeline** (pass the `url` returned in step 1 as `glbInput`)\n```json\n{\n  \"images\": [\"https://example.com/shoe.jpg\"],\n  \"glbInput\": \"https://example.com/uploaded-model.glb\",\n  \"options\": {\n    \"enhanceTexture\": true,\n    \"uploadToWearFits\": true\n  }\n}\n```\n\n## WEARFITS AR Integration\n\nEnable `uploadToWearFits` to automatically upload the result to WEARFITS for AR try-on:\n\n```json\n{\n  \"images\": [\"https://example.com/shoe.jpg\"],\n  \"options\": {\n    \"uploadToWearFits\": true,\n    \"sessionId\": \"user-session-id\"\n  }\n}\n```\n\n## Who the uploaded model belongs to\n\nWith `uploadToWearFits: true` the generated model is filed in a WEARFITS library. Two mechanisms decide whose, and **they are mutually exclusive** — WEARFITS rejects an upload that claims two owners:\n\n1. **The account behind your credential (automatic).** Any credential that resolves to a WEARFITS account — a dashboard API key, or a service key carrying a verified account token — files the model in that account's library. Nothing to send: it is resolved when the job is submitted. This is not limited to one kind of token; if the request authenticated as an account, that account owns the model.\n2. **`options.sessionId` (explicit).** A frontend app that already holds a WEARFITS user session can name it, and the model is linked to that session instead.\n\n**`sessionId` wins.** When you send one, it is the only ownership claim sent and the account behind the credential is not used — naming a session is an explicit choice and this API does not override it.\n\nSend neither and the model is filed under the account that owns this deployment's WEARFITS token, which is a shared library, not yours.\n\n## Real size of bags and other products\n\nFor `productType: \"other\"` (or `\"auto\"` resolving to a non-shoe), send `options.longestSideCm` (the real length of the product's longest horizontal side (width or depth, never the height) in centimetres, 5-150, 0.1 cm precision) and the AR try-on shows the product at that size. Out-of-range values are rejected with 400 before a job is created. Omitted: the try-on keeps the model's own scale when it is plausible for a bag (between 10 and 100 cm across) and shows it at 40 cm otherwise. Ignored for shoes. To change or clear the size of a model already published, call `POST /api/v1/wearfits/models/{modelId}/size`.\n\n## Processing Time\n\nTime varies with provider queues, cache availability, image processing, texture enhancement and optional publication. Poll the job until a terminal status; estimatedProcessingTime is not a deadline.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shoe3DRequest"}}}},"responses":{"201":{"description":"Job created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Shoe3DResponse"}}}},"400":{"description":"Invalid request or shoe image validation failed","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Shoe3DValidationError"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `ACCOUNT_CONCURRENCY_LIMIT`: the account already has 5 active jobs across its keys; retry after `Retry-After` seconds or when one finishes. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `SERVICE_BUSY`: the service is temporarily overloaded; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Provider account is blocked for billing; no job was submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/virtual-fitting":{"post":{"tags":["Virtual Fitting"],"summary":"Twin-backed virtual fitting","description":"Creates or reuses a digital twin and applies garments in one request. For raw-photo try-on without generating a twin, use POST /api/v1/tryon/clothing instead.\n\n## Quick Start\n\n```json\n{\n  \"faceImage\": \"https://example.com/face.jpg\",\n  \"silhouetteImage\": \"https://example.com/silhouette.png\",\n  \"topGarment\": \"https://example.com/shirt.jpg\",\n  \"bottomGarment\": \"https://example.com/pants.jpg\"\n}\n```\n\n## Response\n\nA queued submission returns a job ID and status URL. Poll the completed job for its `digitalTwinId` and results, then save the twin ID for future try-ons. A result-cache hit can return completed results and `digitalTwinId` immediately.\n\n## Reusing the Digital Twin\n\nFor subsequent try-ons, pass only the `digitalTwinId` (faster, skips twin generation):\n```json\n{\n  \"digitalTwinId\": \"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\n  \"topGarment\": \"https://example.com/different-shirt.jpg\"\n}\n```\n\n---\n\n## Input Modes\n\n**Mode 1: Direct (pre-rendered silhouette)**\nProvide `faceImage` + `silhouetteImage` directly.\n\n**Mode 2: Photo**\nProvide `faceImage` + `photoUrl`; `poseId` is optional. Both images are required to generate a new photo-mode twin. A photoUrl-only request can pass request validation but fail asynchronously with MISSING_INPUTS.\n- Requires full-body photo showing head to feet\n\n**Mode 3: Twin ID (Fastest)**\nProvide only `digitalTwinId` from a previous request - skips twin generation entirely.\n\n**Mode 4: Measurements**\nProvide `faceImage` + `bodyMeasurements` - creates the twin from the supplied measurements.\n\n**Mode 5: Clothing size**\nProvide `faceImage` + `clothingSize` (size and height).\n\n---\n\n## Available Poses (photo, measurements and clothing-size modes)\n\n- `default`: System default pose\n- `girl_pose`: Female standing pose\n- `man_pose`: Male standing pose\n- `men_relaxed`: Relaxed front standing pose, weight on one leg, arms naturally at sides\n- `women_relaxed`: Relaxed front standing pose, weight on one leg, hands loosely together at the waist\n- `shoe_girl_pose`: Visible feet (for shoe try-ons)\n- `standing_arms_down`: Arms at sides\n- `walking_pose`: Walking pose with a slight turn\n\n---\n\n## Caching\n\n- **Digital twins:** Cached 30 days. Same face + silhouette = same `digitalTwinId`\n- **Results:** Cached 7 days. Matching cache inputs can reuse a completed result without new image generation.\n- Use `options.skipCache: true` to bypass the twin cache and `options.skipResultCache: true` to bypass the final try-on cache.\n- `options.background`: `white` (default) or `dark` (medium-dark neutral graphite studio with soft even lighting) for a newly generated twin; ignored with an existing `digitalTwinId`. Background variants have separate twin IDs.\n- Set `options.preserveBackground: true` to keep the twin background in outfit try-ons. Omitted or false retains the default white studio outfit background. Single-product try-ons preserve the person background.\n- Optional `backgroundImage` (URL or base64): scene photo used as the try-on background; portrait 9:16 works best. Only the scene is used (people/products in it are not copied). Works with every person mode, garment slots and `productImage`; when set, `options.preserveBackground` is ignored.\n\n## Garment Formats\n\n- Single URL: `\"https://example.com/garment.jpg\"`\n- With reference: `[\"packshot.jpg\", \"on-model.jpg\"]` - helps AI understand fit\n- Single product shortcut: `productImage` plus optional `productCategory` (`auto`, `top`, `bottom`, `full-body`, `shoe`). When exactly one product image is provided, the try-on uses the person/digital twin and that product image.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualFittingRequest"}}}},"responses":{"201":{"description":"Job created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VirtualFittingResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `ACCOUNT_CONCURRENCY_LIMIT`: the account already has 5 active jobs across its keys; retry after `Retry-After` seconds or when one finishes. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `SERVICE_BUSY`: the service is temporarily overloaded; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/storefront/tokens":{"post":{"tags":["Storefront"],"summary":"Mint a storefront or account-attribution token","description":"Issue a short-lived HMAC token that maps a merchant to their SaaS account without putting an exhaustible dashboard API key in a shopper's browser.\n\n**Browser widget:** mint `audience: \"storefront\"` server-side and put the `wfs1.` token in `data-storefront-token` / `X-API-Key`. The token can only `POST /api/v1/virtual-fitting` and `GET /api/v1/jobs/{id}`. Reminting for the same account still polls in-flight jobs.\n\n**Hosted fitting room / service-key proxy:** mint `audience: \"account\"` and send it as `X-Wearfits-Account` next to the deployment service key. AI quota is counted; the key-usage counter is not (there is no raw merchant key).\n\n**Auth (one of):**\n- A database-backed merchant key (`X-API-Key`) — mints for that account.\n- A service key plus a valid `X-Wearfits-Account` token — remints for that account.\n- Handshake bootstrap: body `handshake` + `userId` (the integration handshake issued by WEARFITS). No CORS-open widget path; this is for dash / server callers.\n- `audience: \"usage\"` (`wfu1.`, analytics-only `X-Wearfits-Usage-Account`): ONLY handshake + `userId` with the separate usage-token handshake; the integration handshake cannot mint it and it cannot mint anything else. Not configured = 401.\n\nReturns 503 when the handshake secret is unset on this deployment.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorefrontTokenRequest"}}}},"responses":{"200":{"description":"Token minted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorefrontTokenResponse"}}}},"400":{"description":"Missing account identity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid handshake","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Credential cannot mint this token audience","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Handshake secret unset on this deployment. Carries error code `HANDSHAKE_NOT_CONFIGURED` — a permanent misconfiguration, not a transient outage; do not retry it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/size-fitting":{"post":{"tags":["Size Fitting"],"summary":"Estimate clothing size from a digital twin body profile","description":"Synchronously compare the private body profile of a measurements/clothing-size digital twin with body-range size charts.\n\nThis is an estimated, non-billable calculation. It supports new or backfilled twins created from `bodyMeasurements` or `clothingSize`; photo/direct twins return `available: false`. Size charts must use body measurement ranges, not garment dimensions. Products with no dimension available in both the profile and every size row are omitted; the response is unavailable only when none can be compared. The response contains fit statuses, bounded scores, and recommendations.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SizeFittingRequest"}}}},"responses":{"200":{"description":"Size fitting result (including unavailable profiles)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SizeFittingResponse"}}}},"400":{"description":"Invalid size chart or request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digitization/batches":{"post":{"tags":["Digitization"],"summary":"Create a digitization batch","description":"\nSubmit up to 500 products for 3D model generation, with 1-10 image URLs per product. For bags and other products, set options.productType to other or auto.\nEach product can have multiple images - the best one will be selected automatically.\nEach product gets the same processing as a single shoe-3d request (validation, optional AI correction, optional WEARFITS upload).\n\n**Key Features:**\n- Each product gets an external ID (productId) for easy tracking\n- Multiple images per product - best one selected automatically\n- AI image correction is ON by default for batches (set options.correctImage: false to disable it); it is limited per API key per minute and per day, and an item over either limit is generated from the original photo with a CORRECTION_SKIPPED_RATE_LIMIT or CORRECTION_SKIPPED_DAILY_LIMIT warning\n- Same quality as single shoe-3d requests\n- Batch options support productType, pipelineVariant, genaiQuality, correctImage, enhanceTexture, refineLogo, smoothNormals, skipCache and uploadToWearFits. Select one provider using options.model (singular); per-request shoe-3d fields such as glbInput and validateInQueue are not batch inputs.\n- Per product, optional `longestSideCm` (bags/other: real length of the longest horizontal side (width or depth, never the height) in cm, 5-150, 0.1 cm precision) is published with the AR model so the try-on shows it at real size; omitted, the try-on keeps the model's own scale when it is plausible for a bag (between 10 and 100 cm across) and shows it at 40 cm otherwise. Out of range: 400 for the whole batch. Ignored for shoes. Change it later with POST /api/v1/wearfits/models/{modelId}/size.\n\n**Processing:**\n- Items are processed concurrently in two stages (3D generation, then optional texture enhancement and WEARFITS upload)\n- Per-item processing time varies with load, cache availability and selected processing options\n- Very large batches take correspondingly longer to complete\n\n**Webhook (batch.completed):**\n- Fires once when the last item reaches a terminal state (completed/failed)\n- Receivers must dedupe on `batchId`; near-simultaneous duplicate deliveries are possible\n- HMAC-SHA256 signature using the per-client `apiKeyHash`\n\n**Batch Limits:**\n- Maximum 500 products per batch\n- Maximum 10 images per product\n- Batches expire after 7 days\n\n**Safe retries:** send an optional `Idempotency-Key` (1–255 visible ASCII characters).\nFor seven days, the same authenticated ownership context, key and request return the original accepted batch without submitting its products again, including when skipCache is true.\nA changed request under the same key returns 409 (IDEMPOTENCY_KEY_CONFLICT).\nA concurrent or unconfirmed submission returns 503 with Retry-After: retry with the SAME key, never a new one.\nWithout this header, each successful POST creates a new batch.\n\t","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7e]+$","description":"Stable retry identifier. Reuse for the same request; use a new value for a new submission.","example":"batch-3b241101-e2bb-4255-8caf-4136c566a962"},"required":false,"description":"Stable retry identifier. Reuse for the same request; use a new value for a new submission.","name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"External product ID for tracking (returned in response)","example":"sku-123"},"images":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10,"description":"Array of image URLs for this product (best selected automatically)","example":["https://example.com/shoe1-front.jpg","https://example.com/shoe1-side.jpg"]},"longestSideCm":{"type":"number","minimum":5,"maximum":150,"description":"Real length of the product's longest horizontal side (width or depth, never the height) in centimetres (5-150, stored with 0.1 cm precision). The AR try-on displays the product at this size. Applies to productType \"other\"; ignored for shoes.","example":32.5}},"required":["images"]},"minItems":1,"maxItems":500,"description":"Array of products to digitize into 3D models"},"options":{"type":"object","properties":{"uploadToWearFits":{"type":"boolean","default":true,"description":"Upload generated 3D models to WEARFITS for AR try-on"},"model":{"type":"string","description":"3D generation model to use (defaults to shoe-3d default model)"},"correctImage":{"type":"boolean","default":true,"description":"Apply AI image correction before 3D generation. Defaults to true; send false to disable it."},"enhanceTexture":{"type":"boolean","default":true,"description":"Run AI texture enhancement after 3D generation (quality set by genaiQuality)."},"refineLogo":{"type":"boolean","default":false,"description":"Run a second AI pass focused on fixing logos/branding"},"smoothNormals":{"type":"boolean","default":true,"description":"Apply automatic smooth normals before WEARFITS upload. Disable when GLB is intended for Blender editing."},"pipelineVariant":{"type":"string","enum":["A","B"],"default":"A","description":"Pipeline variant. A = standard (default). B = experimental high-detail variant (beta)."},"genaiQuality":{"type":"string","enum":["default","high"],"default":"high","description":"AI quality preset: \"default\" (faster) or \"high\" (higher quality, slower)."},"productType":{"type":"string","enum":["shoe","other","auto"],"default":"shoe","description":"Product type. \"shoe\" / \"other\" force the type, \"auto\" detects it from the images (matches /api/v1/shoe-3d)."},"skipCache":{"type":"boolean","default":false,"description":"Bypass shoe-3d idempotency cache and force regeneration."}}},"webhookUrl":{"type":"string","format":"uri","description":"URL to call when batch completes (all items processed)","example":"https://your-app.com/webhooks/wearfits"}},"required":["products"]}}}},"responses":{"202":{"description":"Batch created and queued for processing","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"batch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","failed","paused"]},"progress":{"type":"object","properties":{"total":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"}},"required":["total","completed","failed","pending"]},"createdAt":{"type":"string","format":"date-time"},"statusUrl":{"type":"string","description":"URL to check batch status","example":"/api/v1/digitization/batches/{batchId}"}},"required":["id","status","progress","createdAt","statusUrl"]}},"required":["success","batch"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Idempotency-Key was reused with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Submission refused; `error.code` says why. `DAILY_QUOTA_EXCEEDED`: daily per-account / per-API-key quota exhausted. `Retry-After` gives the seconds until 00:00 UTC; `X-Quota-Limit` / `X-Quota-Remaining` describe the bucket. `*_LIMIT_EXCEEDED` (e.g. `AI_MONTHLY_LIMIT_EXCEEDED`, `THREE_D_MONTHLY_LIMIT_EXCEEDED`): monthly plan allowance exhausted. `KEY_RATE_LIMIT_EXCEEDED`: more than 20 submissions in 5 minutes or 60 in an hour for this API key. A submission refused by a limit does not count; one that fails for another reason may. `Retry-After` gives the seconds until a submission is possible. `ACCOUNT_CONCURRENCY_LIMIT`: another digitization batch submission is currently in progress for this account; retry after `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Submission is in progress, unconfirmed, or temporarily unavailable; retry with the same key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digitization/batches/{batchId}":{"get":{"tags":["Digitization"],"summary":"Get batch status","description":"Retrieve the current status and progress of a digitization batch.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Batch ID"},"required":true,"description":"Batch ID","name":"batchId","in":"path"}],"responses":{"200":{"description":"Batch details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"batch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","failed","paused"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"productId":{"type":"string","description":"External product ID provided by the client for tracking"},"images":{"type":"array","items":{"type":"string","format":"uri"},"description":"Array of image URLs for this product (best selected automatically)"},"longestSideCm":{"type":"number","minimum":5,"maximum":150,"description":"Real length of the product's longest horizontal side (width or depth, never the height) in centimetres (5-150, stored with 0.1 cm precision). The AR try-on displays the product at this size. Applies to productType \"other\"; ignored for shoes.","example":32.5},"status":{"type":"string","enum":["pending","queued","processing","completed","failed"]},"jobId":{"type":"string","format":"uuid","description":"Links to the shoe-3d job processing this item"},"glbUrl":{"type":"string"},"viewerUrl":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"startedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"}},"required":["id","images","status"]}},"options":{"type":"object","properties":{"uploadToWearFits":{"type":"boolean","default":true,"description":"Upload generated 3D models to WEARFITS for AR try-on"},"model":{"type":"string","description":"3D generation model to use (defaults to shoe-3d default model)"},"correctImage":{"type":"boolean","default":true,"description":"Apply AI image correction before 3D generation. Defaults to true; send false to disable it."},"enhanceTexture":{"type":"boolean","default":true,"description":"Run AI texture enhancement after 3D generation (quality set by genaiQuality)."},"refineLogo":{"type":"boolean","default":false,"description":"Run a second AI pass focused on fixing logos/branding"},"smoothNormals":{"type":"boolean","default":true,"description":"Apply automatic smooth normals before WEARFITS upload. Disable when GLB is intended for Blender editing."},"pipelineVariant":{"type":"string","enum":["A","B"],"default":"A","description":"Pipeline variant. A = standard (default). B = experimental high-detail variant (beta)."},"genaiQuality":{"type":"string","enum":["default","high"],"default":"high","description":"AI quality preset: \"default\" (faster) or \"high\" (higher quality, slower)."},"productType":{"type":"string","enum":["shoe","other","auto"],"default":"shoe","description":"Product type. \"shoe\" / \"other\" force the type, \"auto\" detects it from the images (matches /api/v1/shoe-3d)."},"skipCache":{"type":"boolean","default":false,"description":"Bypass shoe-3d idempotency cache and force regeneration."}}},"progress":{"type":"object","properties":{"total":{"type":"number"},"completed":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"}},"required":["total","completed","failed","pending"]},"webhookUrl":{"type":"string","format":"uri","description":"URL to call when batch completes (all items processed)","example":"https://your-app.com/webhooks/wearfits"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"apiKeyHash":{"type":"string"}},"required":["id","status","items","options","progress","createdAt","updatedAt"]}},"required":["success","batch"]}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digitization/batches/{batchId}/pause":{"post":{"tags":["Digitization"],"summary":"Pause a batch","description":"Pause processing of a batch. Items already in progress will complete.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Batch ID"},"required":true,"description":"Batch ID","name":"batchId","in":"path"}],"responses":{"200":{"description":"Batch paused","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"status":{"type":"string","enum":["pending","processing","completed","failed","paused"]}},"required":["success","status"]}}}},"400":{"description":"Cannot pause batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/digitization/batches/{batchId}/resume":{"post":{"tags":["Digitization"],"summary":"Resume a paused batch","description":"Resume processing of a paused batch.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Batch ID"},"required":true,"description":"Batch ID","name":"batchId","in":"path"}],"responses":{"200":{"description":"Batch resumed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"status":{"type":"string","enum":["pending","processing","completed","failed","paused"]}},"required":["success","status"]}}}},"400":{"description":"Cannot resume batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/jobs/{jobId}":{"get":{"tags":["Jobs"],"summary":"Get job status","description":"Retrieve the current status and results of a try-on job. Virtual-fitting and digital-twin progress is indeterminate until completed (100%). Use the submitting ownership context: API-key jobs require that same individual key, including during key rotation. Account-token and storefront-token jobs instead belong to the account within their respective authentication mode; a renewed token for the same account and mode retains access, subject to its route permissions. A different ownership context returns 404, identical to a missing job.","parameters":[{"schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Job status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"404":{"description":"Job not found, or not owned by the authenticated ownership context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Jobs"],"summary":"Cancel job","description":"Cancel a pending job. Only jobs in queued or validating status can be cancelled. API-key jobs require the submitting key. Token-owned jobs require the same account and authentication mode, and a credential permitted to cancel jobs. A different ownership context returns 404, identical to a missing job.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Job cancelled successfully","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SuccessResponse"},{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}]}}}},"400":{"description":"Job cannot be cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Job not found, or not owned by the authenticated ownership context","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/wearfits/models/{modelId}/size":{"post":{"tags":["Digitization"],"summary":"Set the real size of a published bag model","description":"\nSet or remove the real size of a bag (or other non-shoe product) model already published to WEARFITS AR try-on (the `wearfitsTryOn.modelId` of a completed shoe-3d job or digitization batch item). The AR try-on shows the product at this size.\n\nSend `{ \"longestSideCm\": 32.5 }` to set it (5-150 cm, 0.1 cm precision) or `{ \"longestSideCm\": null }` to remove it (then the try-on keeps the model's own scale when it is plausible for a bag (between 10 and 100 cm across) and shows it at 40 cm otherwise). The call is idempotent: repeating it with the same value is safe.\n\nThe request acts as the account behind your credential and can change only models that account owns. Models published with a bare deployment key belong to that deployment's shared account.\n\n**Errors** (`error.code`):\n- 400 `VALIDATION_ERROR`: body missing, malformed, or size out of range\n- 400 `INVALID_MODEL_ID`: malformed model id\n- 400 `UNSUPPORTED_OBJECT_TYPE`: the model is a shoe (shoes have no real-size setting)\n- 400 `INVALID_USER_ID`: the account behind the credential is not known to WEARFITS\n- 403 `FORBIDDEN`: the model belongs to another account\n- 403 `MODEL_PROTECTED`: the model is protected and cannot be changed\n- 404 `MODEL_NOT_FOUND`: no such model\n- 502 `WEARFITS_UPSTREAM_ERROR`: unexpected answer from WEARFITS; not retryable as-is\n- 503 `WEARFITS_UNAVAILABLE`: temporarily unavailable; retry later (`Retry-After`)\n- 503 `WEARFITS_NOT_CONFIGURED`: this deployment has no WEARFITS publication\n\t","parameters":[{"schema":{"type":"string","description":"WEARFITS model id (`wearfitsTryOn.modelId`)","example":"abc123"},"required":true,"description":"WEARFITS model id (`wearfitsTryOn.modelId`)","name":"modelId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetModelSizeRequest"}}}},"responses":{"200":{"description":"Size stored (or removed)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetModelSizeResponse"}}}},"400":{"description":"Invalid request, or the model is not a bag/other object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The model belongs to another account, is protected, or the credential cannot use this endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Unexpected WEARFITS answer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"WEARFITS temporarily unavailable (retryable) or not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}