HomeGuidesAPI Reference

Link Debts

Help consumers view, manage, and take control of their debts

Give consumers an overview of all their debts, drill into the details, and help them achieve their financial goals—all with Nexus.linkDebts.

Calling Nexus.linkDebts

Nexus.linkDebts expects to receive a single options object as a parameter. This options object allows you to specify an optional onEvent callback to take actions based on your borrower's activity within Nexus:

// Assuming you have a button your Consumer can click to start linking their debts
let nexusButton = document.querySelector('#nexus-debts-button')

// Attach click handler to invoke Nexus.linkDebts
nexusButton.addEventListener('click', e => {
  Nexus.linkDebts({
    // the function to call when an important event takes place within Nexus
    onEvent: onEventCallback
  })
})

onEvent callback

When Nexus transmits an event, your onEvent callback will be called with one an argument, a JavaScript object with a top-level property nexusEvent containing an object with the details of the event:

{
  nexusEvent: {
    name: "debts_linked",
    workflow: "link_debts",
    consumer: {
      uuid: "dceea28c-2245-41a8-a558-fef1643f99b2"
    },
    metadata: {}
  }
}

Nexus.linkDebts Events

nexusEvent.nameDescriptionnexusEvent.metadata
debts_linkedThe borrower's credit report was successfully requested. To fetch data about the consumer's debts, use our GraphQL API with the consumer's uuid.none
quitThe borrower closed Nexus without retrieving a credit report.none

📘

Consumer IDs

When relying on Nexus to create consumers, you will need to capture the consumer.uuid that is returned in order to make API calls on behalf of your consumers