Pine LabsDOCS

Generate OTP for Card Payment Authentication

POST/api/pay/v1/otp/generate

Generate a One-Time Password (OTP) for card payment authentication. This API is called after a card payment is created and the card requires OTP-based verification (native OTP flow).

Requires Bearer token. Get token →

Header Parameters

FieldDetails
Request-Timestamp
stringdate-time

ISO 8601 UTC timestamp of the request. Used for idempotency and audit.

Request-ID
string

Use a global unique identifier [GUID] for the request.

Constraints
Minimum length: 1 characterMaximum length: 50 characters

Request Bodyrequired

FieldDetails
payment_id
stringrequired

Unique identifier of the payment requiring OTP verification.

Response

FieldDetails
next
string[]

Available next actions.

Constraints
Allowed item values:
SUBMIT_OTPRESEND_OTPNONE
meta_data
object1 nested field

Additional metadata for OTP handling.

resend_after
string

Minimum wait time in seconds before OTP can be resent.

Status Codes

200OTP generated successfully.
400The request was malformed or missing required fields.
422Unprocessable entity — payment not eligible for OTP generation.
500An unexpected error occurred on the server.
503Service temporarily unavailable.
Run
Request
curl --request POST \
  --url https://pluraluat.v2.pinepg.in/api/pay/v1/otp/generate \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --header 'Request-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
  --header 'Request-Timestamp: 2024-10-01T10:30:00Z' \
  --data '{
  "payment_id": "v1-5757575757-aa-hU1rUd-cc-l"
}'
{
  "next": [
    "SUBMIT_OTP",
    "RESEND_OTP"
  ],
  "meta_data": {
    "resend_after": "180"
  }
}