Purpose:

Provide the necessary information for your application's user-interface to:

  1. Access transaction origination information and bootstrap its user interaction
  2. Know if it was launched in the context of an existing transaction, so it can present the relevant view

Sample Usage:

import host from '@elliemae/em-ssf-guest'

...

async function initializeOriginationContext() {
  try {
    const transactionObject = await host.getObject('transaction')
    const originationContext = transactionObject.getOrigin()

    applicationState.originId = originationContext.id
    applicationSate.partnerAccessToken = originationContext.partnerAccessToken
    if (originationContext.transactionId) {
      applicationState.transactionId = originationContext.transactionId
    }
  } catch (error) {
    console.log({error})
  }
}

initializeOriginationContext()
import host from '@elliemae/em-ssf-guest'

...

host.getObject('transaction')
  .then(
    (transactionObject) => {
      const originationContext = transactionObject.getOrigin()

      applicationState.originId = originationContext.id
      applicationState.partnerAccessToken = originationContext.partnerAccessToken
      if (originationContext.transactionId) {
        applicationState.transactionId = originationContext.transactionId
      }
    }
  )
  .catch(
    (error) => {
      console.log({error})
    }
  )

Interface:

Input:

None

Returns:

Type: Object

{
  id: 'ORIGIN_ID',
  partnerAccessToken: 'PARTNER_ACCESS_TOKEN',
  transactionId: 'TRANSACTION_ID'
  context: 'lender' // or 'consumer'
}
AttributeDescription

$.id
Unique identifier for the transaction origination information snapshot accessible via the REST API's /partner/v2/origins/:id endpoint

$.partnerAccessToken
Temporary session token that grants authorization for a partner integration to access transaction origination information via the REST API's /partner/v2/origins/:id endpoint

$.transactionId
Unique identifier for the transaction in whose context the partner integrations user-interface is being launched. This is only available in the situation where your integration is being launched in the context of an existing transaction, and can be used to decide the appropriate view to display to users.

$.context
The user type in whose context your integration is being launched - one of:

1. lender - when your user interface is being presented to a user in a lending enterprise
2. consumer - when your user interface is being presented to a consumer/borrower

📘

Partner Access Token Validity

Your integration needs the partnerAccessToken returned by the getOrigin method to successfully call the GET https://api.elliemae.com/partner/v2/origins/:id Partner RESTful API endpoint and retrieve transaction origination information. Remember that a partnerAccessToken is only valid for 300 seconds once generated 🕒

If your partnerAccessToken expires, don't worry. Call back into transaction.refreshOrigin to generate a new one!

❗️

If there are failures while generating origination information for your integration, application users will be presented with a model dialog informing them that your application is currently unavailable.

Possible Error Scenarios:

  1. You have not registered an interfaceUrl for the subject product, via the REST API's /products endpoints
  2. Your page took too long to callback into the elli.script.ready() callback function (longer than 30 seconds) - after which the host Encompass application will assume your application is un-responsive