Sign in with the code
/v1/shoppers/auth/verifyChecks the code from the email and saves the profile to that email.
Keep the token it returns in place of the one you sent: it is the
account's, and works with any organization's key from now on.
When the email already has a profile, what was learnt on this one
(reactions, notes, sizes, measurements) moves into it, this profile is
deleted, and merged is true. Five wrong codes spend the code.
Headers
1The shopper's profile token, from auth/start, auth/verify or any call that made a profile.
Request body
application/jsonrequiredThe email the code was sent to.
The six digits from the email. Anything that is not a digit is ignored, so "482 913" is read as 482913.
Response
The account's token. Replaces the one you hold.
true when the email already had a profile and this one was moved into it.
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.
Errors
29Every 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.The request body could not be parsed as JSON.
Request body must be a JSON object.The request body parsed to something other than a JSON object.
Send the shopper's token in x-shopper-token, or start a profile (auth/start).No X-Shopper-Token was sent. Send the token the code was asked for with.
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.
That code is not right.The code does not match. The code stays usable until the fifth wrong try.
Too many wrong codes. Ask for a new one.This was the fifth wrong code; the code is spent.
Shopper profiles are switched off for this organization.The organization turned shopper profiles off.
No such profile.The profile was deleted while the code was waiting.
That code has expired. Ask for a new one.No unused code for this profile and email is less than 10 minutes old.
Enter the six-digit code from the email.email is not an email address, or code does not hold exactly six digits.
curl -X POST "https://stylor.ai/api/v1/shoppers/auth/verify" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"code": "482913"
}'{
"token": "eyJ2IjoxLCJ0eXAiOiJwcm9maWxlIiwicCI6IjkxYzQi…",
"merged": false,
"profile": {
"saved": true,
"email": "[email protected]",
"styles": [],
"outfits": [],
"avoidStyles": [],
"likes": [],
"avoids": [],
"notes": [],
"sizes": [],
"body": null,
"signals": 3
}
}