{"openapi":"3.1.0","info":{"title":"FITLD API","version":"v1","summary":"The right size for every shopper, on every product.","description":"Sizing, product lookup and webhooks for apps and headless stores. Everything under `/v1` keeps its shape; breaking changes would come as `/v2`. Responses carry `X-Request-Id`; errors are `{ error, code, requestId }`.\n\n**Test mode:** use your test widget ID (`wgt_test_…`) or test key (`fit_sk_test_…`) to get real sizes with nothing recorded or billed, up to 1000 requests a day. Test responses carry `\"livemode\": false`.","contact":{"name":"FITLD","email":"contact@fitld.com","url":"https://fitld.com/docs"},"termsOfService":"https://fitld.com/terms"},"servers":[{"url":"https://api.fitld.com/v1"}],"tags":[{"name":"Sizing","description":"Get the right size for a shopper and a product."},{"name":"Products","description":"Find which FITLD product a store page shows."},{"name":"Reference","description":"This document."}],"security":[{}],"paths":{"/widget/recommend":{"post":{"operationId":"widgetRecommend","tags":["Sizing"],"summary":"Recommend a size (storefront)","description":"What the FITLD widget calls. Authenticated by the public **widget ID** in the body, so it can be called from any store page. Send `measurements`, or a signed-in shopper's `userId` + `userToken` (and optionally `dependentId` for a family member). Counts as one recommendation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["widgetId","productId"],"properties":{"widgetId":{"type":"string","description":"Your widget ID (`wgt_…`), or the test one (`wgt_test_…`)."},"productId":{"type":"string","maxLength":120},"measurements":{"$ref":"#/components/schemas/Measurements"},"userId":{"type":"string","description":"Signed-in shopper (from the widget's FITLD sign-in)."},"userToken":{"type":"string"},"dependentId":{"type":"string","description":"A family member on the shopper's profile."},"sessionId":{"type":"string","maxLength":64,"description":"The shopper's browsing session; links the size to the order later."}}},"example":{"widgetId":"wgt_YOUR_WIDGET_ID","productId":"OXFORD-SHIRT","measurements":{"unit":"cm","height":178,"chest":98,"waist":84},"sessionId":"s_2f9c1a"}}}},"responses":{"200":{"description":"The size.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recommendation"},"example":{"recommended_size":"M","out_of_range":null,"confidence":0.91,"fit_quality":"great","measurement_gap_cm":1.2,"category":"Tops","tolerance":4,"explain":{"between_sizes":null,"alternatives":[{"size":"L","score":6.4},{"size":"S","score":7.9}],"comparisons":[{"field":"chest","you":98,"size":100,"unit":"cm"},{"field":"waist","you":84,"size":86,"unit":"cm"}],"why":["Closest overall match (avg gap 1.2 cm)","For Tops","Age group: Adult"]},"size_system":null,"equivalents":null,"chart":"product","guest":true}}}},"400":{"description":"Missing widget ID, product ID or measurements. Codes: `invalid_request`, `product_id_required`, `invalid_measurement`, `invalid_json`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The shopper's sign-in expired. Codes: `authentication_required`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown widget, product or family member. Codes: `not_found`, `product_not_found`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"FITLD can't size this request. Codes: `measurements_missing`, `category_not_supported`, `chart_not_usable`, `size_not_determined`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Your measurements are missing: chest. Please add the missing measurement.","code":"measurements_missing","missing":["chest"],"requestId":"req_8fK2xQm1Lw0aZt7c"}}}},"429":{"description":"Too many requests, the plan's ceiling, or the test-mode daily allowance. Wait for `Retry-After`. Codes: `rate_limited`, `quota_exceeded`, `test_mode_limit`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/resolve":{"post":{"operationId":"resolveProduct","tags":["Products"],"summary":"Find the product on a page","description":"Matches a product page to a FITLD product by product ID, SKU, external ID, store handle or URL. Authenticated by the widget ID in the body, or a secret key in `x-api-key`. Doesn't count as a recommendation.","security":[{},{"secretKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"widgetId":{"type":"string","description":"Required unless you send `x-api-key`."},"productId":{"type":"string"},"externalProductId":{"type":"string"},"sku":{"type":"string"},"canonicalUrl":{"type":"string"},"ogUrl":{"type":"string"},"pageUrl":{"type":"string"},"title":{"type":"string"}}},"example":{"widgetId":"wgt_YOUR_WIDGET_ID","canonicalUrl":"https://shop.example.com/products/classic-oxford"}}}},"responses":{"200":{"description":"The product.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvedProduct"},"example":{"productId":"OXFORD-SHIRT","productName":"Classic Oxford","category":"Tops","ageGroup":"Adult","audience":"Men"}}}},"400":{"description":"No product ID or URL to go on. Codes: `invalid_request`, `invalid_json`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No widget ID or API key, or an unknown one. Codes: `authentication_required`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A secret key sent from a browser, or a test key on a non-public endpoint. Codes: `api_key_browser_origin`, `test_key_not_allowed`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The page isn't connected to a FITLD size chart yet. Codes: `product_not_connected`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests, the plan's ceiling, or the test-mode daily allowance. Wait for `Retry-After`. Codes: `rate_limited`, `quota_exceeded`, `test_mode_limit`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recommend-size/guest":{"post":{"operationId":"recommendSize","tags":["Sizing"],"summary":"Recommend a size (server)","description":"Server to server, with your secret key. Send the shopper's measurements. Counts as one recommendation.","security":[{"secretKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productId","measurements"],"properties":{"productId":{"type":"string","maxLength":120},"measurements":{"$ref":"#/components/schemas/Measurements"}}},"example":{"productId":"OXFORD-SHIRT","measurements":{"unit":"cm","chest":98,"waist":84}}}}},"responses":{"200":{"description":"The size.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recommendation"},"example":{"recommended_size":"M","out_of_range":null,"confidence":0.91,"fit_quality":"great","measurement_gap_cm":1.2,"category":"Tops","tolerance":4,"explain":{"between_sizes":null,"alternatives":[{"size":"L","score":6.4},{"size":"S","score":7.9}],"comparisons":[{"field":"chest","you":98,"size":100,"unit":"cm"},{"field":"waist","you":84,"size":86,"unit":"cm"}],"why":["Closest overall match (avg gap 1.2 cm)","For Tops","Age group: Adult"]},"size_system":null,"equivalents":null,"chart":"product","guest":true}}}},"400":{"description":"Something in the request is missing or malformed. Codes: `product_id_required`, `invalid_measurement`, `invalid_json`, `invalid_request`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or an invalid one. Codes: `authentication_required`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A secret key sent from a browser, or a test key on a non-public endpoint. Codes: `api_key_browser_origin`, `test_key_not_allowed`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such product (or widget) for this brand. Codes: `product_not_found`, `not_found`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"FITLD can't size this request. Codes: `measurements_missing`, `category_not_supported`, `chart_not_usable`, `size_not_determined`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Your measurements are missing: chest. Please add the missing measurement.","code":"measurements_missing","missing":["chest"],"requestId":"req_8fK2xQm1Lw0aZt7c"}}}},"429":{"description":"Too many requests, the plan's ceiling, or the test-mode daily allowance. Wait for `Retry-After`. Codes: `rate_limited`, `quota_exceeded`, `test_mode_limit`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/recommend-size":{"post":{"operationId":"recommendSizeForShopper","tags":["Sizing"],"summary":"Recommend a size for a signed-in shopper","description":"Server to server, with your secret key plus the shopper's FITLD sign-in token, for apps where the shopper signed in with FITLD. FITLD uses the measurements saved on their profile (or a family member's, with `dependentId`); your server never sees them.","security":[{"secretKey":[],"shopperToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productId"],"properties":{"productId":{"type":"string","maxLength":120},"dependentId":{"type":"string"}}},"example":{"productId":"OXFORD-SHIRT"}}}},"responses":{"200":{"description":"The size.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recommendation"},"example":{"recommended_size":"M","out_of_range":null,"confidence":0.91,"fit_quality":"great","measurement_gap_cm":1.2,"category":"Tops","tolerance":4,"explain":{"between_sizes":null,"alternatives":[{"size":"L","score":6.4},{"size":"S","score":7.9}],"comparisons":[{"field":"chest","you":98,"size":100,"unit":"cm"},{"field":"waist","you":84,"size":86,"unit":"cm"}],"why":["Closest overall match (avg gap 1.2 cm)","For Tops","Age group: Adult"]},"size_system":null,"equivalents":null,"chart":"product"}}}},"400":{"description":"Something in the request is missing or malformed. Codes: `product_id_required`, `invalid_measurement`, `invalid_json`, `invalid_request`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key or shopper token, or an expired one. Codes: `authentication_required`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"A secret key sent from a browser, or a test key on a non-public endpoint. Codes: `api_key_browser_origin`, `test_key_not_allowed`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown product, shopper or family member. Codes: `product_not_found`, `not_found`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"FITLD can't size this request. Codes: `measurements_missing`, `category_not_supported`, `chart_not_usable`, `size_not_determined`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"Your measurements are missing: chest. Please add the missing measurement.","code":"measurements_missing","missing":["chest"],"requestId":"req_8fK2xQm1Lw0aZt7c"}}}},"429":{"description":"Too many requests, the plan's ceiling, or the test-mode daily allowance. Wait for `Retry-After`. Codes: `rate_limited`, `quota_exceeded`, `test_mode_limit`.","headers":{"X-Request-Id":{"description":"This request's id (req_…).","schema":{"type":"string"}},"FITLD-Mode":{"description":"`live` or `test`.","schema":{"type":"string","enum":["live","test"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"openapi","tags":["Reference"],"summary":"This document","description":"The OpenAPI 3.1 description of the FITLD API. Import it into Postman, Insomnia or a client generator.","security":[{}],"responses":{"200":{"description":"OpenAPI document.","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"webhooks":{"order.attributed":{"post":{"operationId":"webhook_order_attributed","summary":"An order includes items bought after using FITLD.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"order.attributed"},"data":{"type":"object","required":["order_id","lines"],"properties":{"order_id":{"type":"string"},"order_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"paid_at":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/WebhookLine"}}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}},"refund.created":{"post":{"operationId":"webhook_refund_created","summary":"Items bought after using FITLD were refunded.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"refund.created"},"data":{"type":"object","required":["order_id","refund_id","lines"],"properties":{"order_id":{"type":"string"},"refund_id":{"type":"string"},"refunded_at":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/WebhookLine"},{"type":"object","properties":{"refunded_cents":{"type":"integer"}}}]}}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}},"return.recorded":{"post":{"operationId":"webhook_return_recorded","summary":"A return of an item bought after using FITLD, with its reason.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"return.recorded"},"data":{"type":"object","required":["order_id","lines"],"properties":{"order_id":{"type":"string"},"lines":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/WebhookLine"},{"type":"object","properties":{"reason":{"type":"string"}}}]}}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}},"fit_feedback.received":{"post":{"operationId":"webhook_fit_feedback_received","summary":"A shopper said how an item fit.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"fit_feedback.received"},"data":{"type":"object","properties":{"order_id":{"type":"string"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"anyOf":[{"type":"string"},{"type":"null"}]},"recommended_size":{"anyOf":[{"type":"string"},{"type":"null"}]},"followed_recommendation":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"answer":{"type":"string","enum":["too_small","right","too_large"]}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}},"product.unmatched":{"post":{"operationId":"webhook_product_unmatched","summary":"A product page without a FITLD size chart was seen for the first time.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"product.unmatched"},"data":{"type":"object","properties":{"url":{"type":"string"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"handle":{"anyOf":[{"type":"string"},{"type":"null"}]},"first_seen_at":{"type":"string","format":"date-time"}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}},"usage.threshold_reached":{"post":{"operationId":"webhook_usage_threshold_reached","summary":"Recommendations this month reached 80% or 100% of your plan.","description":"Signed with `FITLD-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`. Answer 2xx within 10 seconds.","requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEvent"},{"type":"object","properties":{"type":{"const":"usage.threshold_reached"},"data":{"type":"object","properties":{"month":{"type":"string"},"threshold":{"type":"number"},"used":{"type":"integer"},"limit":{"type":"integer"},"plan":{"type":"string"},"hard_limit":{"type":"integer"}}}}}]}}}},"responses":{"200":{"description":"Any 2xx tells FITLD the event arrived."}}}}},"components":{"schemas":{"Measurements":{"type":"object","description":"A shopper's body measurements. Send what you have: FITLD asks only for what this product's chart needs, and answers `422 measurements_missing` with the list when something essential is missing.","properties":{"unit":{"type":"string","enum":["cm","in"],"default":"cm","description":"Unit of every length (and of weight: `cm` → kg, `in` → lb)."},"height":{"type":"number","minimum":0,"description":"Height, in the chosen unit."},"chest":{"type":"number","minimum":0,"description":"Chest / bust, in the chosen unit."},"waist":{"type":"number","minimum":0,"description":"Waist, in the chosen unit."},"hips":{"type":"number","minimum":0,"description":"Hips, in the chosen unit."},"shoulder":{"type":"number","minimum":0,"description":"Shoulder width, in the chosen unit."},"sleeve":{"type":"number","minimum":0,"description":"Sleeve length, in the chosen unit."},"bicep":{"type":"number","minimum":0,"description":"Bicep, in the chosen unit."},"wrist":{"type":"number","minimum":0,"description":"Wrist, in the chosen unit."},"inseam":{"type":"number","minimum":0,"description":"Inseam, in the chosen unit."},"outseam":{"type":"number","minimum":0,"description":"Outseam, in the chosen unit."},"thigh":{"type":"number","minimum":0,"description":"Thigh, in the chosen unit."},"ankle":{"type":"number","minimum":0,"description":"Ankle, in the chosen unit."},"footLength":{"type":"number","minimum":0,"description":"Foot length, in the chosen unit."},"footWidth":{"type":"number","minimum":0,"description":"Foot width, in the chosen unit."},"handLength":{"type":"number","minimum":0,"description":"Hand length, in the chosen unit."},"palmWidth":{"type":"number","minimum":0,"description":"Palm width, in the chosen unit."},"neck":{"type":"number","minimum":0,"description":"Neck, in the chosen unit."},"head":{"type":"number","minimum":0,"description":"Head, in the chosen unit."},"weight":{"type":"number","minimum":0,"description":"Weight: kg with `cm`, lb with `in`."},"age":{"type":"number","minimum":0,"description":"Age (years)."},"ageMonths":{"type":"number","minimum":0,"description":"Age (months)."}},"example":{"unit":"cm","height":178,"chest":98,"waist":84}},"Comparison":{"type":"object","required":["field","you","size","unit"],"properties":{"field":{"type":"string","description":"Measurement name, e.g. `chest`."},"you":{"type":"number","description":"The shopper's value."},"size":{"type":"number","description":"The recommended size's chart value."},"min":{"type":"number","description":"Lower end, when the chart gives a range."},"max":{"type":"number","description":"Upper end, when the chart gives a range."},"unit":{"type":"string","enum":["cm","kg"]}}},"OutOfRange":{"type":"object","description":"Set when the shopper is outside every size: FITLD says so instead of guessing.","required":["direction","field","you","size","value","unit"],"properties":{"direction":{"type":"string","enum":["below","above"]},"field":{"type":"string"},"you":{"type":"number"},"size":{"type":"string","description":"The smallest (below) or largest (above) size."},"value":{"type":"number","description":"That size's chart value."},"unit":{"type":"string","enum":["cm"]}}},"Recommendation":{"type":"object","required":["recommended_size","out_of_range","confidence","fit_quality","measurement_gap_cm","category","explain","chart"],"properties":{"recommended_size":{"type":"string","description":"The size to select, as written in the size chart.","example":"M"},"out_of_range":{"anyOf":[{"$ref":"#/components/schemas/OutOfRange"},{"type":"null"}]},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"How closely the shopper matches the size (1 = exactly)."},"fit_quality":{"type":"string","enum":["great","good","fair"],"description":"`confidence` in words: ≥ 0.8 great, ≥ 0.5 good."},"measurement_gap_cm":{"type":"number","description":"Average distance between the shopper and the size, in cm."},"category":{"type":"string","example":"Tops"},"tolerance":{"type":"number","description":"Distance (cm) still counted as a fit for this category."},"explain":{"type":"object","properties":{"comparisons":{"type":"array","items":{"$ref":"#/components/schemas/Comparison"},"description":"The shopper's key measurements next to the size's, most important first."},"alternatives":{"type":"array","items":{"type":"object","properties":{"size":{"type":"string"},"score":{"type":"number"}}},"description":"Up to two next-closest sizes."},"between_sizes":{"type":"null"},"why":{"type":"array","items":{"type":"string"}},"fitAdjusted":{"type":"object","description":"Present when the product is marked as running small or large and FITLD moved one size.","properties":{"from":{"type":"string"},"to":{"type":"string"},"reason":{"type":"string","enum":["runs_small","runs_large"]}}}}},"size_system":{"anyOf":[{"type":"string"},{"type":"null"}]},"equivalents":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"},"description":"The size in other systems, e.g. `{ \"EU\": \"50\" }`."},{"type":"null"}]},"chart":{"type":"string","enum":["size_guide","product"],"description":"Whether the answer used a shared size guide or the product's own chart."},"guest":{"type":"boolean","description":"True when sized from measurements in the request, not a signed-in profile."},"variant":{"type":"string","description":"Experiment arm, when FITLD is testing a change (widget only)."},"livemode":{"const":false,"description":"Only present, and false, for test-mode requests."}}},"ResolvedProduct":{"type":"object","required":["productId","productName","category","ageGroup"],"properties":{"productId":{"type":"string","description":"FITLD's id for the product; pass it to the sizing endpoints."},"productName":{"type":"string"},"category":{"type":"string"},"ageGroup":{"type":"string","description":"Which measurement form to show: `Adult`, `Kids`, `Baby`…"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}]},"livemode":{"const":false}}},"Error":{"type":"object","required":["error","code","requestId"],"properties":{"error":{"type":"string","description":"A message you can show. May be reworded."},"code":{"type":"string","description":"Stable reason, for your code. Never reworded."},"requestId":{"type":"string","pattern":"^req_","description":"Quote it to FITLD support; same as the X-Request-Id header."},"missing":{"type":"array","items":{"type":"string"},"description":"With `measurements_missing`: the measurements to ask for."},"detected":{"type":"object","description":"With `product_not_connected`: what FITLD read from the page."},"connectHint":{"type":"object","description":"With `product_not_connected`: a suggested store handle."},"upgradeUrl":{"type":"string"},"livemode":{"const":false}},"additionalProperties":true},"WebhookEvent":{"type":"object","required":["id","type","created","livemode","api_version","data"],"properties":{"id":{"type":"string","pattern":"^evt_","description":"Same on every retry: use it to ignore duplicates."},"type":{"type":"string"},"created":{"type":"string","format":"date-time"},"livemode":{"const":true},"api_version":{"const":"v1"},"data":{"type":"object"}}},"WebhookLine":{"type":"object","properties":{"product_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"shopify_line_item_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"anyOf":[{"type":"string"},{"type":"null"}]},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"anyOf":[{"type":"string"},{"type":"null"}]},"recommended_size":{"anyOf":[{"type":"string"},{"type":"null"}]},"size_matched":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"quantity":{"type":"integer"}}}},"securitySchemes":{"secretKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Your secret key (`fit_sk_…`, or `fit_sk_test_…`). Server to server only: refused from a browser on a store."},"shopperToken":{"type":"http","scheme":"bearer","description":"A signed-in shopper's FITLD token."}}}}