Generate OTP for Card Payment Authentication
POST
/api/pay/v1/otp/generateGenerate 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
| Field | Details |
|---|---|
Request-Timestampstringdate-time | ISO 8601 UTC timestamp of the request. Used for idempotency and audit. |
Request-IDstring | Use a global unique identifier [GUID] for the request. Constraints Minimum length: 1 characterMaximum length: 50 characters |
Request Bodyrequired
| Field | Details |
|---|---|
payment_idstringrequired | Unique identifier of the payment requiring OTP verification. |
Response
| Field | Details |
|---|---|
nextstring[] | Available next actions. Constraints Allowed item values: SUBMIT_OTPRESEND_OTPNONE |
meta_dataobject1 nested field | Additional metadata for OTP handling. |
resend_afterstring | Minimum wait time in seconds before OTP can be resent. |
Status Codes
200 | OTP generated successfully. |
400 | The request was malformed or missing required fields. |
422 | Unprocessable entity — payment not eligible for OTP generation. |
500 | An unexpected error occurred on the server. |
503 | Service temporarily unavailable. |
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"
}
}