Skip to content

pos-authenticate-direct-otp ​

Method: POST
Path: /pos/payments/authenticate-direct-otp

Tags: Payments

Summary ​

Authenticate direct OTP

Pos SDK Usage ​

SDK Method: pos.authenticateDirectOtp()

Example:

typescript
const { data, error } = await pos.authenticateDirectOtp({
  txn_id: "txn_123",
  challenge_id: "challenge_123",
  otp: "123456"
});

if (error) {
  console.error("OTP authentication failed:", error.message);
}

TypeScript Definition ​

typescript
"pos-authenticate-direct-otp": {
        parameters: {
            query?: never;
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody: {
            content: {
                "application/json": {
                    /** @description You can get the txn_id from the response of create order API under the payment object inside the payment_info object. The key is 'id' under the params object inside the authentication object. */
                    txn_id: string;
                    /** @description You can get the challenge_id from the response of create order API under the payment object inside the payment_info object. The key is 'challenge_id' under the params object inside the authentication object. */
                    challenge_id: string;
                    otp: string;
                };
            };
        };
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                    };
                };
            };
            /** @description The payment input or authentication attempt is invalid. */
            400: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        code: string;
                        errors?: Record<string, never>;
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            408: components["responses"]["RequestTimeout"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["RequestTimeout"]RequestTimeout
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Request Body ​

Content Types: application/json

Responses ​

200 ​

OK

400 ​

The payment input or authentication attempt is invalid.

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.

408 ​

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-authenticate-direct-otp",
  "summary": "Authenticate direct OTP",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "txn_id": {
              "description": "You can get the txn_id from the response of create order API under the payment object inside the payment_info object. The key is 'id' under the params object inside the authentication object.",
              "type": "string",
              "maxLength": 256,
              "minLength": 1,
              "pattern": "\\S"
            },
            "challenge_id": {
              "description": "You can get the challenge_id from the response of create order API under the payment object inside the payment_info object. The key is 'challenge_id' under the params object inside the authentication object.",
              "type": "string",
              "maxLength": 256,
              "minLength": 1,
              "pattern": "\\S"
            },
            "otp": {
              "type": "string",
              "maxLength": 6,
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "required": [
            "txn_id",
            "challenge_id",
            "otp"
          ]
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              }
            },
            "required": [
              "message",
              "success"
            ]
          }
        }
      }
    },
    "400": {
      "description": "The payment input or authentication attempt is invalid.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "x-speakeasy-error-message": true
              },
              "success": {
                "type": "boolean"
              },
              "code": {
                "type": "string"
              },
              "errors": {
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "code"
            ]
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "408": {
      "$ref": "#/components/responses/RequestTimeout"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-authenticate-direct-otp"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Payments"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-name-override": "authenticateDirectOtp"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: