The API endpoints depend on each other, meaning you will need to use data from one response to query another. The link to our API is https://api.easysize.me/v1/, followed by your unique shop id. The shop id will be provided by Easysize.
Example request:
https://api.easysize.me/v1/qwerty1213/size_recommendation_for_user/?user_id=0001dad5c09d15dacd80210886c38463&product_gender=male&product_types=[“T-shirt”]&product_brand=Nike&product_id=26868613&sizes_in_stock=[“S”,”M”,”L”]&product_fit=Tight
In order to be authenticated you need to add a secret key (provided by Easysize) to headers:
Secret-key: 44c62c6e9cde3bef188c7aa337a67bbfda621c65
GET
/size_recommendation_for_user/
Parameter | Type | Example value | Description |
---|---|---|---|
user_id* | String | 123123 |
ID of the logged in user. |
product_gender* | String | male |
Gender of the current product. |
product_types* | String | ["men", "sale", "t-shirts"] |
JSON array with product types. You can send a list of product categories and we will identify the correct type from the list. |
product_brand* | String | Solid |
Brand of the current product. |
product_id* | String | 234512 |
ID of the current product in your system. |
sizes_in_stock* | String | ["S","M","L"] |
JSON array with product sizes. The recommended size format is based on this input. |
product_fit | String | regular |
Fit of the current product. |
product_sku | String | SD-TS-WT-001 |
SKU of the current product. |
product_model | String | SM-2016 |
Model of the current product. |
Note response code is always 200, if there is an issue a status code could be found in the body of the response
Size recommended
{
"recommendation": {
"accuracy": { // accurancy of prediction. Data can be used for visualization.
"proven_by": 127,
"title": "It's a great fit!",
"out_of_5": 4.69,
"percentage": 93.75
},
"size": "L", // best fit
"tighter_fit_size": "M", // possible tighter fit
"looser_fit_size": null, // possible looser fit
"available": true
}
}
Option with Size Insights
Please note that if recommendation is not available recommendation
object will be null
{
"recommendation": {
"accuracy": { // accurancy of prediction. Data can be used for visualization.
"proven_by": 127,
"title": "It's a great fit!",
"out_of_5": 4.69,
"percentage": 93.75
},
"size": "L", // best fit
"tighter_fit_size": "M", // possible tighter fit
"looser_fit_size": null, // possible looser fit
"available": true
},
"size_insights": {
"stats": {
"smaller": 13,
"normal": 64,
"larger": 12
},
"brand_comparison": {
"smaller_than": ["Ami"],
"similar_to": ["H&M", "Zara"],
"larger_than": ["Vero Moda"]
}
},
}
User was not found
{
"status_code": 606,
"error": "Sorry, we couldn't find this user"
}
Brand is not supported
{
"status_code": 603,
"error": "Sorry, but this brand is not supported"
}
Category is not supported
{
"status_code": 602,
"error": "Sorry, but this product type is not supported"
}
Not enough data to recommend the size
Happens in cases when we’re not sure which size to recommend.
{
"status_code": 601,
"error": "Sorry, we couldn't recommend the size"
}