Skip to main content

API Documentation

The Faslet API gives you direct access to provide data, without having to go through third party services.

tip

Access to our APIs is available to customers on certain tiers. If you're in doubt, please reach out to your Faslet representative.

API Base Url

The Faslet public API is versioned under

https://api.faslet.net/public

Current versions documented on this page:

  • https://api.faslet.net/public/v1
  • https://api.faslet.net/public/v2

If you'd like sandbox/staging environment to test against, please reach out to support, so we can create a test store.

Authorization

Include the custom header faslet-shopid set to your Faslet Shop ID. Your API token can be found in the Faslet Partner Portal. This needs to be included as a Bearer token with the authorization header.

The /public/v2/assistant/context and /public/v2/assistant/size-me endpoints use the same public API authorization middleware as the rest of the public API. The faslet-shopid header is also how the API receives retailer context for these requests.

Endpoints

All formats, request and response are JSON. Be sure to include the application/json content header.

Example headers:
"Content-Type" "application/json",
"faslet-shopid": "MY_SHOP_ID",
"authorization": "Bearer MY_API_TOKEN"

POST /returns

https://api.faslet.net/public/v1/returns

Request Body

An Array of Product Info

Product Info
FieldRequiredTypeDescription
orderIdYESstringThe identifier of the order
productIdYESstringThe identifier of the product. This should match the product id send to Faslet with the orders and the button
skuYESstringThe variant SKU
returnDateYESstringISO8601 Date Time
returnReasonYESstringThe return reason value as described below
returnReasonMessageNOstringA message for the return reason. This can be the message sent by the customer
externalIdNOstringThe ID of the return in your system
Example Request
[{
"orderId": "1234",
"productId": "1234",
"sku": "1234",
"returnReason": "1",
"returnDate": "2022-02-05T18:40:00.000Z",
"externalId": "o-123"
}, {
"orderId": "3456",
"productId": "3456",
"sku": "3456",
"returnReason": "3",
"returnDate": "2022-09-05T18:40:00.000Z",
"externalId": "o-345"
}]
Return reasons
ReasonValue
Too big1
Too small2
Product is damaged3
Product isn’t as expected4
Wrong article/ size5
Color isn’t as expected6
Quality isn’t as expected7
Other reason8
Multiple sizes ordered9

Response

StatusCodes
StatusDescription
202The request was accepted.
Body
FieldRequiredType
errorsYESArray of Return Error
Return Error
FieldTypeDescription
messagestringThe error message
Example Response
{
"errors": [
{
"message": "returnDate is invalid for order 1234"
}
]
}

POST /orders

https://api.faslet.net/public/v1/orders

Request Body

An Order Event

Order Event
FieldRequiredTypeDescription
customerDataPackageYESstringThe customer data package obtained from the faslet-orders script
orderIdYESstringThe identifier of the order
paymentStatusYESstringThe payment status of the order
lineItemsYESarrayArray of Line Items
Line Item
FieldRequiredTypeDescription
productIdYESstringThe identifier of the product
titleYESstringThe title of the product
variantIdYESstringThe identifier of the variant
skuYESstringThe SKU of the variant
variantYESstringThe variant description
quantityYESnumberThe quantity ordered
priceYESnumberThe price of the item
Example Request
{
"orderId": "1234",
"paymentStatus": "paid",
"lineItems": [{
"productId": "1234",
"title": "Test API Order",
"variantId": "1234",
"sku": "1234",
"variant": "S",
"quantity": 1,
"price": 123.45
}],
"customerDataPackage": "yX2lkIjoibm8tdXNlci1kYXRhIiwiaGFzVXNlZFdpZGdldCI6ZmFsc2UsInBsYXRmb3JtIjoidW5rbm93biIsImV4cGVyaW1lbnRWYXJpYW50cyI6W119"
}
Getting the Customer Data Package

To obtain the customerDataPackage, include the faslet-orders script somewhere before the end of the checkout flow:

<script src="https://widget.faslet.net/faslet-orders.js"></script> 
<script>
var fasletCustomerDataPackage = window._faslet_orders.getCustomerDataPackage(MY_SHOP_ID)
/* Send fasletCustomerDataPackage to your backend to be used in the API request */
</script>

POST /size-specs

https://api.faslet.net/public/v1/size-specs/MY_BRAND

Request Parameters

FieldRequiredTypeDescription
brandYESstringThen name of the brand for this size specification

Request Body

An Array of Product Size Descriptors

Product Size Descriptor
FieldRequiredTypeDescription
productNameYESstringThe name or title of the product.
productIdYESstringThe identifier of the product. This should match the product id send to Faslet with the orders and the button
genderYESstringThe gender of the product. Must be male, female or unisex
productUrlYESstringThe url of the product as found on the store
sizeChartSpecificationsYESstringAn array of size specifications
Size Chart Specification
FieldRequiredTypeDescription
sizeLabelYESstringThe size label of the variant.
useDefaultsNObooleanWhether this variant should use default size charts as provided by Faslet.
waistNOnumberThe minimum measurement of the waist for this size label.
hipsNOnumberThe minimum measurement of the hips for this size label.
chestNOnumberThe minimum measurement of the chest for this size label.
innerLegNOnumberThe minimum measurement of the innerLeg for this size label.
lengthNOnumberThe minimum measurement of the length for this size label.
sleeveNOnumberThe minimum measurement of the sleeve for this size label.
thighNOnumberThe minimum measurement of the thigh for this size label.
shoulderNOnumberThe minimum measurement of the shoulder for this size label.
waistStretchedNOnumberThe maximum measurement of the waist for this size label.
hipsStretchedNOnumberThe maximum measurement of the hips for this size label.
chestStretchedNOnumberThe maximum measurement of the chest for this size label.

If you choose not to use defaults, please provide as much of this information as possible in order to get the most accurate size charts. Our algorithms will process these and optimize them based on how much information is given.

Example Request
[{
"productName": "Jacket",
"productId": "11",
"gender": "male",
"productUrl": "https://mywebstore.com/en/jacket.html",
"sizeChartSpecifications": [{
"useDefaults": false,
"waist": 60,
"waistStretched": 70,
"hips": 50,
"hipsStretched": 56,
"chest": 65,
"sizeLabel": "S"
}, {
"waist": 63,
"hips": 53,
"chest": 68,
"sizeLabel": "M"
}, {
"waist": 68,
"hips": 58,
"chest": 73,
"sizeLabel": "XL",
"useDefaults": false
}]
}]

Response

StatusCodes
StatusDescription
201New size specifications were created.
200Existing size specifications were updated.
Body
FieldRequiredType
errorsNOArray of Return Error. In the case of a 2xx response, with some (or all) size specifications skipped, a list of errors will be provided
errorNOA Return Error. In the case of a 4xx response, a single error will be returned and nothing will be processed
Return Error
FieldTypeDescription
messagestringThe error message
Example Response
{
"errors": [
{
"message": "[Item 42] No Product URL, ignoring"
},
{
"message": "[Item 76] No Product ID, ignoring"
}
]
}
info

Errors in individual Size Chart Specifications will not prevent everything from processing. The error will list the index of the descriptor that failed. These will return a 2xx status code and can be safely retried after fixing the errors.

Errors in the Product Size Descriptors will prevent processing and will return a 4xx status code.

POST /assistant/state/

🚧Preview
Note that this API is currently in preview. While we don't expect anything to change, please contact us before using it. We will work together to ensure a smooth transition to the final version.
https://api.faslet.net/public/v1/assistant/state/MY_BRAND

Request Parameters

FieldRequiredTypeDescription
brandYESstringThen name of the brand for this size specification

Query String Parameters

FieldRequiredTypeDescription
disableTrackingNobooleanSet this to true if you want to disable all analytics. This will prevent any data from going into the Faslet Partner Portal, and will stop the system from being able to adjust automatically.

Request Body

FieldRequiredTypeDescription
productIdYESstringThe unique identifier for the product
variantsYESArray of VariantList of product variants
productNameNOstringThe name of the product
productUrlNOstringThe URL of the product
productImageNOstringThe URL of the product image
userId1NOstringThe unique identifier for the user
widgetVersion1NOstringThe version of the widget being used
seenExperiments1NOstringThe experiments the user has seen
experimentVariants1NOstringThe variants of the experiments the user has been exposed to
profile1NOProfileThe profile of the user
1obtained from the Faslet Javascript onDataChanged callback

Variant

FieldRequiredTypeDescription
sizeLabelYESstringThe label of the size for this variant
availableYESbooleanIndicates if the variant is available for purchase/in stock
variantIdYESstringThe unique identifier for this variant
Example Requests

An initial request before getting user data from the assistant may look like this:

{
"productId": "11",
"variants": [{
"sizeLabel": "S",
"available": true,
"variantId": "1234"
}, {
"sizeLabel": "M",
"available": true,
"variantId": "5678"
}]
}

Subsequent requests after getting user data from the assistant may look like this:

{
"productId": "11",
"variants": [{
"sizeLabel": "S",
"available": true,
"variantId": "1234"
}, {
"sizeLabel": "M",
"available": true,
"variantId": "5678"
}],
"userId": "1234",
"widgetVersion": "v35.0.3",
"seenExperiments": "exp1,exp2",
"experimentVariants": "exp1_variant1,exp2_variant2",
"profile": {
"gender": "male",
"height": 180,
"weight": 85,
"age": 29
...
}
}

Response

StatusCodes
StatusDescription
200The endpoint returned a state result
Body
FieldRequiredTypeDescription
stateYESstringThe state of the assistant. Can be hidden, default or result
dataYESobjectWhen the state is result, the data contains the recommened size label as a field called result. This also contains a userId which should be used in the widget initialization
Example Response

When a product is not available:

{
"state": "hidden",
"data": {
"userId" "123-456-789"
}
}

When a product is available:

{
"state": "default",
"data": {
"userId" "123-456-789"
}
}

When a product is available and a result is available:

{
"state": "result",
"data": {
"result": "M",
"userId" "123-456-789"
}
}

Assistant API v2

The Assistant API v2 endpoints support public-facing assistant flows where clients first resolve product and shopper context, then request a size recommendation when the sizeMe capability is available and all required inputs are present.

These endpoints are both POST endpoints under /public/v2:

  • /assistant/context
  • /assistant/size-me

Shared request body

Both endpoints use the same request body shape.

https://api.faslet.net/public/v2

Authentication and retailer context

  • Authenticate with authorization: Bearer MY_API_TOKEN
  • Provide retailer context with faslet-shopid: MY_SHOP_ID
  • Send JSON with Content-Type: application/json

Example request

{
"userId": "user-123",
"product": {
"productUrl": "https://shop.example.com/products/example-product",
"productIdentifier": "sku-123",
"brand": "Nike",
"productName": "Example Product",
"sizeLabels": ["S", "M", "L"]
},
"profile": {
"gender": "female",
"height": 180,
"weight": 75,
"age": 30,
"hasMadeOrders": false,
"hasUsedAssistant": true,
"referenceItems": [],
"measurements": {
"fit": 2,
"waist": 2,
"hips": 2,
"chest": 2,
"footWidth": 2,
"braCupSize": "C",
"braBandSize": 75,
"relativeSizingPreference": 2
}
},
"experiments": {
"device": "mobile",
"experimentVariants": "variant-a",
"seenExperiments": "1,2",
"newDevice": "newDevice"
}
}

Top-level fields

FieldRequiredTypeDescription
userIdNOstringOptional shopper identifier. If omitted, the backend generates one and returns it in the response.
productYESobjectProduct context used to resolve the assistant state for a product. The product object is required and must include at least one product locator.
profileNOobjectOptional shopper profile data used for capability resolution and sizing.
experimentsNOobjectOptional experiment metadata used for the assistant flow.

product

The product object is required, and at least one product locator must be provided:

  • product.productUrl?: string
  • product.productIdentifier?: string

Additional supported fields:

  • brand?: string
  • productName?: string
  • sizeLabels?: string[]
FieldRequiredTypeDescription
productUrlNO*stringProduct URL used to resolve the product context.
productIdentifierNO*stringProduct identifier used to resolve the product context.
brandNOstringBrand name for the product.
productNameNOstringProduct name or title.
sizeLabelsNOstring[]Available size labels for the product.

* At least one of productUrl or productIdentifier must be present.

If neither productUrl nor productIdentifier is provided, the API returns:

{
"status": "invalid_input",
"message": "product.productUrl or product.productIdentifier is required"
}

profile

The current profile.gender contract accepts male and female.

FieldRequiredTypeDescription
genderNOone of: male, femaleShopper gender, if known.
heightNOnumberShopper height in centimeters.
weightNOnumberShopper weight in kilograms.
ageNOnumberShopper age in years.
hasMadeOrdersNObooleanWhether the shopper has previously placed orders with the store.
hasUsedAssistantNObooleanWhether the shopper has previously used the sizing assistant.
referenceItemsNOReferenceItem[]Optional list of items the shopper already wears and knows the size of.
measurementsNOAssistantContextMeasurementsInputOptional body-shape and sizing-preference inputs.

profile.referenceItems

Optional list of known items the shopper already wears.

FieldRequiredTypeDescription
brandNOstringBrand of the reference item.
modelNOstringModel or product name of the reference item.
sizeNOstringShopper’s known size in that item.
genderNOstringGender or category of the reference item.

profile.measurements

These values are normalized assistant profile inputs, not raw centimeter measurements. Most numeric fields here are small qualitative scales used to describe body shape or fit preference. For the ordinal numeric fields, use values like 1, 2, and 3, where 2 is the average/default value and lower or higher values represent smaller/tighter versus larger/looser selections.

FieldRequiredTypeDescription
fitNOnumberFit preference scale, for example 1, 2, 3, from tighter to looser fit.
waistNOnumberWaist shape scale, not waist circumference, for example 1, 2, 3, from flatter to rounder waist shape.
hipsNOnumberHip width scale, not hip circumference, for example 1, 2, 3, from narrower to wider hips.
chestNOnumberChest width scale, not chest circumference, for example 1, 2, 3, from narrower to wider chest shape.
footWidthNOnumberFoot width scale, not a physical width measurement, for example 1, 2, 3, from narrower to wider feet.
braCupSizeNOstringBra cup size, for example B, C, or D.
braBandSizeNOnumberBra band size, for example 75, 80, 34, or 36, depending on the sizing system used.
relativeSizingPreferenceNOnumberSigned sizing preference value. Expected values are typically -2, -1, 0, 1, or 2, where 0 is neutral. Unlike waist, hips, chest, and similar fields, this is not a body-shape scale.

Guidance for API consumers:

  • Send height in centimeters and weight in kilograms.
  • Treat fit, waist, hips, chest, and footWidth as qualitative scales, not exact measurements.
  • If a field is not known, omit it rather than guessing.
  • braCupSize and braBandSize are optional and only relevant when bra sizing information is available.

experiments

FieldRequiredTypeDescription
deviceNOone of: all, mobile, desktopTabletDevice bucket used for experiment targeting.
experimentVariantsNOstringComma-separated or serialized experiment variant data.
seenExperimentsNOstringPreviously seen experiments.
newDeviceNOone of: all, newDevice, returningDeviceWhether this device is new or returning.

POST /assistant/context

https://api.faslet.net/public/v2/assistant/context

Purpose

Resolve assistant context for a product and return:

  • normalized product context
  • widget configuration
  • capabilities
  • experiment metadata

Clients can use /assistant/context to drive UI decisions:

  • which assistant actions are available
  • which profile or product inputs still need to be collected
  • whether virtual try-on can be offered

nextRequiredInputs is intended for progressive input collection flows.

Success response

{
"status": "resolved",
"userId": "user-123",
"productContext": {
"shopId": "shop-1",
"brand": "Nike",
"productIdentifier": "sku-123",
"productName": "Example Product",
"productUrl": "https://shop.example.com/products/example-product",
"virtualTryOnImageUrl": "https://cdn.example.com/image.jpg"
},
"widgetConfiguration": {
"locale": "en",
"buttonBackgroundColor": "#000000",
"virtualTryOn": {
"enabled": true
}
},
"capabilities": {
"sizeMe": {
"name": "sizeMe",
"available": true,
"requiredInputs": [
{
"name": "height",
"source": "profile",
"required": true
}
],
"nextRequiredInputs": []
},
"tryOn": {
"name": "tryOn",
"available": true,
"requiredInputs": [
{
"name": "userPhoto",
"source": "profile",
"required": true
}
],
"nextRequiredInputs": [
"userPhoto"
]
}
},
"experiments": {
"activeVariants": [],
"seenExperiments": []
}
}

Response fields

status

Assistant context execution status. Successful context resolution returns:

  • resolved
productContext

Normalized product context:

FieldRequiredTypeDescription
shopIdYESstringFaslet shop identifier.
brandNOstringNormalized product brand.
productIdentifierNOstringNormalized product identifier.
productNameNOstringNormalized product name.
productUrlNOstringNormalized product URL.
virtualTryOnImageUrlNOstringProduct image used for virtual try-on.
widgetConfiguration

The backend returns a partial widget configuration object for the assistant experience. Supported exposed keys include:

  • locale
  • localizationOverrides
  • buttonBackgroundColor
  • buttonHeight
  • buttonFillParent
  • buttonAlignmentInParent
  • buttonContentAlignment
  • fontColor
  • bodyFontColor
  • headerFontColor
  • secondaryFontColor
  • borderRadius
  • popupBorderRadius
  • disableIcon
  • customIcon
  • disableBorder
  • disableUiShadows
  • disableBackgroundBlur
  • headerImage
  • virtualTryOn
capabilities

The backend returns capability objects in:

  • capabilities.sizeMe
  • capabilities.tryOn

Each capability has this shape:

FieldRequiredTypeDescription
nameYESstringCapability name.
availableYESbooleanWhether the capability can currently be used.
requiredInputsYESarrayFull list of AssistantInputRequirement objects for the capability.
nextRequiredInputsYESstring[]Inputs that are still missing in the current request.
reasonNOstringHuman-readable reason when the capability is unavailable.
AssistantInputRequirement
{
"name": "height",
"source": "profile",
"required": true
}
FieldRequiredTypeDescription
nameYESstringInput name.
sourceYESone of: profile, productWhere the missing or required input should come from.
requiredYESbooleanWhether the input is required.

Capability semantics

sizeMe

Describes whether size recommendation is available for the current product context.

FieldRequiredTypeDescription
nameYES'sizeMe'Capability identifier.
availableYESbooleanfalse when the product does not support Size Me.
requiredInputsYESarrayFull set of inputs needed to size.
nextRequiredInputsYESstring[]Missing inputs for the current request.
reasonNOstringExample: Size Me unavailable for this product.

Behavior:

  • available is false when the product does not support Size Me
  • requiredInputs lists the full set of profile inputs needed to size
  • nextRequiredInputs lists which inputs are still missing for the current request
tryOn

Describes whether virtual try-on is available.

FieldRequiredTypeDescription
nameYES'tryOn'Capability identifier.
availableYESbooleanWhether virtual try-on is available.
requiredInputsYESarrayFull set of inputs needed for try-on.
nextRequiredInputsYESstring[]Missing inputs for the current request.
reasonNOstringExample: Try-On unavailable for this product.

Behavior:

  • a profile photo input is always required for try-on; use requiredInputs and nextRequiredInputs to determine the exact input(s) still needed for the current request
  • if the product has no virtualTryOnImageUrl, then productImage is also required as a product input

Error cases

Documented non-success cases include:

  • 400 invalid_input when a product locator is missing
  • widget or product lookup failures mapped from the widget info layer
  • missing or invalid retailer context

Treat any response where status !== 'resolved' as a non-success result and inspect message plus any returned details.

POST /assistant/size-me

https://api.faslet.net/public/v2/assistant/size-me

Purpose

Generate a size recommendation using the same request body shape as /assistant/context, after product and profile context has been resolved.

Success response

{
"status": "resolved",
"userId": "user-123",
"productContext": {
"shopId": "shop-1",
"brand": "Nike",
"productIdentifier": "sku-123",
"productName": "Example Product",
"productUrl": "https://shop.example.com/products/example-product"
},
"recommendation": {
"size": "M"
}
}

Success response fields

FieldRequiredTypeDescription
statusYES'resolved'Successful sizing result.
userIdYESstringShopper identifier returned by the backend.
productContextYESobjectResolved product context for the sizing request.
recommendationYESobjectPublic sizing response payload.
recommendation
FieldRequiredTypeDescription
sizeYESstringRecommended size label returned by the sizing service.

Failure response

{
"status": "invalid_input",
"message": "Missing required profile inputs for size-me",
"userId": "user-123",
"productContext": {
"shopId": "shop-1",
"brand": "Nike",
"productIdentifier": "sku-123"
},
"requiredInputs": [
{
"name": "height",
"source": "profile",
"required": true
}
],
"nextRequiredInputs": ["height"]
}

Failure response fields

FieldRequiredTypeDescription
statusYESstringAny non-resolved assistant execution status.
messageNOstringHuman-readable error or availability message.
userIdNOstringShopper identifier.
productContextNOobjectResolved product context when available.
requiredInputsNOarrayFull list of required inputs for the sizing attempt.
nextRequiredInputsNOstring[]Missing inputs for the current request.
detailsNOobjectOptional public sizing failure details returned by the backend.

Failure semantics

invalid_input

Returned when the request does not contain enough profile information to produce a size recommendation.

Example message:

  • Missing required profile inputs for size-me

The response includes:

  • requiredInputs: all inputs needed
  • nextRequiredInputs: the currently missing ones
unavailable

Returned when the product does not support Size Me.

Example message:

  • Size Me unavailable for this product

Additional non-resolved statuses may be surfaced from downstream widget or sizing failure mappings. Clients should treat any status other than resolved as a non-success result and use message, requiredInputs, nextRequiredInputs, and details to decide how to continue the flow.


Help

In case of any questions, please don’t hesitate to contact us on support@faslet.me