...
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
How do we manage consent today?Proposed solution
Consent Management APIsOverviewTwo types of actions can be carried out on a customer account by a client:
Types of clientsInternal
External (Third-party providers)
Process for getting consent
Step 0: Register a clientTo register a client we need the following information.
|
Code Block | ||
---|---|---|
| ||
Endpoint: /auth/token Method: POST Payload: { grant_type: "client_credentials", scope: [account], // can be accounts or payments or both clientID: "109130" // client that is requesting access } |
Code Block | ||
---|---|---|
| ||
Response { status: "successful" "access_token": "xxx-sdffs-ffsfsf", "expires_in": "6000", "scope": "accounts" } |
Step 2: Create a Consent
Consent management for Account operations
This allows a client to access user account information. The client must also have permission to access the information based on the list below:
Permission | Who can access |
---|---|
ReadAccountsBasic | |
ReadAccountsDetail | |
ReadBalances | |
ReadBeneficiariesBasic | |
ReadBeneficiariesDetail | |
ReadDirectDebits | |
ReadScheduledPaymentsBasic | |
ReadScheduledPaymentsDetail | |
ReadStandingOrdersBasic | |
ReadStandingOrdersDetail | |
ReadTransactionsBasic | |
ReadTransactionsCredits | |
ReadTransactionsDebits | |
ReadTransactionsDetail | |
UpdateAccountDetail | |
UpdateAccountStatus |
Code Block | ||
---|---|---|
| ||
Endpoint: /request-consent Method: POST Authorization: Bearer xxx-sdffs-ffsfsf //token from previous step Payload: { Permissions: [ReadAccountsDetail, ReadBalances] } |
Code Block | ||
---|---|---|
| ||
Response { status: "pending" //waiting for user consent, consentID: "65f82acd00000003aa9028d" } |
Step 3: User Flow
Trigger user flow with the consent ID
Code Block | ||
---|---|---|
| ||
Endpoint: /consent/initiate Method: POST Authorization: Bearer xxx-sdffs-ffsfsf //token from previous step Payload: { ConsentID: "65f82acd00000003aa9028d", // to identify consent scope: "accounts", //or payments redirect_url: "https://reddit.com/redirect", clientID: "109130", meta: { }, customerID: ahmedtijaniumar@gmail.com // Moniepoint user ID } |
Code Block | ||
---|---|---|
| ||
Response when user completes flow. We can attach this to redirect_url or send as webhooks
{
status: "successful"
ConsentID: "65f82acd00000003aa9028d",
code: "code_jsdnjsbfssfissj",
} |
We can map the consent request to the user using the “customerID”.
For users with the mobile app:
Push notification requesting their consent
Redirect them to a screen in the app that brings up 2FA (OTP + face verification)
On successful verification, the following will be displayed for the user to review:
Details of the client requesting consent
Permissions granted to the client
The user can click a button to approve the consent request
Unhappy path: The user can also reject a consent request
For users with USSD
Dial a shortcode to grant approval for approve the pending consent request
Enter your passcode to confirm consent
For users without access to digital channel
Generate a consent link for the users
Redirect them to a widget that brings up 2FA (OTP or face verification)
On successful verification, the following will be displayed for the user to review:
Details of the client requesting consent
Permissions granted to the client
The user can click a button to approve the consent request
Unhappy path: The user can also reject a consent request
Step 4: Exchange Authorization Token
Get a permanent token for customer consent
Code Block | ||
---|---|---|
| ||
Endpoint: /auth/token Method: POST Payload: { grant_type: "auth_code", expires_in: "60000"// in ms code: "code_jsdnjsbfssfissj", // code from user consent step clientID: "109130" // client that is requesting access } |
Step 5: Query the API
Use the authorization token gotten for the user’s account from previous step to call the API, to either update or return customer information
Consent management for payments
What does success look like?
...