Check Authentication Method
This API must be implemented by NIUM's client as part of Strong Customer Authentication (SCA) for e-commerce transactions. NIUM will invoke this API to fetch configuration details during e-commerce transaction authentication.
POST https://<EComAuthCodeValidationBaseURL>/preference
NOTE
EComAuthCodeValidationBaseURL
is the URL provided by client during setup which will be used by NIUM as a base URL.
Headers
Header | Parameters |
---|---|
content-type | application/JSON |
x-request-id | UUID |
x-client-name | String |
curl -X POST \
https://<EComAuthCodeValidationBaseURL>/preference \
-H 'content-type: application/json' \
-H 'x-request-id: 123e4567-e89b-12d3-a456-426655440000' \
-H 'x-client-name: Cards-Customer-Service' \
-d '{
"clientHashId": "e4wc6a3b-52a0-2301-a670-08db16e8447a",
"customerHashId": "df3dfdf-d75a-4d7e-b575-f8ed34egfh94",
"cardHashId": "5fh34flg-8e7a-4bb5-a010-3a07cf714534",
"email": "[email protected]",
"phoneNumber": "9834201949"
}'
kHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"clientHashId\": \"e4wc6a3b-52a0-2301-a670-08db16e8447a\",\r\n \"customerHashId\": \"df3dfdf-d75a-4d7e-b575-f8ed34egfh94\",\r\n \"cardHashId\": \"5fh34flg-8e7a-4bb5-a010-3a07cf714534\",\r\n \"email\": \"[email protected]\",\r\n \"phoneNumber\": \"9834201949\"\r\n}");
Request request = new Request.Builder()
.url("https://<EComAuthCodeValidationBaseURL>/preference")
.post(body)
.addHeader("content-type", "application/json")
.addHeader("x-request-id", "123e4567-e89b-12d3-a456-426655440000")
.addHeader("x-client-name", "Cards-Customer-Service")
.build();
Response response = client.newCall(request).execute();
var settings = {
"https://<EComAuthCodeValidationBaseURL>/preference",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"x-request-id": "123e4567-e89b-12d3-a456-426655440000",
"x-client-name": "Cards-Customer-Service"
},
"data": JSON.stringify({
"clientHashId": "e4wc6a3b-52a0-2301-a670-08db16e8447a",
"customerHashId": "df3dfdf-d75a-4d7e-b575-f8ed34egfh94",
"cardHashId": "5fh34flg-8e7a-4bb5-a010-3a07cf714534",
"email": "[email protected]",
"phoneNumber": "9834201949"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import requests
url = "https://<EComAuthCodeValidationBaseURL>/preference"
payload = json.dumps({
"clientHashId": "e4wc6a3b-52a0-2301-a670-08db16e8447a",
"customerHashId": "df3dfdf-d75a-4d7e-b575-f8ed34egfh94",
"cardHashId": "5fh34flg-8e7a-4bb5-a010-3a07cf714534",
"email": "[email protected]",
"phoneNumber": "9834201949"
})
headers = {
'content-type': "application/json",
'x-request-id': "123e4567-e89b-12d3-a456-426655440000",
'x-client-name': "Cards-Customer-Service"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
Request Body
Field | Description | Type | Required |
---|---|---|---|
clientHashId | Unique client identifier generated and shared before API handshake. | UUID | Required |
customerHashId | Unique customer identifier generated on customer creation. | UUID | Required |
cardHashId | Unique card identifier generated while new/add-on card issuance. | UUID | Required |
email | This field accepts the customer’s email ID. | String | Required |
phoneNumber | This field accepts the customer’s phone number. | String | Required |
Example Response
Success Response - For OOB only
{
"respCode" : "00",
"message" : "OOB Only"
}
Success Response - For OOB with fall back to OTP (SMS) + Passcode
{
"respCode" : "01",
"message" : "OOB with fallback to OTP+Passcode"
}
Success Response - For OTP (SMS) + Passcode only:
{
"respCode" : "02",
"message" : "OTP+Passcode Only"
}
Response Body
Field | Description | Type |
---|---|---|
respCode | The response code. Possible values are: • 00 - If OOB is the only authentication method supported. • 01 - If OOB with fallback option (OTP+Passcode) method is supported. • 02 - If OTP+Passcode is the only supported method. | String |
message | The message based on preferences. Possible values are: • OOB Only - Only OOB authentication method is supported. • OOB with fallback to OTP+Passcode - If OOB with fallback option (OTP+Passcode) method is supported. • OTP+Passcode Only - If only OTP+Passcode method is supported. | String |
Updated 4 days ago