Skip to content

logout-from-pos-device

Method: POST
Path: /pos/auth/logout

Tags: POS

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"];
        };
    };

Component References

ReferenceResolves To
components["responses"]["Unauthorized"]Unauthorized

Responses

200

OK

401

Not authorized for given operation on the Resource

OpenAPI Definition

json
{
  "tags": [
    "POS"
  ],
  "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.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/logout-from-pos-device",
    "description": "API reference for the logout-from-pos-device operation"
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "verifyOtp"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: