Appearance
Emulation
Emulation features are only available in Sandbox
environment.
Simulate SCA Proof
The /simulation/scaProof
endpoint allows you to simulate an SCA proof.
Parameters
Attribute | Type | Description |
---|---|---|
scaWalletId | string | The unique identifier of the SCA Wallet from which the scaProof is to be created. |
url | string | The URL of the endpoint for which the sensitive action is to be secured with strong customer authentication. |
body | string | Data to sign in the SCA proof body. See the Per Operation table to know which data to sign for each endpoint. |
Request
In order to generate an SCA Proof in Sandbox, you must use a JWT accessToken
with a client_credentials
grant type and the admin
scope. See the Authentication article for more information.
bash
curl -X POST {baseUrl}/simulation/scaProof \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json'
1
2
3
2
3
Here is a {payload}
example:
json
{
"scaWalletId": "string", // required
"url": "string", // optional
"body": {"string"} // optional
}
1
2
3
4
5
2
3
4
5
Returns the SCA proof.
json
{
"scaProof": "string"
}
1
2
3
2
3
Worked example
Let's take an example where you want to test in Sandbox the creation of a new Beneficiary, an action which requires strong customer authentication.
The steps are the following:
- Use the simulator as the App
- Simulate an SCA proof as the App
- Authenticate as end user
- Simulate SCA Proof as App
- Create the beneficiary as end user
Prerequisites
A User must be already created, with an active SCA Wallet.
1. Use the simulator as the App
Authenticate as the application to use the simulator. Here is the authentication request:
bash
curl -X POST {baseUrl}/oauth/token \
--form 'grant_type="client_credentials"' \
--form 'client_id="{clientId}"' \
--form 'client_secret="{clientSecret}"' \
--form 'scope="admin"'
1
2
3
4
5
2
3
4
5
Returns the Bearer token:
json
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ0_XXX_DSnw"
}
1
2
3
4
5
2
3
4
5
2. Simulate an SCA proof as the App
Use the simulator to create an SCA proof that you'll be able to use to authenticate as the end user in the next step.
bash
curl -X POST {baseUrl}/simulation/scaProof \
--header 'Authorization: Bearer eyJ0_XXX_DSnw' \
--header 'Content-Type: application/json' \
--data '{payload}'
1
2
3
4
2
3
4
With the user's scaWalletId
in the {payload}
:
json
{
"scaWalletId": "e59b5fadd69f4d2693a60492b0334464"
}
1
2
3
2
3
Returns the SCA Proof:
json
{
"scaProof": "eyJh_NDN9.WQBp_Xg7w"
}
1
2
3
2
3
3. Authenticate as end user
Authenticate as the end user to create the beneficiary. Here is the authentication request:
bash
curl -X POST {baseUrl}/oauth/token \
--form 'grant_type="delegated_end_user"' \
--form 'client_id="{clientId}"' \
--form 'client_secret="{clientSecret}"' \
--form 'scope="read_write"' \
--form 'username="101109094"' \
--form 'password="bc6ead2bbcd9cc409ba53d9cfbf145a667647414eae496xxxx75636b15384a8"' \
--form 'sca="eyJh_NDN9.WQBp_Xg7w"'
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Returns the Bearer token:
json
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ0_XXX_q44Q"
}
1
2
3
4
5
2
3
4
5
4. Simulate SCA Proof as App
bash
curl -X POST {baseUrl}/simulation/scaProof \
--header 'Authorization: Bearer eyJ0_XXX_DSnw' \
--header 'Content-Type: application/json' \
--data '{payload}'
1
2
3
4
2
3
4
With the following {payload}
which contains the data to sign:
json
{
"scaWalletId": "e59b5fadd69f4d2693a60492b0334464",
"url": "https://yourcompanyname.sandbox.treezor.co/v1/beneficiaries",
"body": {
"userId": "101109094",
"name": "Alex Oak",
"adress": "33 av de Wagram Paris",
"iban": "FR1130003000305928344XXXXX",
"bic": "SOGEFRPPXXX",
"usableForSct": true
}
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Returns the SCA Proof:
json
{
"scaProof": "eyJh_UxfQ.nNIH_n9kA"
}
1
2
3
2
3
5. Create the beneficiary as end user
bash
curl -X POST {baseUrl}/v1/beneficiaries \
--header 'Authorization: Bearer eyJ0_XXX_q44Q' \
--header 'Content-Type: application/json'\
--data '{payload}'
1
2
3
4
2
3
4
With the following {payload}
:
json
{
"userId": "101109094",
"name": "Alex Oak",
"adress": "33 av de Wagram Paris",
"iban": "FR1130003000305928344XXXXX",
"bic": "SOGEFRPPXXX",
"usableForSct": true,
"sca":"eyJh_UxfQ.nNIH_n9kA"
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Returns the Beneficiary object:
json
{
"beneficiaries": [
{
"id": 527977,
"tag": "",
"userId": 101109094,
"nickName": "",
"name": "Alex Oak",
"address": "",
"iban": "3537524356444355504255444055564B574C405157455041XXXX",
"bic": "SOGEFRPPXXX",
"sepaCreditorIdentifier": "",
"sddB2bWhitelist": [],
"sddCoreBlacklist": [],
"usableForSct": true,
"sddCoreKnownUniqueMandateReference": [],
"isActive": true,
"createdDate": "2024-11-21 08:05:56",
"modifiedDate": "2024-11-21 08:05:56",
"metadata": {
"iban": "FR1130003000305928344XXXXX"
}
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25