login-pos-device-with-email
Method: POST
Path: /pos/auth/login/email
Tags: POS
Summary
Login with email
Description
Login to POS device using email. Login to POS device using phone. The endpoint requires authentication with an API key that has the scope set to 'storefront' for a particular store, ensuring secure access for user login operation.
Pos SDK Usage
SDK Method: pos.loginWithEmail()
Example:
typescript
const { data, error } = await pos.loginWithEmail({
location_id: "pos-location-123",
email: "staff@example.com"
});
if (error) {
console.error("Login failed:", error.message);
} else {
console.log("OTP sent:", data.otp_token);
console.log("Action:", data.otp_action);
// Use the otp_token to verify OTP
}TypeScript Definition
typescript
"login-pos-device-with-email": {
parameters: {
query?: never;
header?: {
/** @description This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes. */
"x-debug-mode"?: components["parameters"]["DebugMode"];
};
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
location_id: string;
email: string;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
otp_token: string;
/** @constant */
otp_action: "login";
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["parameters"]["DebugMode"] | DebugMode |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
Parameters
- x-debug-mode (header): This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Not authorized for given operation on the Resource
OpenAPI Definition
json
{
"tags": [
"POS"
],
"operationId": "login-pos-device-with-email",
"summary": "Login with email",
"description": "Login to POS device using email. Login to POS device using phone. The endpoint requires authentication with an API key that has the scope set to 'storefront' for a particular store, ensuring secure access for user login operation.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/login-pos-device-with-email",
"description": "API reference for the login-pos-device-with-email operation"
},
"parameters": [
{
"$ref": "#/components/parameters/DebugMode"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"location_id",
"email"
],
"properties": {
"location_id": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"otp_token": {
"type": "string"
},
"otp_action": {
"type": "string",
"const": "login"
}
},
"required": [
"otp_token",
"otp_action"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
}
},
"security": [
{
"X-Api-Key": []
}
],
"x-speakeasy-group": "pos",
"x-speakeasy-ignore": true,
"x-speakeasy-name-override": "loginWithEmail"
}Auto-generated from OpenAPI spec and TypeScript definitions