Login user
POST
/login
const url = 'https://myshop.com/shopgate/v1/login';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"login":"example","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://myshop.com/shopgate/v1/login \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "login": "example", "password": "example" }'Makes an attempt to log in the user. The user can choose between multiple login strategies. A strategy can be ‘basic’ or ‘facebook’ login. After login, the user storage becomes available to store data in a shop-global scope, so it can be shared across devices. Based on the shop, custom errors can be returned to react to in the theme. Calling this pipeline when a user is logged in results in an error.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”The response contains the shopping carts system’s user ID for authentication on the Shopgate Connect side.
object
login
required
string
password
required
string
Examplegenerated
{ "login": "example", "password": "example"}object
login
required
string
password
required
string
Examplegenerated
login=example&password=exampleResponses
Section titled “Responses”Media typeapplication/json
object
userId
required
string
Example
{ "userId": "c069f5a4-94b7-11e8-9eb6-529269fb1459"}The login fails because of wrong credentials.
Media typeapplication/json
object
message
string
Example
{ "message": "wrong credentials"}
