Skip to main content
Sign a diner in to use their points, addresses and past orders. Diners can still order as guests. The Accounts API uses the same X-Channel-Id and X-Session-Id headers as the Storefront API.
Sequence: your app calls POST /accounts/v1/request_otp, or POST /accounts/v1/signup if that returns 404. Atlas sends the diner a login code by WhatsApp or email. The diner enters the code, your app calls POST /accounts/v1/login, gets a new X-Session-Id, and uses it to call as the diner, such as PUT /cart/points.

Sign-in flow. The green step is only for a diner with no Atlas account.

Sign in a diner who has an account

1

Request a login code

Call Request login code with the diner’s mobile number.
last_otp_delivery_mode in the response says where the code went: whatsapp or email. Tell the diner where to look.A new code replaces the last one, so only the latest code works. A number or email can get 5 codes in 10 minutes.
2

Log in with the code

Call Log in with the same mobile number and the 6-digit code.
After 5 wrong codes, log in stops working until the diner requests a new code.Save the new X-Session-Id from the response headers and send it from now on. The old one stops working. The diner’s cart moves to the new session, ready for Toggle points.

Sign up a new diner

If Request login code returns 404, the diner has no Atlas account yet. A diner who already has one, from any Atlas merchant, gets a code straight away and can log in.
  1. Call Sign up with their name, email and mobile number. It sends them a login code.
  2. Call Log in with that code.
The diner joins the merchant’s point program when they log in for the first time.

Points belong to the merchant

Each merchant has its own point program, so a diner’s balance differs between merchants.

Sign a diner out

Delete the saved X-Session-Id and call GET /storefronts/v1/channel without one. On shared devices such as kiosks, do this after every order.

If it doesn’t work

  • 422 Please wait: a code was sent less than 30 seconds ago. Wait, then try again.
  • 429 Too many codes requested: this number or email has had 5 codes in 10 minutes. Wait 10 minutes.
  • 429 Too many wrong codes: 5 wrong codes were tried. Request a new code.
  • 422 User Exists from Sign up: log the diner in instead.
  • 422 otp is incorrect: wrong or expired code. Request a new one.
  • 401 session_id: use the session ID from the login response.
  • 401 login: no diner is signed in. Sign them in first.
  • 403 mobile_number: the number isn’t verified. Sign in with a code to verify it.