Overview
EasyCred offers two distinct integration modes. You select the mode per request when initiating a journey using thechannel field. The rest of the journey flow depends on which mode you choose.
Comparison
| Feature | Hosted (API_HOSTED) | Headless (API_HEADLESS) |
|---|---|---|
| Returns | hostedUrl | journeySession |
| UI Ownership | EasyCred owns the screens | You build and own the UI |
| Steps Handled By | EasyCred (OTP, offers, KYC, e-sign, mandate) | Your backend via REST |
| Integration Effort | Minimal | Full control |
| Best For | Fastest time-to-market | Custom branded experience |
Hosted Mode (API_HOSTED)
API_HOSTED
Start a journey and get back a
hostedUrl. Redirect the customer to it or embed it in a WebView. EasyCred’s screens handle the entire loan journey through to completion.Redirect the Customer
Use the returned
hostedUrl to open EasyCred’s hosted screens for your customer.In Hosted mode,
GET /journey/{journeyId} (the headless state endpoint) requires a journeySession and cannot be used. Use the application-status endpoint or webhooks instead.Headless Mode (API_HEADLESS)
API_HEADLESS
Your backend fully drives the loan journey over REST. You control every screen the customer sees, submitting their choices as actions and handling verification redirects.
Initiate the Journey
Call
POST /api/v1/partner/journey/initiate with channel: "API_HEADLESS". You receive a journeySession token.Poll Journey State
Call
GET /api/v1/partner/journey/{journeyId} with X-Journey-Session header to read the current nextAction.Submit Actions
When the category is
COLLECT, gather the customer’s choice and POST it to /journey/{journeyId}/action.Handle Redirects
When the category is
REDIRECT, open the verification URL for the customer, then signal return via /redirect-returned.Journey State Machine
The journey always exposes a singlenextAction. Your code branches on its category:
POLL — EasyCred is working in the background
POLL — EasyCred is working in the background
Wait
pollIntervalSeconds then read state again. Do not call the lender directly.COLLECT — A customer choice is needed
COLLECT — A customer choice is needed
Gather the customer’s input, then submit a POST action to the journey.
REDIRECT — A verification step
REDIRECT — A verification step
Open
currentNextAction.url for the customer (KYC / e-sign / mandate). Signal return when done.TERMINAL — The journey is finished
TERMINAL — The journey is finished
Read
outcome and stop polling. See Journey Outcomes.