Purpose:
Provide the necessary information for your application's user-interface to:
- Access transaction origination information and bootstrap its user interaction
- 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'
}
Attribute | Description |
---|---|
$.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 enterprise2. consumer - when your user interface is being presented to a consumer/borrower |
Partner Access Token Validity
Your integration needs the
partnerAccessToken
returned by thegetOrigin
method to successfully call theGET https://api.elliemae.com/partner/v2/origins/:id
Partner RESTful API endpoint and retrieve transaction origination information. Remember that apartnerAccessToken
is only valid for 300 seconds once generated 🕒If your
partnerAccessToken
expires, don't worry. Call back intotransaction.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:
- You have not registered an
interfaceUrl
for the subject product, via the REST API's/products
endpoints- Your page took too long to callback into the
elli.script.ready()
callback function (longer than30
seconds) - after which the host Encompass application will assume your application is un-responsive