Skip to content
Get started

API reference

Base URLhttps://api.fitld.com/v1
OpenAPI 3.1 document

Authentication

Errors

errorstringrequired
codestringrequired
requestIdstringrequired
missingstring[]
detectedobject
connectHintobject
upgradeUrlstring
livemodefalse

Test mode

post/v1/widget/recommend

Recommend a size (storefront)

Authentication · Widget ID in the body.

Request body

widgetIdstringrequired
productIdstringrequired
measurementsMeasurements
userIdstring
userTokenstring
dependentIdstring
sessionIdstring

Responses

200
400
401
404
422
429
curl https://api.fitld.com/v1/widget/recommend \
  -H "Content-Type: application/json" \
  -d '{
    "widgetId": "wgt_YOUR_WIDGET_ID",
    "productId": "OXFORD-SHIRT",
    "measurements": {
      "unit": "cm",
      "height": 178,
      "chest": 98,
      "waist": 84
    },
    "sessionId": "s_2f9c1a"
  }'
200 Response
{
  "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
}
422 Error
{
  "error": "Your measurements are missing: chest. Please add the missing measurement.",
  "code": "measurements_missing",
  "missing": [
    "chest"
  ],
  "requestId": "req_8fK2xQm1Lw0aZt7c"
}

post/v1/products/resolve

Find the product on a page

Authentication · Widget ID in the body, or your secret key in x-api-key.

Request body

widgetIdstring
productIdstring
externalProductIdstring
skustring
canonicalUrlstring
ogUrlstring
pageUrlstring
titlestring

Responses

200
400
401
403
404
429
curl https://api.fitld.com/v1/products/resolve \
  -H "x-api-key: $FITLD_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "widgetId": "wgt_YOUR_WIDGET_ID",
    "canonicalUrl": "https://shop.example.com/products/classic-oxford"
  }'
200 Response
{
  "productId": "OXFORD-SHIRT",
  "productName": "Classic Oxford",
  "category": "Tops",
  "ageGroup": "Adult",
  "audience": "Men"
}

post/v1/recommend-size/guest

Recommend a size (server)

Authentication · Your secret key in x-api-key.

Request body

productIdstringrequired
measurementsMeasurementsrequired

Responses

200
400
401
403
404
422
429
curl https://api.fitld.com/v1/recommend-size/guest \
  -H "x-api-key: $FITLD_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "OXFORD-SHIRT",
    "measurements": {
      "unit": "cm",
      "chest": 98,
      "waist": 84
    }
  }'
200 Response
{
  "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
}
422 Error
{
  "error": "Your measurements are missing: chest. Please add the missing measurement.",
  "code": "measurements_missing",
  "missing": [
    "chest"
  ],
  "requestId": "req_8fK2xQm1Lw0aZt7c"
}

post/v1/recommend-size

Recommend a size for a signed-in shopper

Authentication · Your secret key in x-api-key, plus the shopper's token in Authorization: Bearer.

Request body

productIdstringrequired
dependentIdstring

Responses

200
400
401
403
404
422
429
curl https://api.fitld.com/v1/recommend-size \
  -H "x-api-key: $FITLD_SECRET_KEY" \
  -H "Authorization: Bearer $SHOPPER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "productId": "OXFORD-SHIRT"
  }'
200 Response
{
  "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"
}
422 Error
{
  "error": "Your measurements are missing: chest. Please add the missing measurement.",
  "code": "measurements_missing",
  "missing": [
    "chest"
  ],
  "requestId": "req_8fK2xQm1Lw0aZt7c"
}

get/v1/openapi.json

This document

Authentication · None.

Responses

200
curl https://api.fitld.com/v1/openapi.json

Webhook events

Webhooks in the docs

order.attributed

An order includes items bought after using FITLD.

data

order_idstringrequired
order_namestring | null | null
currencystring | null | null
paid_atstring
linesWebhookLine[]required

refund.created

Items bought after using FITLD were refunded.

data

order_idstringrequired
refund_idstringrequired
refunded_atstring
linesobject[]required

return.recorded

A return of an item bought after using FITLD, with its reason.

data

order_idstringrequired
linesobject[]required

fit_feedback.received

A shopper said how an item fit.

data

order_idstring
product_idstring | null | null
product_namestring | null | null
sizestring | null | null
recommended_sizestring | null | null
followed_recommendationboolean | null | null
answer"too_small" | "right" | "too_large"

product.unmatched

A product page without a FITLD size chart was seen for the first time.

data

urlstring
titlestring | null | null
handlestring | null | null
first_seen_atstring

usage.threshold_reached

Recommendations this month reached 80% or 100% of your plan.

data

monthstring
thresholdnumber
usedinteger
limitinteger
planstring
hard_limitinteger

Measurements

unit"cm" | "in"
heightnumber
chestnumber
waistnumber
hipsnumber
shouldernumber
sleevenumber
bicepnumber
wristnumber
inseamnumber
outseamnumber
thighnumber
anklenumber
footLengthnumber
footWidthnumber
handLengthnumber
palmWidthnumber
necknumber
headnumber
weightnumber
agenumber
ageMonthsnumber

Recommendation

recommended_sizestringrequired
out_of_rangeOutOfRange | nullrequired
confidencenumberrequired
fit_quality"great" | "good" | "fair"required
measurement_gap_cmnumberrequired
categorystringrequired
tolerancenumber
explainobjectrequired
size_systemstring | null | null
equivalentsobject | null | null
chart"size_guide" | "product"required
guestboolean
variantstring
livemodefalse

ResolvedProduct

productIdstringrequired
productNamestringrequired
categorystringrequired
ageGroupstringrequired
audiencestring | null | null
livemodefalse

Error

errorstringrequired
codestringrequired
requestIdstringrequired
missingstring[]
detectedobject
connectHintobject
upgradeUrlstring
livemodefalse

WebhookEvent

idstringrequired
typestringrequired
createdstringrequired
livemodetruerequired
api_version"v1"required
dataobjectrequired