Purpose:

Create a new transaction request template, containing a defined request type and set of request options, that Lender administrators can associate with a 1-click/automated ordering business condition set.

Sample Usage:

// Request template gathered from user selection
let transactionTemplate = {
  name: 'TEMPLATE_NAME',
  request: {
    type: 'NEW_REQUEST',
    options: {
      stringOption: 'SOME_VALUE',
      booleanOption: true,
      numericOption: 1000
    }
  }
}

async function createTransactionTemplate(transactionTemplate) {
  try {
    const transactionTemplateObject = await elli.script.getObject('transactionTemplate')
    const transactionTemplateSuccess = await transactionTemplateObject.save(transactionTemplate)

    console.log(transactionTemplateSuccess)
  } catch (error) {
    console.log({error})
  }
}

createTransactionTemplate(transactionTemplate)
// Request template gathered from user selection
let transactionTemplate = {
  request: {
    type: 'NEW_REQUEST',
    options: {
      stringOption: 'SOME_VALUE',
      booleanOption: true,
      numericOption: 1000
    }
  }
}

elli.script.getObject('transactionTemplate')
  .then(
    (transactionTemplateObject) => {
      transactionTemplateObject.save(transactionTemplate)
        .then(
          (transactionTemplateSuccess) => {
            console.log(transactionTemplateSuccess)
          }
        )
        .catch(
          (error) => {
            console.log({error})
          }
        )
    }
  )
  .catch(
    (error) => {
      console.log(error)
    }
  )

Interface:

Input:

Type: Object

{
  name: 'TEMPLATE_NAME',
  request: {
    type: 'SUPPORTED_REQUEST_TYPE',
    options: {
      stringOption: 'SOME_VALUE',
      booleanOption: true,
      numericOption: 1000
    }
  }
}
AttributeDescription

$.name
string - optional

The listing name for the transaction template, as provided by the lender administrator. Enable your lenders to name their transaction templates by exposing an input field for the template name, so that they can easily identify the appropriate templates for use when creating a 1-click or automated ordering workflow setup for your integration.

If a template name is not provided here - an auto-generated name is assigned - following a format of {{product_listing_name}}-{{epoch_utc_timestamp}}

$.request.type
string - required

The type of transaction request being templated for the subject product. This must be one of the supported values for the request type that your application is configured to support, based on which its data entitlements are scoped.

$.request.options
object - optional

The set of selectable options that apply to the specific type of transaction request, as modeled by your application, being templated by the Lender administrator.

This can be used to select from which bureaus to order a borrower's credit score for a Credit integration, or how many days of income information to pull for a borrower in the case of a Verification of Income/Employment integration.

Returns:

Type: Promise

==> Resolved:

"success"

==> Rejected:

An error is raised, containing a message attribute with details on the error that occurred

{
  message: "{{ERROR_DETAILS}}"
}

🚧

Not able to retrieve this object?

Remember, the transactionTemplate object is only accessible to the administrator-facing view of a Partner application, registered as the $.adminInterfaceUrl property in the product configuration. This object encapsulates functionality that is only relevant for products that support 1-click/automated ordering workflows (as specified by the $.tags.workflows tag in the product configuration), and is only applicable when an administrator is trying to create a 1-click/automated service ordering setup in the Web Version of Encompass Services Management section.

This object is therefore not accessible to an integration's service ordering view, (registered as the $.interfaceUrl property in the product configuration), wherein the transaction and application objects are available for use as applicable.

❗️

Common Error Scenarios!

  • You used a $.request.type that is not configured to be supported by your application