These docs are for v20.3.44. Click to read the latest docs for v20.3.186.

Discussions

Ask a Question
Back to All

Update Customer Type

I am trying to update customer type and status via Party. I used the postman collection as a jumping off point but I have been unable to get anything other than a 400 or 500 error back. My script looks like this:

jQuery.ajax(url + "/api/Party/" + id, {
type: "PUT",
headers: {
"RequestVerificationToken": document.getElementById("__RequestVerificationToken").value
},
"dataType": "json",
"contentType": "application/json",
"data": JSON.stringify({
"$type": "Asi.Soa.Membership.DataContracts.PersonData, Asi.Contracts",
"PersonName": {
"$type": "Asi.Soa.Membership.DataContracts.PersonNameData, Asi.Contracts",
"FirstName": fn,
"InformalName": "",
"LastName": ln,
"FullName": ""
},
"PartyId": id,
"Id": id,
"Status": {
"$type": "Asi.Soa.Membership.DataContracts.PartyStatusData, Asi.Contracts",
"PartyStatusId": "Dr"
},
"AdditionalAttributes" : {
$type: "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts"
Name: "CustomerTypeCode"
Value: "NM"
}
}),
success: updateCount(),
error : function(xhr, textStatus, errorThrown ) {
jQuery.ajax(this);
return;
}
});
}

Any help is greatly appreciated