Keep notes, sizes, measurements
/v1/shoppers/me/rememberKeeps what the shopper told you for next time: notes about them, the sizes they wear at other brands, and their body measurements. The chat agent and the size endpoint read all three.
A note already kept (the same words) is not added twice. A size replaces the one kept for the same brand, slot and kind. A measurement replaces the one kept, and the measurements not sent are kept. A profile keeps the latest 30 notes and 40 sizes.
Measurements are checked before anything is kept: one outside the
range a person can have (a waist of 32 sent as cm was meant as
inches) fails the whole call with 422, and nothing is written.
They are kept in centimetres whatever unit you send.
Without a token, a profile is made and its token is returned.
Headers
1The shopper's profile token, from auth/start, auth/verify or any call that made a profile. Optional here.
Request body
application/jsonrequiredThings that hold beyond one visit. Each is trimmed to 280 characters.
The note, in a sentence.
What the note is about. Anything else is kept as other.
aboutlikesavoidsoccasionbudgetotherSizes they wear, by brand. An entry without brand or
label is skipped. Takes the sizes card's
rows as they are: fit as the card says it (tight,
right, loose) or as the profile keeps it (small,
right, large), and a garment for the kind.
The brand or store, as the shopper said it ("Levi's", "Uniqlo").
What the size is for. Jeans and trousers share the bottom slot but are kept apart. Missing or unknown, it is read from garment.
topsjeanstrousersdressesouterwearsuitsnullThe card's row it was picked in. Gives the kind when none is sent (a t-shirt is tops, a suit jacket suits); not kept itself.
tshirtshirttopjacketsuitjeanstrousersshortsleggingsskirtdressnullThe garment slot (top, bottom, one-piece, outerwear). Missing, it comes from the kind.
The size as the brand writes it ("M", "30", "32x32", "UK 10").
How that size fits them. tight is kept as small, loose as large. Anything else is kept as right.
rightsmalllargetightlooseBody measurements to keep, in unit. Each must be a number in the
range a person can have: bust 60–180, waist 45–170, hips 65–180,
inseam 50–100, height 120–230 cm. Kept in centimetres.
Bust or chest.
Natural waist.
Hips at the widest.
Inside leg.
Height.
The unit of the measurements. Required with any measurement.
cminHow they like things to fit.
fittedregularrelaxedResponse
A profile in words. Never the vectors behind it.
true once the shopper confirmed an email: the profile is theirs, lasts until they delete it, and works at every store that runs Stylor.
The confirmed email. Null on an anonymous profile.
Styles learnt from their reactions, strongest first. At most four per slot.
Kinds of whole look they liked, strongest first.
Styles they passed on often enough to say.
Labels they clearly lean toward, read from their reactions, never said by them ("colour: black"). At most 8.
Labels they clearly lean away from. At most 8.
What they told you, kept with remember.
Sizes they wear, by brand or store.
Their body measurements in centimetres, and how they like things to fit. Null when none are kept.
Reactions learnt from.
Only when no token was sent and this call made the profile.
Errors
32Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
Request body must be valid JSON.A body was sent and could not be parsed as JSON.
Request body must be a JSON object.A body was sent and parsed to something other than a JSON object.
That shopper token is not valid here. Start a profile or sign in again.X-Shopper-Token was sent but cannot be opened with this key.
Shopper profiles are switched off for this organization.The organization turned shopper profiles off.
No such profile.The profile was deleted during the call.
body must be an object.body was sent but is not an object.
body must hold at least one measurement or a fit.body is an empty object.
body.<key> is not a measurement we keep. Allowed: bust, waist, hips, inseam, height, unit, fit.body holds a key that is not one of those.
body.unit must be "cm" or "in".body holds a measurement and unit is missing or another value.
body.<key> must be a number.A measurement is not a number (for example the string "76").
body.<key> must be between <low>–<high> cm.A measurement is outside what a person can have: bust 60–180, waist 45–170, hips 65–180, inseam 50–100 and height 120–230 cm. In inches when unit is in.
body.fit must be one of fitted, regular, relaxed.body.fit is another value.
Validation failed.body has more than one problem. details lists each, by path.
{
"error": "Validation failed.",
"details": [
{
"path": "body.unit",
"message": "body.unit must be \"cm\" or \"in\"."
},
{
"path": "body.waist",
"message": "body.waist must be a number."
}
]
}curl -X POST "https://stylor.ai/api/v1/shoppers/me/remember" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"notes": [
{
"text": "Starting a new office job in March",
"kind": "occasion"
}
],
"sizes": [
{
"brand": "Levi'\''s",
"kind": "jeans",
"slot": "bottom",
"label": "30",
"fit": "right"
},
{
"brand": "Uniqlo",
"kind": "tops",
"slot": "top",
"label": "M",
"fit": "small"
}
]
}'{
"profile": {
"saved": false,
"email": null,
"styles": [],
"outfits": [],
"avoidStyles": [],
"likes": [],
"avoids": [],
"notes": [],
"sizes": [],
"body": {
"waist": 76.2,
"hips": 97.8,
"inseam": 78.7,
"height": 167.6,
"fit": "relaxed",
"unit": "cm"
},
"signals": 0
}
}