{
"UserPrefix": "string",
"UserFullName": "string",
"UserEmail": "string",
"ProfileCode": "string",
"IsSendNotification": "integer",
"NotificationEmail": "string",
"NotificationCustomMessage": "string",
"Invoices": [
{
"InvoiceDate": "DateTime",
"InvoiceFileNumber": "string",
"InvoiceReferenceNo": "string",
"FeesDescription": "string",
"FeesAmount": "decimal?",
"ExpenseDescription": "string",
"ExpenseAmount": "decimal",
"Discount": "decimal",
"SubTotal": "decimal",
"Tax1Amount": "decimal",
"Tax2Amount": "decimal",
"InvoiceTotalAmount": "decimal",
"ExpenseInvoiceRefNo": "string",
"InvoiceUI": "string",
"InvoiceUpdDate": "DateTime"
}
]
}
{
"RequestID": "integer",
"TotalRecords": "integer",
"TotalUpdated": "integer",
"TotalInserted": "integer",
"TotalErrors": "integer",
"Invoices": [
{
"ID": "string",
"InvoiceDate": "DateTime",
"InvoiceFileNumber": "string",
"InvoiceReferenceNo": "string",
"FeesDescription": "string",
"FeesAmount": "decimal?",
"ExpenseDescription": "string",
"ExpenseAmount": "decimal",
"Discount": "decimal",
"SubTotal": "decimal",
"Tax1Amount": "decimal",
"Tax2Amount": "decimal",
"InvoiceTotalAmount": "decimal",
"ExpenseInvoiceRefNo": "string",
"InvoiceUI": "string",
"InvoiceUpdDate": "DateTime",
"ImportNotes": "string",
"ImportStatus": "string"
}
]
}
crossDomain: true,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(Invoices),
headers: {
'Authorization': 'Bearer ' + apiKey,
'sd:' + subDomain,
'Content-Type': 'application/json'
}
var Invoices =
{
"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",
"Invoices": [
{
"InvoiceFileNumber": "INV-2024-001",
"InvoiceDate": "2024-01-30",
"InvoiceReferenceNo": "ABC123",
"FeesDescription": "Legal services for client X",
"FeesAmount": 1500.00,
"ExpenseDescription": "Travel expenses",
"ExpenseAmount": 200.00,
"Discount": 0.00,
"SubTotal": 1700.00,
"Tax1Amount": 136.00,
"Tax2Amount": 0.00,
"InvoiceTotalAmount": 1836.00,
"ExpenseInvoiceRefNo": "123",
"InvoiceUI": "INV00001",
"InvoiceUpdDate": "2024-01-30T15:00:00"
},
{
"InvoiceFileNumber": "INV-2024-002",
"InvoiceDate": "2024-02-02",
"InvoiceReferenceNo": "DEF456",
"FeesDescription": "Consulting services for client Y",
"FeesAmount": 2500.00,
"ExpenseDescription": "Office supplies",
"ExpenseAmount": 50.00,
"Discount": 100.00,
"SubTotal": 2450.00,
"Tax1Amount": 196.00,
"Tax2Amount": 0.00,
"InvoiceTotalAmount": 2646.00,
"ExpenseInvoiceRefNo": "321",
"InvoiceUI": "INV00002",
"InvoiceUpdDate": "2024-01-31T15:00:00"
}
]
}
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);
}