Getting 400 While Calling /vcpe/v2/pan/enrollment

mifapay
Helper

Getting 400 While Calling /vcpe/v2/pan/enrollment

I'm trying to reach https://sandbox.api.visa.com/vcpe/v2/pan/enrollment but I'm getting a 400 error with the message "Expected input credential was not present". I'm able to reach the helloworld endpoint so my certs should be correct. I'm also using MLE for my payload.
Here is the response:

{
	"responseStatus": {
		"status": 400,
		"code": "9125",
		"severity": "ERROR",
		"message": "Expected input credential was not present",
		"info": ""
	}
}

Code:

ng productID = "G";
String primaryAccountNumber = "xx01";
String referenceID = IdUtils.getRandomString(22);
String date = DateUtils.parseDateToStr("yyyyMMdd",DateUtils.getNowDate());
System.out.println("=======>> "+date+" referenceID:"+referenceID);

Enrollment enrollment = new Enrollment();
enrollment.setOperationType("UPDATE");
enrollment.setUpdateReferenceID(referenceID);
EnrollmentInfo enrollmentInfo = new EnrollmentInfo();

CardholderInfo cardholderInfo = new CardholderInfo();

cardholderInfo.setPrimaryAccountNumber(primaryAccountNumber);
enrollmentInfo.setCardholderInfo(cardholderInfo);

enrollment.setEnrollmentInfo(enrollmentInfo);

AccountLevelInfo accountLevelInfo = new AccountLevelInfo();
accountLevelInfo.setProductID(productID);

LinkEnrollment likeEnrollment = new LinkEnrollment();
Group group = new Group();
group.setAction("Add");
group.setGroupID("dnVgrLnzKICYNAM6PMBHbw");
group.setGroupType("LOC");
group.setIsPrimaryAccount("");
likeEnrollment.setGroup(Arrays.asList(group));
accountLevelInfo.setLinkEnrollment(likeEnrollment);

RpinEnrollment rpinEnrollment = new RpinEnrollment();
rpinEnrollment.setAccountOpenDate(date);
rpinEnrollment.setAction("Add");
rpinEnrollment.setRpin("123456");
rpinEnrollment.setRpinEffectiveDate(date);
rpinEnrollment.setRpinIssuerRefNumber("684226");
accountLevelInfo.setRpinEnrollment(rpinEnrollment);

//        ReplaceEnrollment replaceEnrollment = new ReplaceEnrollment();
//        replaceEnrollment.setLinkReasonCode("L");
//        replaceEnrollment.setUnlinkIndicator("");
//        replaceEnrollment.setOldAccountNumber("xx");
//        accountLevelInfo.setReplaceEnrollment(replaceEnrollment);

CustomerContactInfo customerContactInfo = new CustomerContactInfo();


Address address = new Address();
address.setZip("");
address.setCity("FC");
address.setLine1("123 main st");
address.setLine2("apt 1");
address.setState("CA");
address.setCompanyName("VISA TEST Inc");

customerContactInfo.setAction("Add");
customerContactInfo.setEmail("test001@adbc.com");
customerContactInfo.setAddress(address);
customerContactInfo.setLastName("Smith");
customerContactInfo.setFirstName("John");
customerContactInfo.setNamePrefix("Mr");
customerContactInfo.setNameSuffix("Sr");
customerContactInfo.setMobileNumber("1000012120");
customerContactInfo.setMiddleInitial("S");
customerContactInfo.setPrefMethodOfContact("M");

accountLevelInfo.setCustomerContactInfo(customerContactInfo);

enrollmentInfo.setAccountLevelInfo(accountLevelInfo);

enrollment.setEnrollmentInfo(enrollmentInfo);

String jsonBody = JSON.toJSONString(enrollment);

String url = "https://sandbox.api.visa.com/vcpe/v2/pan/enrollment";
Map<String,String> headers = new HashMap<>();
headers.put("Content-Type","application/json");
headers.put("Accept","application/json");
headers.put("X-Request-ID", enrollment.getUpdateReferenceID());
String res = VisaOkHttpUtils.postJSON(url, jsonBody, headers);
JSONObject resObject = JSONObject.parseObject(res);
JSONObject responseStatus = resObject.getJSONObject("responseStatus");
if (responseStatus.getInteger("code")==200){
    System.out.println(res);
}else{
    System.err.println(responseStatus.getString("message"));
}

 

 Request Header:

{
Accept=application/json, 
X-Request-ID=F6xd0YdOcFr2H0vMJZBsAk, 
Content-Type=application/json,
Authorization=Basic S1BHSk1UXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
}

Request Body:

{
	"enrollmentInfo": {
		"accountLevelInfo": {
			"customerContactInfo": {
				"action": "Add",
				"address": {
					"city": "FC",
					"companyName": "VISA TEST Inc",
					"line1": "123 main st",
					"line2": "apt 1",
					"state": "CA",
					"zip": ""
				},
				"email": "test001@adbc.com",
				"firstName": "John",
				"lastName": "Smith",
				"middleInitial": "S",
				"mobileNumber": "1000012120",
				"namePrefix": "Mr",
				"nameSuffix": "Sr",
				"prefMethodOfContact": "M"
			},
			"linkEnrollment": {
				"group": [{
					"action": "Add",
					"groupID": "dnVgrLnzKICYNAM6PMBHbw",
					"groupType": "LOC",
					"isPrimaryAccount": ""
				}]
			},
			"productID": "G",
			"rpinEnrollment": {
				"accountOpenDate": "20240118",
				"action": "Add",
				"rpin": "123456",
				"rpinEffectiveDate": "20240118",
				"rpinIssuerRefNumber": "684226"
			}
		},
		"cardholderInfo": {
			"primaryAccountNumber": "xx01"
		}
	},
	"operationType": "UPDATE",
	"updateReferenceID": "F6xd0YdOcFr2H0vMJZBsAk"
}

 

Response Header:
微信图片_20240118103557.png

x-correlation-id:1705544507_609_1022119580_-54d479d6b66_VDP_Ws

 

 

 

 

 

6 REPLIES 6
jenn_kh
Community Moderator

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

Hi @mifapay, Thank you for reaching out! One of our agents will look into this and get back to you soon. Until then, if any community members know a solution, please feel free to respond in this thread.

mifapay
Helper

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

I have found the issue with 400, and now I am reporting an error of 500
{
"code": "NPPS003",
"message": "Internal error occured",
"status": "INTERNAL_SERVER_ERROR"
}
API_Products
Visa Developer Support Specialist

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

Hi @mifapay,

 

To investigate, please provide the following information:

1. End Point
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body

You can find the x-correlation-id in the response header.

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

mifapay
Helper

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

1. End Point:https://sandbox.api.visa.com/vcpe/v2/pan/enrollment
2. Request Header:
{Accept=application/json, X-Request-ID=qoVH2VWflacRKa3w22kJBq, keyId=3ac14999-fdf5-42fd-a203-4d44047b568c, Content-Type=application/json,Authorization:Basic S1BHSk1UVkQySVJDVUNDQ0ZIQTgyMXN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D0GJBuKn4f-4kU8e_ao_UP19COZo614k95nvlykh9Oe8wiYqS4asfadX7kgDVwxwv4WHWgv8YKq7aOIHYGKnxlrwO1fILJfMh3Q5iD2DtweKWihqOVy0xT_YjgOGfidU_B8zkqypVi1etKNfztIYd7Hy7cmC2pGnNpu8MZFsc8hpD_dbR3DErH1i9XJ9d9LUrVds23poa-phUuo0YW0k2AwM7m9n4ujaRD7zlXBtYznh1IxIh4Pq7e2UPKX4ppa7tkkk_eD6dfDfehLsggQ0l9j_Y4W_C85ou5QJ8eittRy7bObdkauKSraYQ6-lLBTTf-te547n7tXlALB9udm4CHwU-JIUqHKdBcIN3nl9HCa1n03z5wL9ifHwnKNgeE44U27IOfEuY9zRPNHGFefLHIt0sVpBvOlvER4VqE8AnANnTiynccDo7Pe1uLHYHwZTtQ3Nzp9V1LZqJSPtC7hnjBCp_m11zPnNabSTM7KlBcs9aZ3ug3abhMxF2pcZQLQLEbhH55EQQCtBIaemPL8OMM-uoSXfTWQ2pME83-x_FIPJVsq1I5rg_cGKcTrIJDHdxJfiAwtcnIDMyEa1QF-PXxstQ0wtkb7E5kgg.Y6Oe-wCaih0UM5Z7xTr35g"}
4. Response Header (include the x-correlation-id)
Content-Type: application/json;charset=UTF-8
Content-Length: 86
Connection: keep-alive
X-SERVED-BY: -54d479d6n7
X-CORRELATION-ID: 1705975955_035_592742376_-54d479d6n7_VDP_WS
X-APP-STATUS: 500
X-ERROR-ORIGIN: 9300
Cache-Control: no-cache, no-store, must-revalidate
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000;includeSubdomains
Pragma: no-cache
Expires: -1
Content-Security-Policy-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;
X-Content-Security-Policy-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;
X-WebKit-CSP-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;

5. Response Body
{"status":"INTERNAL_SERVER_ERROR","code":"NPPS003","message":"Internal error occured"}
You can find the x-correlation-id in the response header.
API_Products
Visa Developer Support Specialist

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

Hi @mifapay,

 

Thanks for providing this information. I've logged incident INC17596815 for our engineering team to investigate. We'll get back soon. 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Getting 400 While Calling /vcpe/v2/pan/enrollment

Hi @mifapay,

 

This API is not supported in sandbox. You'll need to submit a go live request to move into the certification environment for testing. You can refer to the Going Live guide for details.




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.