Loans SDK integration guides

This document lists the key steps required to launch all SDK flows.

Integration steps


SDK Interface

class ScLoan {
  constructor({ gatewayName }) {}

  // LOS — triggers a new loan origination journey
  apply({ interactionToken }) {}

  // LMS — opens the repayment flow
  pay({ interactionToken }) {}

  // LMS — opens the principal withdrawal flow
  withdraw({ interactionToken }) {}

  // LMS — renders the loan dashboard inside a target DOM element
  // Returns { close: () => Promise, task: Promise }
  // `target` is the DOM element ID to inject the iframe into
  service({ interactionToken, target }) {}
}

Error codes

All Loans SDK methods return an error object of shape { code, message, data? } when the user's intended action isn't completed.

Error codeError messageReason
1012user_cancelledThe user aborted the flow by closing/abandoning the UI
1031contact_supportThe user tapped the contact/support icon - redirect them to your support page or chat
2000internal_error
2001missing_url_params
3001existing_loan_found
3004init_sdkAn SDK method was called before setup() completed successfully - call setup() first
4000invalid_request
4001partner_inactive
4002guest_not_allowed
4003interaction_expired
4004invalid_intent
4005invalid_interaction
4006invalid_intent_config
4007api_secret_mismatch
4008invalid_auth_token
4009dashboard_already_openservice() was called while a dashboard is already open
4010element_not_foundThe target DOM element ID passed to service() was not found
📘

Refer - How to call Unity API and how to create interaction token?



Did this page help you?