Keep notes, sizes, measurements

post/v1/shoppers/me/remember

Keeps 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.

Public keyapi.v1.shoppersDemo key OK

Headers

1
X-Shopper-Tokenstring

The shopper's profile token, from auth/start, auth/verify or any call that made a profile. Optional here.

Request body

application/jsonrequired
array<object>

Things that hold beyond one visit. Each is trimmed to 280 characters.

textstringrequired

The note, in a sentence.

maxLength: 280
kindstring

What the note is about. Anything else is kept as other.

One ofaboutlikesavoidsoccasionbudgetother
default: "other"
array<ShopperKeptSizeInput>

Sizes 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.

brandstringrequired

The brand or store, as the shopper said it ("Levi's", "Uniqlo").

maxLength: 60
kindstringnullable

What the size is for. Jeans and trousers share the bottom slot but are kept apart. Missing or unknown, it is read from garment.

One oftopsjeanstrousersdressesouterwearsuitsnull
garmentstringnullable

The 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.

One oftshirtshirttopjacketsuitjeanstrousersshortsleggingsskirtdressnull
slotstringnullable

The garment slot (top, bottom, one-piece, outerwear). Missing, it comes from the kind.

labelstringrequired

The size as the brand writes it ("M", "30", "32x32", "UK 10").

maxLength: 20
fitstring

How that size fits them. tight is kept as small, loose as large. Anything else is kept as right.

One ofrightsmalllargetightloose
default: "right"
ShopperBodyInput

Body 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.

bustnumber

Bust or chest.

waistnumber

Natural waist.

hipsnumber

Hips at the widest.

inseamnumber

Inside leg.

heightnumber

Height.

unitstring

The unit of the measurements. Required with any measurement.

One ofcmin
fitstring

How they like things to fit.

One offittedregularrelaxed

Response

200Kept. The profile as it now is.
ShopperProfilerequired

A profile in words. Never the vectors behind it.

savedbooleanrequired

true once the shopper confirmed an email: the profile is theirs, lasts until they delete it, and works at every store that runs Stylor.

emailstringnullablerequired

The confirmed email. Null on an anonymous profile.

array<object>required

Styles learnt from their reactions, strongest first. At most four per slot.

array<object>required

Kinds of whole look they liked, strongest first.

array<object>required

Styles they passed on often enough to say.

likesarray<string>required

Labels they clearly lean toward, read from their reactions, never said by them ("colour: black"). At most 8.

avoidsarray<string>required

Labels they clearly lean away from. At most 8.

array<object>required

What they told you, kept with remember.

array<ShopperKeptSize>required

Sizes they wear, by brand or store.

ShopperBody | nullrequired

Their body measurements in centimetres, and how they like things to fit. Null when none are kept.

signalsintegerrequired

Reactions learnt from.

tokenstring

Only when no token was sent and this call made the profile.

Errors

32

Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.

400
Request body must be valid JSON.

A body was sent and could not be parsed as JSON.

400
Request body must be a JSON object.

A body was sent and parsed to something other than a JSON object.

401
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.

403
Shopper profiles are switched off for this organization.

The organization turned shopper profiles off.

404
No such profile.

The profile was deleted during the call.

422
body must be an object.

body was sent but is not an object.

422
body must hold at least one measurement or a fit.

body is an empty object.

422
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.

422
body.unit must be "cm" or "in".

body holds a measurement and unit is missing or another value.

422
body.<key> must be a number.

A measurement is not a number (for example the string "76").

422
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.

422
body.fit must be one of fitted, regular, relaxed.

body.fit is another value.

422
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"
    }
  ]
}'
Response · 200
{
  "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
  }
}