---
title: Advanced WhiteLabel
slug: pfm/advanced-whitelabel
createdAt: 2023-11-24T06:57:55.527Z
---

# 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\:BPF4liNmgNQR2fUwWyLuD), each with its own set of configurations and a corresponding pair of credentials (Access Key & Secret Key)

The Advanced Whitelabel URL provides your end users with access to Klavi's whitelabel PFM experience, allowing them to view their PFM data in real time once they have completed the authorization process.

# 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.

:::hint{type="warning"}
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.

:::ExpandableHeading{isOpen="true"}
## Step 1. Create Access Token

You should use the backend system to create an `accessToken`.

Command:

```shell
curl --location 'https://api-sandbox.klavi.ai/pfm/v1/auth' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"accessKey":"string","secretKey":"string"}'
```

Expected response:

```json
{
    "accessToken": "JhbGciOiJFUzI1NiIs.QtYjAyOC1hN2ZhMWFjZGRjZjkiLCJ0.nlTqpAZHeq4P2xFD",
    "expireIn": 1800
}
```
:::

::::ExpandableHeading{isOpen="true"}
## Step 2. Create a Link

Create a Link using the `accessToken` generated earlier.

Command:

```shell
curl --location 'https://api-sandbox.klavi.ai/pfm/v1/links' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"personalTaxId":"string","redirectURL":"string","externalInfo":"Object"}'
```

Expected response:

```json
{
    "pfmId": "a24e4f2a-ebac-433c-9acb-d255bef7c3d9",
    "pfmURL": "https://open.klavi.tech/pfm?pfmToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTQ1NDU5MDgsImlhdCI6MTc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SIsInN1YiI6ImtsYXZpIn0.vWO2FmA30wrWa8UaMg5fHso3sLxdtf6tyrD7C8_5fV8",
    "expireIn": 1800,
    "refreshExpireIn": 86400
}
```

:::hint{type="info"}
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
`pfmToken`: You can assume that this is the token used by the `pfmURL` generated by this endpoint, and its lifecycle is the lifecycle of the `pfmId` and `pfmURL`.
:::
::::



:::ExpandableHeading{isOpen="true"}
## Step 3. Open Link

Opening pfmURL will take you to the PFM home page.
:::



##

