POST:auth/login.json
Commerce APIPOST:auth/login.json

POST:auth/login.json

Description

Given email and a password, retrieve a JWT (json web token) that gives you access to restricted API endpoints.

If user enabled two-factor authorization, an attempt to login without two_factor_code set (and given that email and password are correct) will return a response with empty token field and two_factor_enabled field set to true. Implying that you should display additional UI and ask for two_factor_code. Once you provide all three fields (email, password and two_factor_code) and they are valid, the API will return you a proper JWT.

See also: Authentication.

Topic: Auth

Request Body

UserLogin

{
  "email": "no+spam@mail.com",
  "fingerprint": "",
  "oauth_code": "",
  "oauth_provider": "github",
  "oauth_session_id": "",
  "password": "34hb5kj3h45k3",
  "timezone_hint": "(GMT-05:00) Eastern Time",
  "tos_agree": true,
  "trusted": true,
  "two_factor_code": "545346",
  "webauthn_credential": "",
  "webauthn_session_id": ""
}

Response Body

TokenAndUserID

Response Body Type

Loading module