> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate OTP

> Generate one-time password for transaction verification.

## Generate OTP

The API call generates a new one-time password (OTP) for redeeming or holding loyalty points and sends it via SMS. This service ensuring that only authorized transactions can be completed with the provided OTP.

<Warning>
  This API is effective only if SMS & OTP are enabled in your Gameball account. Contact support for more information.
</Warning>

<Note>
  **Channel Merging Available**
  If your system uses different customer IDs across multiple channels (e.g., online and offline), Gameball's channel merging feature helps unify customer profiles. By including the customer's mobile number or email (based on your merging configuration) with each request, Gameball will combine activities into a single profile.

  For more information, head to the [Omni-Channel Handling Guide](/tutorials/experiences/more/omni-channel).
</Note>

<Info>
  **Security:** Provide both apikey and secretkey headers.
</Info>


## OpenAPI

````yaml POST /api/v4.0/integrations/transactions/otp
openapi: 3.1.0
info:
  title: Gameball API
  description: >-
    Gameball REST API v4.0 - Complete API reference for integrating loyalty,
    gamification, and customer engagement features
  version: 4.0.0
servers:
  - url: https://api.gameball.co
security:
  - bearerAuth: []
paths:
  /api/v4.0/integrations/transactions/otp:
    post:
      description: >-
        The API call generates a new one-time password (OTP) for redeeming or
        holding loyalty points and sends it via SMS. This service ensuring that
        only authorized transactions can be completed with the provided OTP.
        This API is effective only if SMS & OTP are enabled in your Gameball
        account.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customerId
              properties:
                customerId:
                  type: string
                  description: >-
                    Unique identifier for the customer that you can reference
                    across the customer's whole lifetime. Could be a database
                    ID, random string, email, or anything that uniquely
                    identifies the customer.
                  example: cust_abc12345xyz67890
                email:
                  type: string
                  description: >-
                    Customer's email address. This is required if your account
                    uses email-based channel merging.
                  example: alex.jones@example.com
                mobile:
                  type: string
                  description: >-
                    Customer's mobile number. This is required if your account
                    uses mobile-based channel merging.
                  example: '+1234567890'
                amount:
                  type: number
                  description: >-
                    The monetary value associated with the redemption or hold
                    operation for which the OTP is being generated. This allows
                    you to secure specific financial transactions by tying the
                    OTP to an exact amount. Note: Only one of ruleId, points, or
                    amount must be provided for the OTP request to proceed.
                  example: 100
                points:
                  type: integer
                  description: >-
                    The number of loyalty points for which the OTP is being
                    generated. This allows the customer to redeem or hold a
                    specific quantity of points, adding an extra layer of
                    security to the transaction. Note: Only one of ruleId,
                    points, or amount must be provided for the OTP request to
                    proceed.
                  example: null
                ruleId:
                  type: integer
                  description: >-
                    The ID of a redemption rule configured within Gameball's
                    system that the customer wants to use. Clients can create
                    custom redemption rules through the Gameball dashboard to
                    specify different redemption options. For example, a
                    redemption rule may allow points to be redeemed for a free
                    product, free shipping, percentage-based discounts, or
                    fixed-amount discounts. You can retrieve your configured
                    redemption rules and their associated IDs by using the
                    Redemption Configuration API. Note: Only one of ruleId,
                    points, or amount must be provided for the OTP request to
                    proceed.
                  example: null
      security:
        - apiKey: []
          secretKey: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: apikey
    secretKey:
      type: apiKey
      in: header
      name: secretkey

````