Ups my choice is the tracking feature for customers of UPS. This means if we pass the all the required details, we can get in through it.
In our extension, we have to integrate SCA with UPS MY CHOICE. For that, we have created an admin account in UPS for the auth credentials. Also developed JSON format with these credentials.
We have created POST API for passing these to UPS for creating the account
Code samples:
var customer2 = {
"PrescreenUserEligibilityRequest": {
"Request": {
"TransactionReference": {
"CustomerContext": time1
}
},
"Locale": {
"Language": "en",
"Country": "US"
},
"Name": fullname,
"EmailAddress": email,
"DeliveryAddress": {
"AddressLine1": addr1,
"City": city,
"StateProvince": state,
"PostalCode": zip1,
"Country": country
},
"PhoneNumber": phone
},
"UPSSecurity": {
"UsernameToken": "\n \n ",
"ServiceAccessToken": {
"AccessLicenseNumber": "FD24F39A2502FF78"
}
}
}
ar service_url = Utils.getAbsoluteUrl(getExtensionAssetsPath('services/UPSMyChoice.Service.ss'));
jQuery.get(service_url, {
myJSON: myJSON,
})
var url1 = "https://onlinetools.ups.com/json/MCUserEligibility"
var response1 = nlapiRequestURL(url1, details.data, null, "POST");