> ## Documentation Index
> Fetch the complete documentation index at: https://help-loyalife.xoxoday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate OTP

> Send an OTP to a member's registered channel using their email address.

Triggers an OTP to be sent to a member's registered delivery channel (SMS or email, as configured for your program), identified by their email address. Use this for login, password reset, account activation, or two-factor authentication flows. The `OtpType` parameter controls which template and expiry rules apply. If you have the member's `RelationReference` (CID) rather than their email, the preferred flow is [Generate OTP by Relation Reference](/api-reference/otp/generate-otp-by-relation).

## OtpType Values

| Value                          | Use Case                                    |
| ------------------------------ | ------------------------------------------- |
| `ACTIVATION`                   | Account activation after registration       |
| `LOGIN`                        | Member login via OTP                        |
| `FORGOTPWD`                    | Forgot password — initiate reset            |
| `CHANGEPASSWORD`               | Change password (member is logged in)       |
| `RESETPASSWORD`                | Reset password (admin-triggered)            |
| `FORGOTUSERNAME`               | Forgot username recovery                    |
| `TwoFA`                        | Two-factor authentication                   |
| `UNBLOCKMEMBER`                | Unblock a locked member account             |
| `NONE`                         | No specific type                            |
| `CASHBACKCONFIRM`              | Cashback transaction confirmation           |
| `POINTTRANSFERCONFIRM`         | Points transfer confirmation                |
| `FAMILYPOOLINGMERGE`           | Family pooling account merge confirmation   |
| `FAMILYPOOLINGUNMERGE`         | Family pooling account unmerge confirmation |
| `AIRREVIEWNCONFIRM`            | Air booking review confirmation             |
| `DOMESTICFLIGHTREVIEWNCONFIRM` | Domestic flight booking confirmation        |
| `HOTELREVIEWNCONFIRM`          | Hotel booking review confirmation           |
| `CARREVIEWNCONFIRM`            | Car booking review confirmation             |
| `GIFTCARDREVIEWNCONFIRM`       | Gift card review confirmation               |
| `PACKAGEREVIEWNCONFIRM`        | Package booking review confirmation         |
| `SHOPREVIEWNCONFIRM`           | Shop purchase review confirmation           |
| `SHOPDIGITALREVIEWNCONFIRM`    | Digital shop review confirmation            |
| `MERCHANTREVIEWNCONFIRM`       | Merchant review confirmation                |
| `ISPREVIEWNCONFIRM`            | ISP review confirmation                     |
| `INSURANCEREVIEWNCONFIRM`      | Insurance review confirmation               |

<Note>
  OTP delivery channel (email or SMS), expiry duration, and maximum attempt limits are all **configurable at the program level** in Loyalife Admin. Confirm these values with your Xoxoday implementation contact so your UI timers and lockout handling match the actual configuration.
</Note>

## Responses

<AccordionGroup>
  <Accordion title="200 — Success">
    | Path                       | Type    | Description             |
    | -------------------------- | ------- | ----------------------- |
    | `results.IsSucessful`      | boolean | `true`                  |
    | `results.ErrorCode`        | string  | `000`                   |
    | `results.ExceptionMessage` | string  | `Success`               |
    | `results.ReturnObject`     | boolean | `true` when OTP is sent |
    | `results.Count`            | integer | Always `0`              |
  </Accordion>
</AccordionGroup>

After a successful response, verify the OTP with [Verify OTP](/api-reference/otp/verify-otp).


## OpenAPI

````yaml POST /lbms-ingress/member/api/Member/GenerateOTP
openapi: 3.1.0
info:
  title: Loyalife LBMS API
  description: >-
    REST API for Loyalife's Loyalty Management System. Covers member management,
    OTP authentication, loyalty transactions, and points redemption.
  version: 1.0.0
  contact:
    name: Xoxoday Support
    email: support@xoxoday.com
servers:
  - url: https://loyalife-api.xoxoday.in
    description: Production
security:
  - bearerAuth: []
paths:
  /lbms-ingress/member/api/Member/GenerateOTP:
    post:
      tags:
        - OTP
      summary: Generate OTP
      description: Send an OTP to a member using their email address.
      operationId: generateOtp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - UniquerefID
                - SourceAddress
                - SourceCode
                - OtpType
                - ProgramId
                - RelationType
              properties:
                UniquerefID:
                  type: string
                  description: The member's email address
                  example: jane.doe@example.com
                SourceAddress:
                  type: string
                  description: IP address of the requesting system
                  example: 192.168.1.1
                SourceCode:
                  type: integer
                  description: 'Origin: 1=Web, 2=Mobile, 3=Email, 4=Service'
                  enum:
                    - 1
                    - 2
                    - 3
                    - 4
                  example: 1
                OtpType:
                  $ref: '#/components/schemas/OtpType'
                  enum:
                    - ACTIVATION
                    - LOGIN
                    - FORGOTPWD
                    - CHANGEPASSWORD
                    - RESETPASSWORD
                    - FORGOTUSERNAME
                    - TwoFA
                    - UNBLOCKMEMBER
                    - NONE
                    - CASHBACKCONFIRM
                    - POINTTRANSFERCONFIRM
                    - FAMILYPOOLINGMERGE
                    - FAMILYPOOLINGUNMERGE
                    - AIRREVIEWNCONFIRM
                    - DOMESTICFLIGHTREVIEWNCONFIRM
                    - HOTELREVIEWNCONFIRM
                    - CARREVIEWNCONFIRM
                    - GIFTCARDREVIEWNCONFIRM
                    - PACKAGEREVIEWNCONFIRM
                    - SHOPREVIEWNCONFIRM
                    - SHOPDIGITALREVIEWNCONFIRM
                    - MERCHANTREVIEWNCONFIRM
                    - ISPREVIEWNCONFIRM
                    - INSURANCEREVIEWNCONFIRM
                  description: >-
                    Purpose of the OTP. Must match between Generate and Verify
                    calls.
                  example: LOGIN
                ProgramId:
                  type: integer
                  example: 19
                RelationType:
                  type: integer
                  description: Use `4` for customers
                  example: 4
            example:
              UniquerefID: jane.doe@example.com
              SourceAddress: 192.168.1.1
              SourceCode: 1
              OtpType: FORGOTPWD
              ProgramId: 19
              RelationType: 4
      responses:
        '200':
          description: OTP sent
          content:
            application/json:
              example:
                results:
                  IsSucessful: true
                  ErrorCode: '000'
                  ExceptionMessage: Success
                  ReturnObject: true
                  Count: 0
components:
  schemas:
    OtpType:
      type: string
      enum:
        - LOGIN
        - FORGOTPWD
        - ACTIVATION
        - CHANGEPASSWORD
        - RESETPASSWORD
        - TwoFA
        - REGISTRATION
        - PROFILEUPDATE
      example: LOGIN
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT obtained from Generate Auth Token. Pass as `Authorization: bearer
        {token}`.

````