SetuBot
/

to search

Introducing Setu API playground Check it out ↗

Get users' consent before you can start pulling their financial data with Setu AA by initiating Consent flow in your application. This flow broadly consists of two parts:

  1. Create Consent Request—this is essentially a one-time data request that your user needs to approve. To know more details about this please visit Consent Object page.
  • Once a consent is created, you will receive a unique id with status = PENDING, along with a url where you can redirect your customer to consent manager screens, to review the data request. Here, the user may approve or reject the request
  1. Consent Request status—You can track the consent status with Get Consent Status API, alternatively Setu will notify you when the user has acted upon the consent request. See Notifications to configure your notification endpoint.

Call this API to create a consent request. The details of the request will be presented to your customer on Setu’s screens, as part of the next step.

POST /consents
{
"consentDuration": {
"unit" : "MONTH",
"value": "4"
},
"vua": "999999999@onemoney",
"dataRange": {
"from": "2020-04-01T00:00:00Z",
"to": "2023-01-01T00:00:00Z"
},
"context": [
]
}

Response

Consent gets created with a unique identifier id with status as PENDING. Redirect your customers to consent manager url to initiate consent review flow.

{
"id": "6d285134-c764-49ab-b32d-ead003161587",
"url": "https://fiu.setu.co/v2/consents/webview/6d285134-c764-49ab-b32d-ead003161587",
"status": "PENDING",
"detail": {
"consentStart": "2023-04-10T05:36:43.011Z",
"fiTypes": ["DEPOSIT"],
"fetchType": "PERIODIC",
"purpose": {
"category": {
"type": "string"
},
"refUri": "https://api.rebit.org.in/aa/purpose/101.xml",
"code": "101",
"text": "Loan underwriting"
},
"vua": "999999999@onemoney",
"dataRange": {
"from": "2020-04-01T00:00:00.000Z",
"to": "2023-01-01T00:00:00.000Z"
},
"consentTypes": ["TRANSACTIONS", "PROFILE", "SUMMARY"],
"consentMode": "STORE",
"consentExpiry": "2023-08-08T05:36:43.011Z",
"frequency": {
"value": 30,
"unit": "MONTH"
},
"dataLife": {
"value": 1,
"unit": "MONTH"
}
},
"redirectUrl": "https://setu.co",
"context": [],
"usage": {
"count": "0",
"lastUsed": null
},
"traceId": "1-6433a06a-4b99c3a81b538bc762b5aa08"
}

On redirecting your users to url, it opens up a Consent Manager that permits consent approval/rejection. This url can easily be embedded as a webview or be used to redirect from a website. The URL is of the form:

https://<fiu-base-url>/consents/webview/<id>

  • <fiu-base-url> — This is the base URL provided by Setu.
  • <id> — This is the request ID of the consent generated returned after the create consent request.

On getting redirected to the url, your users will be asked to verify their mobile number to further initiate the account fetching process. The mobile verification does a login, or register them with Setu using their mobile number. Setu creates a unique account aggregator handle for every registered customer.

The following steps are handled by Setu’s screens—

  • OTP verification on user's mobile number
  • Setu authenticates the user and displays the data request
  • Setu fetches the Financial Information Providers or FIPs
  • User links the FIPs and reviews the request
  • Setu validates and saves consent
  • Setu sends notification to you to confirm consent approval. At this point, consent status is APPROVED or REJECTED

Use Setu FIP and get access to mock financial data on staging


Call this API to get the consent details and the updated status of a consent request by passing its unique id.

If the consent is approved, the Status in the response will be ACTIVE. After this, you can now initiate Data flow for the approved consent request.

Additionally, Setu AA will notify you on the consent status update by sending a webhook notification to the configured endpoint you entered on the Bridge. See more details on Consent Notifications


Request
GET /consents/:id

Response
{
"url": "https://fiu.setu.co/consents/v2/webview/e082b325-2692-47cd-88cf-875068df9051",
"status": "PENDING",
"context": [],
"vua": "999999999@onemoney",
"consentStart": "2023-04-04T07:10:41.165Z",
"consentExpiry": "2023-08-02T12:40:41.165Z",
"traceId": "26b8bc4c-5d33-43a1-a58f-be5d4d0acbd0"
}
}

If query param expanded=true is included in the request

{
"url": "https://fiu.setu.co/v2/consents/webview/73633c01-d14d-4dbb-8a82-d82e53df5920",
"status": "PENDING",
"detail": {
"purpose": {
"refUri": "https://api.rebit.org.in/aa/purpose/101.xml",
"code": "101",
"text": "Loan",
"category": {
"type": "string"
}
},
"consentStart": "2023-05-22T07:39:41.333Z",
"fiTypes": [
"DEPOSIT",
"EQUITIES",
"MUTUAL_FUNDS",
"GST_GSTR3B",
"GST_GSTR2A",
"GST_GSTR1"
],
"frequency": {
"value": 3,
"unit": "MONTH"
},
"fetchType": "PERIODIC",
"vua": "99999999999@onemoney",
"dataLife": {
"value": 1,
"unit": "YEAR"
},
"consentExpiry": "2023-09-19T13:09:41.333Z",
"dataFilter": [],
"consentTypes": ["TRANSACTIONS", "PROFILE"],
"dataRange": {
"from": "2020-04-01T00:00:00.000Z",
"to": "2023-01-01T00:00:00.000Z"
},
"consentMode": "STORE"
},
"context": [],
"usage": {
"lastUsed": null,
"count": "0"
},
"traceId": "74d3032a-597e-40e1-859b-67b035e8a0e0"
}

Was this page helpful?