Skip to main content
POST
/
orders
/
pay
/
authenticate
/
{cf_payment_id}
Submit or Resend OTP
curl --request POST \
  --url https://sandbox.cashfree.com/pg/orders/pay/authenticate/{cf_payment_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-version: <x-api-version>' \
  --data '
{
  "otp": "111000",
  "action": "SUBMIT_OTP"
}
'
{
  "action": "SUBMIT_OTP",
  "authenticate_status": "SUCCESS",
  "cf_payment_id": "3991872901",
  "payment_message": "payment successful"
}
Refer to the sample responses below:
Submit OTP Success and Transaction Successful – 200 OK
{
  "action": "SUBMIT_OTP",
  "authenticate_status": "SUCCESS",
  "cf_payment_id": "3991872901",
  "payment_message": "payment successful"
}
Submit OTP Success but Invalid OTP – 200 OK
{
  "action": "SUBMIT_OTP",
  "authenticate_status": "FAILED",
  "cf_payment_id": "5114916442998",
  "payment_message": "otp is invalid"
}
Max OTP Submit Limit Exceeded – 400 Bad Request
{
  "message": "Exceeded retry attempts. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
  "code": "request_invalid",
  "type": "invalid_request_error"
}
Transaction Already Completed – 400 Bad Request
{
  "message": "Transaction is already processed. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
  "code": "request_invalid",
  "type": "invalid_request_error"
}
Invalid Request – 404 Not Found
{
  "message": "transaction not found. Check latest errors and resolution from Merchant Dashboard API logs: https://bit.ly/4glEd0W Help Document: https://bit.ly/4eeZYO9",
  "code": "payment_not_found",
  "type": "invalid_request_error"
}
Submit OTP Success but Transaction Failed – 502 Bad Gateway
{
  "message": "transaction failed",
  "code": "bank_processing_failure",
  "type": "api_error"
}
Submit OTP Success but Transaction Pending – 502 Bad Gateway
{
  "message": "transaction incomplete",
  "code": "bank_processing_failure",
  "type": "api_error"
}
Resend OTP Success – 200 OK
{
  "action": "RESEND_OTP",
  "authenticate_status": "SUCCESS",
  "cf_payment_id": "5114916574918",
  "payment_message": "otp sent successfully"
}

Headers

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

API version to be used

x-request-id
string

Request ID for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to Cashfree.

x-idempotency-key
string<UUID>

An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions.

Path Parameters

cf_payment_id
string
required

The Cashfree payment or transaction ID.

Body

application/json

Request body to submit or resend OTP in Native OTP flow.

To use this API, Native OTP needs to be enabled for your account.

action
enum<string>
required

Action intended for this request - can be SUBMIT_OTP or RESEND_OTP.

Available options:
SUBMIT_OTP,
RESEND_OTP
otp
string

OTP collected from the customer. Mandatory only when action is SUBMIT_OTP.

Response

Success response for submitting or resending OTP.

Success response for submitting or resending OTP.

cf_payment_id
string

Cashfree payment ID for which this request was sent.

action
enum<string>

The action that was requested.

Available options:
SUBMIT_OTP,
RESEND_OTP
authenticate_status
enum<string>

Status of this action - will be either success or failed. If the action is success, you should still call payment status API to verify the final payment status.

Available options:
FAILED,
SUCCESS
payment_message
string

Human readable message which describes the status in more detail.