{
"UserPrefix": "string",
"UserFullName": "string",
"UserEmail": "string",
"ProfileCode": "string",
"IsSendNotification": "integer",
"NotificationEmail": "string",
"NotificationCustomMessage": "string",
"TrustReceipts": [
{
"TRDate": "DateTime?",
"TRFileNumber": "string",
"TRBankCode": "string",
"TRPaymentType": "string",
"TRType": "string",
"TRDescription": "string",
"TRAmount": "decimal?",
"TRUI": "string",
"TRUpdDate": "DateTime?"
}
]
}
{
"RequestID": "integer",
"TotalRecords": "integer",
"TotalUpdated": "integer",
"TotalInserted": "integer",
"TotalErrors": "integer",
"TrustReceipts": [
{
"ID": "string",
"TRDate": "DateTime?",
"TRFileNumber": "string",
"TRBankCode": "string",
"TRPaymentType": "string",
"TRType": "string",
"TRDescription": "string",
"TRAmount": "decimal?",
"TRUI": "string",
"TRUpdDate": "DateTime?",
"ImportNotes": "string",
"ImportStatus": "string"
}
]
}
crossDomain: true,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(TrustReceipts),
headers: {
'Authorization': 'Bearer ' + apiKey,
'sd:' + subDomain,
'Content-Type': 'application/json'
}
var TrustReceipts =
{
"UserPrefix": "BS",
"UserFullName": "Brian Smith",
"UserEmail": "info@lawpractica.com",
"ProfileCode": "LP-DE",
"IsSendNotification": "0",
"NotificationEmail": "notification@example.com",
"NotificationCustomMessage": "This is a custom notification message",
"TrustReceipts": [
{
"TRDate": "2024-01-25",
"TRFileNumber": "TR-2024-001",
"TRBankCode": "ABC123",
"TRPaymentType": "CHK",
"TRType": "T",
"TRDescription": "Trust deposit for real estate transaction",
"TRAmount": 1500.00,
"TRUI": "TR0001",
"TRUpdDate": "2024-02-26T10:30:00"
},
{
"TRDate": "2024-02-01",
"TRFileNumber": "TR-2024-002",
"TRBankCode": "XYZ789",
"TRPaymentType": "EFT",
"TRType": "R",
"TRDescription": "Trust deposit for business litigation",
"TRAmount": 500.00,
"TRUI": "TR0002",
"TRUpdDate": "2024-02-25T10:30:00"
}
]
}
$.ajax({
type: 'POST',
url: '/api/TrustReceipt/Import',
crossDomain: true,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(TrustReceipts),
headers: {
'Authorization': 'Bearer ' + apiKey,
'sd:' + subDomain,
'Content-Type': 'application/json'
},
success: function (data) {
var objJS = JSON.parse(JSON.stringify(data));
if (objJS != null && objJS.Code != 200) { alert('Code: ' + objJS.Code + '\nDescription: ' + objJS.Description); }
else { alert('Code: ' + objJS.Code + '\nDescription: ' + objJS.Description + '\nTotal Records: ' + objJS.TotalRecords + '\nTotal Updated Records: ' + objJS.TotalUpdated + '\nTotal Inserted Records: ' + objJS.TotalInserted + '\nTotal Records with error: ' + objJS.TotalErrors); }
},
error: function (jqXHR, status, error) {
console.log(jqXHR);
console.log(status);
console.log(error);
},
statusCode: {
200: function () {
console.log("200 - Success");
},
//when any of info not supplied (without json object(ajax) either in URL parameters)
400: function (request, status, error) {
alert(error);
},
//when any of supplied info is empty
411: function (request, status, error) {
alert(error);
},
//when the provided info is not invalid
422: function (request, status, error) {
alert(error);
},
500: function (request, status, error) {
alert(error);
}
200: function () {
console.log("200 - Success");
},
//when any of info not supplied (without json object(ajax) either in URL parameters)
400: function (request, status, error) {
alert(error);
},
//when any of supplied info is empty
411: function (request, status, error) {
alert(error);
},
//when the provided info is not invalid
422: function (request, status, error) {
alert(error);
},
500: function (request, status, error) {
alert(error);
}