Import Trust Receipts to Lawpractica

The Lawpractica Trust Receipts Import API allows for the seamless importation of existing trust receipt data into Lawpractica. This functionality is designed specifically for developers looking to integrate or migrate trust receipt information into Lawpractica efficiently.
Authentication Method
The API uses a Bearer token (API Key) for authentication.
Obtaining Credentials
Credentials can be obtained from the Lawpractica application under the Integration tab in the Manage Settings form. Look for the Security Key value provided in the data exchange section.
Trust Receipt Import Endpoint
  • URL:
  • Method: POST
  • Description: Imports trust receipt data into Lawpractica.
  • Request Headers:
    • Authorization: Bearer token (API key)
    • sd: Name of the user's subdomain (instance of the user application)
Request Body
Request body contains the requestor's information and an array of trust receipts to be imported.

Request body schema (JSON Schema)
{
    "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?"
    }
  ]
}
    
Response Body
Response body contains a summary of the import operation and details of each trust receipt processed.
  • Description:   A summary of the import operation, including the Import Request ID and the number of trust receipts successfully imported.
    TotalRecords: Total number of trust receipt records processed.
    TotalInserted: Number of new trust receipt records inserted during the import.
    TotalUpdated: Number of trust receipt records updated during the import.
    TotalErrors:    Number of errors encountered during the import process.
    TrustReceipts:         An array containing details of each trust receipt processed.
    • id: Unique identifier of the trust receipt record.
      >Other trust receipt attributes.

      >importNotes: Descriptions of any errors encountered while importing the trust receipt data.
      >importStatus: Indicates the status of the import operation for the trust receipt record. It has the format "I-[id]" if the record was inserted, "U-[id]" if it was updated, where "id" is the record ID.


  • Response body schema (JSON Schema)
    {
        "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"
        }
      ]
    }
    
    • 400 Invalid JSON Format: The provided JSON information is invalid.
    • 411 User information cannot be empty: User information required for the operation is missing.
    • 411 API Key cannot be empty: API key required for authentication is missing.
    • 411 Subdomain cannot be empty: Subdomain information required for the operation is missing.
    • 411 Notification email cannot be empty (if IsSendNotification = 1): Notification email is required when notification is enabled.
    • 422 Invalid notification email format (if IsSendNotification=1): The format of the notification email is invalid.
    • 422 Invalid token: The provided token is invalid.
    • 500 Exception: An internal server error occurred.

    
    
    
    
    

    
    
        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); }

    https://
    lawpractica.com