verify-pos-login-otp
Method: POST
Path: /pos/auth/verify-otp
Tags: POS
Summary
Verify OTP
Description
Verify POS login otp. 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.
Pos SDK Usage
SDK Method: pos.verifyOtp()
Example:
typescript
const { data, error } = await pos.verifyOtp({
otp_token: "otp-token-from-login",
otp: "123456",
otp_action: "login"
});
if (error) {
console.error("OTP verification failed:", error.message);
} else {
console.log("Login successful:", data.user);
console.log("Access token:", data.access_token);
console.log("Refresh token:", data.refresh_token);
// Tokens are automatically stored by the SDK
}TypeScript Definition
typescript
"verify-pos-login-otp": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description A string representing the one-time password. */
otp: string;
/** @description A string representing the OTP token. */
otp_token: string;
/**
* @description A string indicating the action to be performed.
* @enum {unknown}
*/
otp_action: "login";
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
content: {
user: components["schemas"]["PosUser"];
access_token: string;
refresh_token: string;
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["schemas"]["PosUser"] | PosUser |
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
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": "verify-pos-login-otp",
"summary": "Verify OTP",
"description": "Verify POS login otp. 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.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/verify-pos-login-otp",
"description": "API reference for the verify-pos-login-otp operation"
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"otp",
"otp_token",
"otp_action"
],
"properties": {
"otp": {
"description": "A string representing the one-time password.",
"type": "string"
},
"otp_token": {
"description": "A string representing the OTP token.",
"type": "string"
},
"otp_action": {
"description": "A string indicating the action to be performed.",
"enum": [
"login"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
},
"content": {
"properties": {
"user": {
"$ref": "#/components/schemas/PosUser"
},
"access_token": {
"type": "string"
},
"refresh_token": {
"type": "string"
}
},
"required": [
"user",
"access_token",
"refresh_token"
],
"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": "verifyOtp"
}Auto-generated from OpenAPI spec and TypeScript definitions