API Integration Overview
Minimal production-grade flow for a fully headless borrower integration.
This is the recommended production integration for teams building a borrower journey entirely in their own app. Your backend keeps the API key, your app holds borrower session context, and your UI renders each stage based on the platform's step resources and journey state.
What you build
Partner backend
- Calls
POST /api/v1/headless/sessionswithAuthorization: Bearer sk_*. - Returns borrower session context to the authenticated app.
- Stores or rotates refresh tokens based on your app security model.
- Receives and verifies signed webhooks.
Borrower app
- Calls your backend to start or resume a borrower session.
- Uses the borrower session token for all
journey,profile,offer,step,aa, andpost-disbursalAPIs. - Renders screens based on
status,nextAction,actionRequired,resource, anddiagnostics.
Eventing layer
- Polls
GET /api/v1/headless/journeys/{journeyID}/statefor active sessions when needed. - Consumes
journey.snapshotwebhooks for asynchronous state changes.
End-to-end flow
Runtime rules
- Use API key tokens only from your backend.
- Use borrower session tokens only for borrower-scoped runtime APIs.
- Send
Idempotency-Keyon every mutating call. - Send
X-Correlation-IDon every call that participates in a user-visible flow. - Treat
nextActionand stepactionRequiredas the source of truth for what the borrower should see next. - Respect offer locking. Once an offer is proceeded, other offers for the same journey may be blocked.
Polling guidance
- Active step or just-submitted action: poll every 2-5 seconds.
- Passive waiting states such as offer dispatch: poll every 10-20 seconds.
- Prefer webhooks for server-side systems, analytics, and non-interactive reconciliation.
State model
Public journey states are simplified into the following lifecycle:
STARTEDPROFILE_REQUIREDPROFILE_SUBMITTEDOFFERS_PENDINGOFFERS_AVAILABLEOFFER_SELECTEDAA_REQUIREDKYC_PENDINGBANK_MANDATE_PENDINGE_MANDATE_PENDINGLOAN_AGREEMENT_PENDINGLENDER_PROCESSINGDISBURSEDREJECTED,EXPIRED, orCLOSED
Also important
- Public payloads do not expose ONDC action names, transaction IDs, or provider-network internals.
- Redirect-style steps are returned as resources, not as embedded hosted UI.
- Journey resume is modeled through session bootstrap,
GET /journeys,GET /journeys/{journeyID}, andPATCH /journeys/{journeyID}/resume.