Purpose:
Allow Lenders to initiate a new transaction with your integration
Sample Usage:
import host from '@elliemae/em-ssf-guest'
...
let transactionRequest = {
request: {
type: 'NEW_REQUEST',
options: {
stringOption: 'SOME_VALUE',
booleanOption: true,
numericOption: 1000
},
resources: [
{
id: 'A_RESOURCE_ID',
name: 'A_RESOURCE_NAME',
mimeType: 'A_RESOURCE_MIMETYPE'
}
]
}
}
async function createTransaction(transactionRequest) {
try {
const transactionObject = await host.getObject('transaction')
const transactionData = await transactionObject.create(transactionRequest)
applicationState.transactionId = transactionData.id
} catch (error) {
console.log({error})
}
}
createTransaction(transactionRequest)
import host from '@elliemae/em-ssf-guest'
...
let transactionRequest = {
request: {
type: 'SUPPORTED_REQUEST_TYPE',
options: {
stringOption: 'SOME_VALUE',
booleanOption: true,
numericOption: 1000
},
resources: [
{
id: 'A_RESOURCE_ID',
name: 'A_RESOURCE_NAME',
mimeType: 'A_RESOURCE_MIMETYPE'
}
]
}
}
host.getObject('transaction')
.then(
(transactionObject) => {
transactionObject.create(transactionRequest)
.then(
(transactionData) => {
applicationState.transactionId = transactionData.id
}
)
.catch(
(error) => {
console.log({error})
}
)
}
)
.catch(
(error) => {
console.log({error})
}
)
Interface:
Input:
Type: Object
{
request: {
type: 'SUPPORTED_REQUEST_TYPE',
options: {
stringOption: 'SOME_VALUE',
booleanOption: true,
numericOption: 1000
},
resources: [
{
id: 'A_RESOURCE_ID',
name: 'A_RESOURCE_NAME',
mimeType: 'A_RESOURCE_MIMETYPE'
}
]
}
}
Attribute | Description |
---|---|
`$.request.type`
|
The |
`$.request.options`
|
The specific set of selectable options that apply to the specific type of transaction request, as modeled by your application. This may 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. |
`$.request.resources`
|
The collection of file attachments - referred to as
Once the |
Returns:
Type: Promise
==> Resolved:
{
id: "TRANSACTION_GUID"
}
==> Rejected:
An error is raised, containing a message attribute about details on the error that occurred
{
message: "{{ERROR_DETAILS}}"
}
Common Error Scenarios!
- You used a
$.request.type
that is not configured to be supported by your application- You passed an invalid
resource
object (not collected in one of the two ways described in the table above), or repeated a resource object, in$.request.resources