Email a sign-in code
/v1/shoppers/auth/codeEmails a six-digit code that saves the shopper's profile to their
email, or opens the profile already saved to it. Send the token you
hold; without one, an anonymous profile is made for the code and its
token is returned, which auth/verify then needs.
The code lasts 10 minutes, and a new one replaces any still waiting. One email can be sent 5 codes an hour, and one profile can ask for 8. The email is sent in the name of your store.
Headers
1The shopper's profile token, from auth/start, auth/verify or any call that made a profile. Optional here.
Request body
application/jsonrequiredThe shopper's email. Compared in lower case.
Response
token is present only when this call made the profile.Always true.
The email as it was read, in lower case.
Only when no token was sent and a profile was made for the code. Keep it and send it to auth/verify.
Errors
26Every 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.
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.
That does not look like an email address.email is missing or not an email address.
Too many codes asked for. Try again in an hour.This email has been sent 5 codes, or this profile has asked for 8, in the last hour.
Codes cannot be sent yet.The code email is not set up on the server.
curl -X POST "https://stylor.ai/api/v1/shoppers/auth/code" \
-H "Authorization: Bearer $STYLOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'{
"sent": true,
"email": "[email protected]"
}