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
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.1
Initiate the Journey
Call
POST /api/v1/partner/journey/initiate with channel: "API_HOSTED".2
Redirect the Customer
Use the returned
hostedUrl to open EasyCred’s hosted screens for your customer.3
Track Progress
Poll
GET /api/v1/partner/leads/{applicationId}/status or subscribe to webhooks for real-time updates.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.
1
Initiate the Journey
Call
POST /api/v1/partner/journey/initiate with channel: "API_HEADLESS". You receive a journeySession token.2
Poll Journey State
Call
GET /api/v1/partner/journey/{journeyId} with X-Journey-Session header to read the current nextAction.3
Branch on Category
Act on the
nextAction.category — POLL, COLLECT, REDIRECT, or TERMINAL.4
Submit Actions
When the category is
COLLECT, gather the customer’s choice and POST it to /journey/{journeyId}/action.5
Handle Redirects
When the category is
REDIRECT, open the verification URL for the customer, then signal return via /redirect-returned.6
Read the Outcome
When
TERMINAL, read data.outcome and stop polling.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.