3. Contract

All contract-related feature sets are available under Contract class. There are three primary functions under this class.

3.1. generate

This function provides consumers to generate documents using templates and transaction data.

Declaration

public JObject generate(string templateId, string format = "PDF", string transactionId = "",
        Hashtable? fillData = null)

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.string - [In]templateIdDocument template id against which the document is to be generated with real-time values.
System.string - [In]formatDocument output format parameter. If left out, these parameters will be set to PDF.
System.string - [In]transactionIdTransaction Id against which the document is to be generated. The function will retrieve data based on the provided transactionId. The function will use the BLANK value if the parameter is left out during execution.
System.Collections.Hashtable - [In]fillDataThis collection contains additional custom data that must be appended to the document. This is passed in the Key-Value pair. The function will use the BLANK value if the parameter is left out during execution.
JObject - [Out]N/AThe entire verification object is streamed into resp named parameter and returned.

3.2. listTemplate

The List Template function retrieves a list of contract templates based on the provided filters.

Declaration

public JObject listTemplate(int order = -1, int limit = 10, int offset = 0, string filterTemplateId = "")

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.integer - [In]orderSort results by newest(-1) or oldest(1). If the parameter is left out during execution, the function will use the -1 value. The value cannot be 1 or -1. The function will throw an exception if any one of these is used.
System.integer - [In]limitA number of items are to be returned per call. If the parameter is left out during execution, the function will use the -1 value. The 'limit' should be a positive integer greater than 0 and less than or equal to 100.
System.integer - [In]offsetStart the list from a particular entry index.
System.integer - [In]filterTemplateIdFilter result by template ID.
JObject - [Out]N/AThe entire array of template objects is streamed into resp named parameter and returned.

3.3. getTemplate

This function enables the developer to retrieve the Template details as per the provided id.

Declaration

public JObject getTemplate(string templateId = "")

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.integer - [In]templateIdTemplate ID that is to be retrieved. The function will use the BLANK value if the parameter is left out during execution.
JObject - [Out]N/AThe entire template object is streamed into resp named parameter and returned.

3.4. deleteTemplate

Any unwanted template can be deleted by passing the relevant ID to this function.

Declaration

public JObject deleteTemplate(string templateId = "")

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.integer - [In]templateIdTemplate ID that is to be retrieved. The function will use the BLANK value if the parameter is left out during execution.
JObject - [Out]N/AThe template deletion confirmation object is streamed into resp named parameter and returned back.

3.5. createTemplate

A new template, if required, can be created using createTemplate. This function requires template-based content, which acts as a template for further processing.

Declaration

public JObject createTemplate(string name = "", string _content = "", string orientation = "0",
        string timezone = "UTC", string font = "Open Sans")

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.string - [In]nameTemplate name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter.
System.string - [In]_contentHTML based template. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter.
System.string - [In]orientationTemplate orientation can be either landscape or portrait. 0=Portrait(Default), 1=Landscape. The function will use the BLANK value if the parameter is left out during execution.
System.string - [In]timezoneTemplate timezone. The function will use the UTC timezone value if the parameter is left out during execution.
System.string - [In]fontTemplate font. The function will use the Open Sans font value if the parameter is left out during execution.
JObject - [Out]N/AThe generated template object streamed into resp named parameter and returned.

3.6. updateTemplate

Any existing template can be updated with this function based on the provided templateId.

Declaration

public JObject updateTemplate(string templateId = "", string name = "", string _content = "",
        string orientation = "0", string timezone = "UTC", string font = "Open Sans")

Here are the input and output parameters defined against this function.

Type (In/Out)NameDescription
System.integer - [In]templateIdTemplate name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter.
System.string - [In]nameTemplate name based on the requirement. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter.
System.string - [In]_contentHTML based template. The function will use the BLANK value if the parameter is left out during execution. The function will throw an exception if the BLANK value is passed in this parameter.
System.string - [In]orientationTemplate orientation, which can be either landscape or portrait. 0=Portrait(Default), 1=Landscape. The function will use the BLANK value if the parameter is left out during execution.
System.string - [In]timezoneTemplate timezone. The function will use the UTC timezone value if the parameter is left out during execution.
System.string - [In]fontTemplate font. The function will use the Open Sans fonts value if the parameter is left out during execution.
JObject - [Out]N/AThe updated template object streamed into resp named parameter and returned.

🚧

Update Process

Please note that the BLANK field provided will be overridden with the existing data; therefore, it is advised to pass on the current data for the specific field in case no update is required.