Auth
Storefront Auth API endpoints
An API call to login customer.
Request body
emailRequiredstringpasswordRequiredstringReturnsAccessToken
Access token object response
Error responses
422objectemail is missing or not a valid email, password is missing, or the email and password do not match an account ('These credentials do not match our records.' on email).
An API call to login customer by otp.
Request body
emailRequiredstringFormat: email.
tokenRequiredstringReturnsAccessToken
Access token object response
Error responses
422objectemail is missing or not a valid email, token is missing, or the code is wrong, expired (after 10 minutes) or was requested from another IP address or browser ('These credentials do not match our records.' on email).
An API call to generate otp.
Request body
emailRequiredstringFormat: email.
Returnsstring
Returns 200 with an empty body. An email with no account gets the same response, and no OTP is sent.
Error responses
422objectemail is missing or not a valid email.
429objectMore than 10 codes were requested in one hour from the same IP address and browser.
An API call to login customer by social.
Request body
tokenRequiredstringproviderRequiredstringPossible values: google, facebook.
ReturnsAccessToken
Access token object response
Error responses
401objectThe provider rejects the token, or no account uses the email the provider returns.
422objecttoken is missing or not a string, or provider is missing or not google or facebook.
The API call to check if email already exists.
Request body
emailRequiredstringReturnsRegistered
Registered object response
registeredbooleanError responses
400objectThe request carries a valid customer token. Only guests can call this endpoint.
422objectemail is missing or not a valid email.
An API call to register customer.
Request body
emailRequiredstringfirst_nameRequiredstringlast_nameRequiredstringpasswordoptionalstringThe password the customer chose. Without it, the customer gets a generated password by email.
ReturnsAccessToken
Access token object response
Error responses
422objectemail is missing, is not a valid email, or already belongs to an account ('The email has already been taken.'), first_name or last_name is missing or not a string, or password is not a string or is shorter than 8 characters.
429objectThe registration rate limit is reached: 5 per day from one IP address and browser when the shop has a live gateway, else 10 per day for the shop.