Skip to main content
POST
/
ppi
/
otp
/
generate
Generate OTP
curl --request POST \
  --url https://api.cashfree.com/ppi/otp/generate \
  --header 'Content-Type: application/json' \
  --header 'x-api-version: <x-api-version>' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --data '
{
  "otp_verification_id": "Test123",
  "user_id": "USER827364",
  "notification_modes": [
    "SMS",
    "WHATSAPP"
  ]
}
'
{
"otp_verification_id": "Test123",
"cf_otp_verification_id": "8901234567890123456",
"status": "OTP_GENERATED",
"user_id": "USER827364",
"notification_modes": [
"SMS",
"WHATSAPP"
]
}

Authorizations

x-client-id
string
header
required

Your unique client identifier issued by Cashfree.

x-client-secret
string
header
required

The secret key associated with your client ID.

Headers

x-api-version
string
default:2025-11-01
required

API version to be used. Format is in YYYY-MM-DD.

Example:

"2025-11-01"

Body

application/json
otp_verification_id
string
required

Unique identifier that you create to identify the OTP verification request in your system. Maximum 50 characters. Only alphanumeric characters, periods (.), hyphens (-), and underscores (_) are allowed.

Required string length: 1 - 50
Example:

"Test123"

user_id
string
required

Unique identifier for the user, as provided by you during PPI user creation.

Required string length: 1 - 50
Example:

"USER827364"

notification_modes
enum<string>[]
required

Array of notification modes for OTP delivery. Supported modes are SMS and WHATSAPP.

Minimum array length: 1
Available options:
SMS,
WHATSAPP
Example:
["SMS", "WHATSAPP"]

Response

OTP sent successfully.

otp_verification_id
string

Unique identifier for the OTP verification request, as provided by you during the request.

Example:

"Test123"

cf_otp_verification_id
string

Unique identifier for the OTP verification request, generated by Cashfree.

Example:

"8901234567890123456"

status
enum<string>

Status of the OTP generation process.

Available options:
OTP_GENERATED,
FAILED
Example:

"OTP_GENERATED"

user_id
string

Unique identifier for the user, as provided by you during PPI user creation.

Example:

"USER827364"

notification_modes
enum<string>[]

Array of notification modes used for OTP delivery.

Available options:
SMS,
WHATSAPP
Example:
["SMS", "WHATSAPP"]