SetuClient.Data.ESign (Setu Client v1.0.0)

Copy Markdown View Source

Setu Aadhaar eSign API client.

Legally enforceable Aadhaar-based electronic signatures on PDF documents. Supports up to 6 signers. Built on NSDL and eMudra infrastructure.

Flow

  1. create/2 — upload base64 PDF, specify signers
  2. Redirect each signer to their URL from signerUrls
  3. Poll get/2 or receive webhook until complete?/1 returns true
  4. download/2 — retrieve the signed PDF as base64

Setu docs: https://docs.setu.co/data/esign

Summary

Functions

Returns true when all signers have signed (status == "COMPLETED").

Initiates an Aadhaar eSign workflow.

Downloads the signed PDF as a base64 string.

Retrieves the current status of an eSign request.

Functions

complete?(arg1)

@spec complete?(map()) :: boolean()

Returns true when all signers have signed (status == "COMPLETED").

create(cfg, params)

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

Initiates an Aadhaar eSign workflow.

Required params

  • :document_base64 — base64-encoded PDF
  • :document_name
  • :signers — list of 1–6 maps, each with :name and :mobile

POST /api/esign/request

download(cfg, id)

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

Downloads the signed PDF as a base64 string.

Call only after complete?/1 returns true.

GET /api/esign/request/:id/download

get(cfg, id)

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

Retrieves the current status of an eSign request.

GET /api/esign/request/:id