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 code | Error message | Reason |
|---|---|---|
| 1012 | user_cancelled | The user aborted the flow by closing/abandoning the UI |
| 1031 | contact_support | The user tapped the contact/support icon - redirect them to your support page or chat |
| 2000 | internal_error | |
| 2001 | missing_url_params | |
| 3001 | existing_loan_found | |
| 3004 | init_sdk | An SDK method was called before setup() completed successfully - call setup() first |
| 4000 | invalid_request | |
| 4001 | partner_inactive | |
| 4002 | guest_not_allowed | |
| 4003 | interaction_expired | |
| 4004 | invalid_intent | |
| 4005 | invalid_interaction | |
| 4006 | invalid_intent_config | |
| 4007 | api_secret_mismatch | |
| 4008 | invalid_auth_token | |
| 4009 | dashboard_already_open | service() was called while a dashboard is already open |
| 4010 | element_not_found | The target DOM element ID passed to service() was not found |
Refer - How to call Unity API and how to create interaction token?
Updated about 2 hours ago
Did this page help you?