authenticate-direct-otp
Method: POST
Path: /payments/authenticate-direct-otp
Tags: Payments
Summary
Authenticate direct OTP
Description
Authenticate direct OTP
Storefront SDK Usage
SDK Method: sdk.payments.authenticateDirectOtp()
Example:
typescript
// After creating an order, if OTP authentication is required:
const { data, error } = await sdk.payments.authenticateDirectOtp({
txn_id: "txn_01H9XYZ12345ABCDE",
challenge_id: "challenge_01H9XYZ12345ABCDE",
otp: "123456"
});
if (error) {
console.error("OTP authentication failed:", error.message);
} else {
console.log("Authentication success:", data.success);
console.log("Message:", data.message);
}TypeScript Definition
typescript
"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;
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
};
};Component References
| Reference | Resolves To |
|---|---|
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": [
"Payments"
],
"operationId": "authenticate-direct-otp",
"summary": "Authenticate direct OTP",
"description": "Authenticate direct OTP",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/authenticate-direct-otp",
"description": "API reference for the authenticate-direct-otp operation"
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"txn_id",
"challenge_id",
"otp"
],
"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"
},
"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"
},
"otp": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "payments",
"x-speakeasy-ignore": true,
"x-speakeasy-name-override": "authenticateDirectOtp"
}Auto-generated from OpenAPI spec and TypeScript definitions