SetuClient.Data.KYC.DigiLocker (Setu Client v1.0.0)

Copy Markdown View Source

Setu DigiLocker API client.

Fetch Aadhaar, driving licences, mark sheets, and more from GoI-certified issuing authorities with user consent.

Setu docs: https://docs.setu.co/data/kyc (DigiLocker section)

Summary

Functions

Initiates a DigiLocker consent session.

Fetches a specific document type from an authorised session.

Retrieves the current state of a DigiLocker session.

Functions

create_session(cfg, params)

@spec create_session(SetuClient.Config.t(), map()) ::
  {:ok, map()} | {:error, SetuClient.Error.t()}

Initiates a DigiLocker consent session.

Redirect the customer to the returned consentUrl.

Required params

  • :redirect_url

POST /api/digilocker/session

get_document(cfg, session_id, document_type)

@spec get_document(SetuClient.Config.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, SetuClient.Error.t()}

Fetches a specific document type from an authorised session.

GET /api/digilocker/session/:id/documents/:type

get_session(cfg, session_id)

@spec get_session(SetuClient.Config.t(), String.t()) ::
  {:ok, map()} | {:error, SetuClient.Error.t()}

Retrieves the current state of a DigiLocker session.

GET /api/digilocker/session/:id