logout-from-pos-device
Method: POST
Path: /pos/auth/logout
Tags: Authentication
Summary
Logout
Description
This endpoint ends the current loggedin session for the POS device. This action immediately invalidates the previously issued access token(s), preventing any further use. A new login is required to regain access.
Pos SDK Usage
SDK Method: pos.logout()
Example:
typescript
const { data, error } = await pos.logout();
if (error) {
console.error("Logout failed:", error.message);
} else {
console.log("Logout message:", data.message);
console.log("Success:", data.success);
// Tokens are automatically cleared by the SDK
}TypeScript Definition
typescript
"logout-from-pos-device": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
message: string;
success: boolean;
};
};
};
401: components["responses"]["Unauthorized"];
403: components["responses"]["Forbidden"];
500: components["responses"]["InternalServerError"];
504: components["responses"]["GatewayTimeout"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["Forbidden"] | Forbidden |
components["responses"]["InternalServerError"] | InternalServerError |
components["responses"]["GatewayTimeout"] | GatewayTimeout |
Responses
200
OK
401
Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.
403
Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.
500
The request failed because of an unexpected error.
504
The request timed out.
OpenAPI Definition
json
{
"operationId": "logout-from-pos-device",
"summary": "Logout",
"description": "This endpoint ends the current loggedin session for the POS device. This action immediately invalidates the previously issued access token(s), preventing any further use. A new login is required to regain access.",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
},
"required": [
"message",
"success"
]
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/GatewayTimeout"
}
},
"externalDocs": {
"url": "https://llm-docs.commercengine.io/admin-pos/operations/logout-from-pos-device"
},
"security": [
{
"Authorization": []
}
],
"tags": [
"Authentication"
],
"x-speakeasy-group": "pos",
"x-speakeasy-name-override": "logout"
}Auto-generated from OpenAPI spec and TypeScript definitions