Advance WhiteLabel
6 min
introduction the advanced whitelabel is the integration method to use klavi's services with the medium development effort for your company klavi will create one or more partner applications docid\ cjeyeoengid2tkwnbbzmv , each with its own set of configurations and a corresponding pair of credentials (access key & secret key) the advanced whitelabel url will provide to your end user access to klavi's whitelabel consent journey so you can start collecting data sharing consents 1\ generate your credentials as a first step, obtain your application(s) credentials through the klavi console https //www console klavi ai/ these will give you access to klavi sandbox environment whitelabel/apis and enable you to test consent creation and product requests until you are ready to upgrade to a paid plan with live financial institutions and real customers regardless of the environment, please ensure the security of these credentials since they provide full access to klavi apis 2\ welcome your first customer follow the 2 steps below to create a test customer and share some test accounts with open finance step 1 create access token you should use the backend system to create an accesstoken command curl location 'https //api sandbox klavi ai/data/v1/auth' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"accesskey" "string","secretkey" "string"}' expected response { "accesstoken" "jhbgcioijfuzi1niis qtyjayoc1hn2zhmwfjzgrjzjkilcj0 nltqpazheq4p2xfd", "expirein" 1800 } if you need to keep a valid accesstoken in the backend system at all times, please use the refresh endpoint to refresh or call the auth endpoint again to apply for a new accesstoken before the accesstoken reaches its expiration step 2 create a link create a link using the accesstoken generated earlier command curl location 'https //api sandbox klavi ai/data/v1/links' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"personaltaxid" "string","businesstaxid" "string","email" "string","phone" "string","redirecturl" "string","productscallbackurl" "object","externalinfo" "object"}' expected response { "linkid" "4437b139 8a16 11ee b636 487b6bad036a", "linkurl" "https //conecte sandbox klavi ai/path?v=ahbgcioijfuzi1niis ctyjayoc1hn2zhmwfjzgrjzjkilcj0 ultqpazheq4p2xfd", "linktoken" "ahbgcioijfuzi1niis ctyjayoc1hn2zhmwfjzgrjzjkilcj0 ultqpazheq4p2xfd", "expirein" 1800 } you should notice that using this endpoint has generated another linktoken , yes, these are two different tokens accesstoken you can assume that this is the token used by your backend system linktoken you can assume that this is the token used by the linkurl generated by this endpoint, and its lifecycle is the lifecycle of the linkid and linkurl supported body parameters parameter name description personaltaxid automatically fills the user's cpf in the consent journey businesstaxid automatically fills the business cnpj in the consent journey email automatically fills the user/business e mail in the consent journey phone automatically fills the user/business phone in the consent journey institutioncode pre determines the institution from which data will be shared skips institution selection page redirecturl the url klavi will redirect your end user once the consent journey is completed productscallbackurl set one or more product callback urls has higher priority than the receival address configured in klavi console externalinfo used for p artners to transmit information, which will be carried in reports sent to partners customization of the consent journey ui, more details below applink used when the partner wants to display the lgpd step inside their own app (via webview) after the open finance authorization step is completed in the bank environment, the end user is redirected to the url provided in the app link parameter the redirect includes a query parameter whose name is defined by app redirect url key the value of this parameter is the klavi hosted lgpd url, which the partner’s app must open in a webview appredirecturlkey defines the name of the query parameter that klavi will add to the app link url this parameter will contain the klavi hosted lgpd step url as its value the partner’s application must read this parameter and open its value inside a webview 3\ fetch product data you can use web or webview to open the linkurl , make subsequent selection of institutions, redirect to that institution for authentication, and return to the final result web page klavi backend will send you the results through event webhook(even if it is a failed state), after the status change to authorised , you can send the specific report generation request you want based on the end user type(personal or business, their endpoints are different) command curl location 'https //api sandbox klavi ai/data/personal/institution data' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'authorization bearer jhbgcioijfuzi1niis qtyjayoc1hn2zhmwfjzgrjzjkilcj0 nltqpazheq4p2xfd' \\ \ data '{"taxid" "string","institutionid" "string","linkid" "string","consentid" "array","products" "array","productscallbackurl" "object"}' expected response { "requestid" "1325412e e566 4f4e ac5b 2f4471586b89", "message" "ok" } after you submit a request to generate specific or all report(the report you want to purchase has already been limited by klavi backend), klavi randomly starts retrieving data from the institution and processing it to generate the corresponding report, which will be sent to you through the report webhook klavi also supports not having to actively call this endpoint after you go living or move to production, you can proactively send all the reports you need through the report webhook after authorization is completed, or send them to klavi's storage space you can download them at any time through the klavi console https //console klavi ai


