This section will guide you through the essential steps to integrate your third-party platform with our APIs. Following these steps, you can register as a Third Party Provider (TPP), generate necessary tokens, and establish secure communication with our services.
Panel |
---|
|
Register as a Third Party Provider (TPP) |
To begin integrating with Leatherback, you must register as a Third Party Provider (TPP). This registration process involves making an API call to our registration endpoint.
...
Content-Type: application/json
signature-certificate: <Set your signature certificate here. This is a password-like text>
Code Block |
---|
|
{
"countryISO": "GB",
"address": "1 Roada Way, Calculta",
"name": "Cway Bottle Company",
"email": "cway-bottle@finance.co",
"certificateType": "account",
"callbackUrl": "https://webhook.site/0994061c-ba69-40cb-99a8-94c54e692eab"
} |
Code Block |
---|
curl -X POST "https://api-openbanking.leatherback.co/api/account/registration" \
-H "Content-Type: application/json" \
-d '{
"countryISO": "GB",
"address": "1 Roada Way, Calculta",
"name": "Cway Bottle Company",
"email": "cway-bottle@finance.co",
"certificateType": "account",
"callbackUrl": "https://webhook.site/0994061c-ba69-40cb-99a8-94c54e692eab"
}' |
...
Code Block |
---|
|
{
"Certificate": "Adaobi@",
"ClientId": "74EB610C710938923806817AD4631EB3",
"Message": "OK"
} |
Panel |
---|
|
Generate a Client Token |
Once registered as a TPP, the next step is to generate a client token. This token is necessary for authenticating subsequent API calls.
...
Content-Type: application/x-www-form-urlencoded
...
Code Block |
---|
curl -X POST "https://api-openbanking.leatherback.co/auth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "password=your-certificate&client_id=your-client-id&scope=account&grant_type=client_credentials" |
...
Code Block |
---|
|
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjVEODhEQjBDMDMyMzRENjQ5NEM1NDI0ODEzRkFBQTkxIiwiY2VydGlmaWNhdGUiOiJBZGFvYmk5M0AiLCJuYmYiOjE3MTk4NTU2MTksImV4cCI6MTcxOTg1NTkxOSwiaWF0IjoxNzE5ODU1NjE5fQ.d6PLd8n06fLTx98vbOSSMJSo5AVFZ-lnMmjZuZsuO3c",
"token_type": "Bearer",
"expires_in": 63919
} |
Panel |
---|
|
Create Client Consent |
After generating a client token, the next step is to create client consent. This step involves generating a consentId in our systems so we can tie consent requests to you as a TPP.
In this tutorial, you create a consent for any of the following available permissions:
Permissions | Dependencies |
---|
ReadAccountsBasic | None |
ReadAccountsDetail | None |
...
Content-Type: application/json
Authorization: Bearer {access_token}
...
Code Block |
---|
|
{
"Data": {
"Permissions": [
"ReadAccountsBasic",
"ReadBeneficiariesBasic",
"ReadBeneficiariesDetail"
],
"ExpirationDateTime": "2024-06-30T08:38:43.527Z",
"TransactionFromDateTime": "2024-06-29T08:38:43.527Z",
"TransactionToDateTime": "2024-06-30T08:38:43.527Z"
},
"Risk": {}
} |
...
Code Block |
---|
curl -X POST "https://api-openbanking.leatherback.co/account-access-consents" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-access-token" \
-d '{
"Data": {
"Permissions": [
"ReadAccountsBasic",
"ReadBeneficiariesBasic",
"ReadBeneficiariesDetail"
],
"ExpirationDateTime": "2024-06-30T08:38:43.527Z",
"TransactionFromDateTime": "2024-06-29T08:38:43.527Z",
"TransactionToDateTime": "2024-06-30T08:38:43.527Z"
},
"Risk": {}
}' |
...
Code Block |
---|
{
"Data": {
"Status": "AwaitingAuthorisation",
"StatusUpdateDateTime": "2024-07-01T17:46:17.6950484Z",
"CreationDateTime": "2024-07-01T17:46:17.6950483Z",
"TransactionToDateTime": "2024-06-30T08:38:43.527Z",
"ExpirationDateTime": "2024-06-30T08:38:43.527Z",
"Permissions": [
"ReadAccountsBasic",
"ReadBeneficiariesBasic",
"ReadBeneficiariesDetail"
],
"ConsentId": "9584b369-44dc-450e-8403-d04945e623bd",
"TransactionFromDateTime": "2024-06-29T08:38:43.527Z"
},
"Risk": {},
"Links": {
"Self": "https://app-leatherbackwebsite-stg.azurewebsites.net/create-consent?consentId=b23b4a2f-0c10-4d74-a05a-80ca3d0f6963&callbackUrl=https://app.mono.co/"
},
"Meta": {
"TotalPages": 1
}
} |
Panel |
---|
|
Create JWT URL Parameters Token |
After you create a consent, you need the user to authorize the consent so that you can access the data on their behalf. To facilitate this, you must create a JWT request parameter.
...
Code Block |
---|
{
"alg": "PS256",
"kid": "<insert kid>"
} |
...
Code Block |
---|
{
"response_type": "code id_token",
"client_id": "<insert client_id>",
"redirect_uri": "<insert redirect_uri>",
"scope": "accounts",
"claims": {
"id_token": {
"openbanking_intent_id": {
"value": "<insert ConsentId>"
}
}
}
} |
...