Appearance
Quickstart
Not sure where to start? Find below the testing steps for you to start exploring the Treezor API capabilities in Sandbox.
Tip – Rely on Treezor Webhooks and Dashboard
These tools will allow you to better visualize the results of your testing.
Authenticate to your Sandbox
Reading – Related documentation in API Basics
Environments | Credentials | Authentication | Scope & Permissions
Once you have your client_id
and client_secret
for your Sandbox environment, you can generate your JSON Web Token (JWT) that you will use to authenticate your API requests.
bash
curl -X POST {baseUrl}/oauth/token \
--form 'grant_type="client_credentials"' \ // required
--form 'client_id="<YOUR_CLIENT_ID>"' \ // required
--form 'client_secret="<YOUR_CLIENT_SECRET>"' // required
# --form 'scope="<SCOPE>"' // optional (ex. "admin", "admin read_all")
1
2
3
4
5
2
3
4
5
Returns the access_token
for you to use in the Authorization
header of all your subsequent requests.
json
{
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ0eX[...]PcOIkQ"
}
1
2
3
4
5
2
3
4
5
Note – The access token expires after 1 hour
Read how to extend its lifetime in the Authentication article.
Create a User
Reading – Related documentation
In this example, your end user is a physical person to whom you will offer banking services thanks to Treezor.
You can use the following request to create a physical user.
bash
curl -X POST {baseUrl}/v1/users \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is a {payload}
example:
json
{
"userTypeId":1, // required, 1 is for Physical User
"specifiedUSPerson":0, // required
"title": "M",
"firstname":"Alex",
"lastname":"Oak",
"email":"aoak@example.com", // required, must be unique
"address1":"101 Willow lane", // required to create a Card later on
"phone":"+33102030405" // required to create a Card later on
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Returns the new User with its id
(1545392) that you will use for the next steps.
json
{
"users": [
{
"userId": 8327278,
"userTypeId": 1,
"userStatus": "VALIDATED",
"userTag": "",
"parentUserId": 0,
"parentType": "",
"controllingPersonType": 0,
"employeeType": 0,
"specifiedUSPerson": 0,
"title": "",
"firstname": "Alex",
"lastname": "Oak",
"middleNames": "",
"birthday": "",
"email": "alex.oak@example.com",
"address1": "101 Willow lane",
"address2": "",
"postcode": "",
"city": "",
"state": "",
"country": "",
"countryName": "",
"distributionCountry": null,
"phone": "+33102030405",
"mobile": "",
"nationality": "",
"nationalityOther": "",
"placeOfBirth": "",
"birthCountry": "",
"occupation": "",
"incomeRange": "",
"legalName": "",
"legalNameEmbossed": "",
"legalRegistrationNumber": "",
"legalTvaNumber": "",
"legalRegistrationDate": "0000-00-00",
"legalForm": "",
"legalShareCapital": 0,
"entityType": 0,
"legalSector": "",
"legalAnnualTurnOver": "",
"legalNetIncomeRange": "",
"legalNumberOfEmployeeRange": "",
"effectiveBeneficiary": 0,
"kycLevel": 0,
"kycReview": 0,
"kycReviewComment": "",
"isFreezed": 0,
"isFrozen": null,
"language": "",
"optInMailing": null,
"sepaCreditorIdentifier": "",
"taxNumber": "",
"taxResidence": "",
"position": "",
"personalAssets": "",
"personalAssetsRange": 2,
"createdDate": "2024-11-13 07:40:10",
"modifiedDate": "0000-00-00 00:00:00",
"walletCount": 0,
"payinCount": 0,
"totalRows": "1",
"activityOutsideEu": 0,
"economicSanctions": 0,
"residentCountriesSanctions": 0,
"involvedSanctions": 0,
"address3": null,
"timezone": null,
"occupationType": "",
"isOnStockExchange": 0,
"secondaryAddress1": "",
"secondaryAddress2": "",
"secondaryAddress3": "",
"secondaryPostcode": "",
"secondaryCity": "",
"secondaryState": "",
"secondaryCountry": "",
"clientId": "929252",
"sanctionsQuestionnaireDate": null,
"codeStatus": "110009",
"informationStatus": "",
"legalSectorType": "",
"sourceOfFunds": "",
"distributionCountry": null,
"entitySanctionsQuestionnaire": 0,
"occupationCategory": 5,
"monthlyIncomeRange": 2
}
]
}
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Note – Treezor API offers a variety of Users to fit your use cases
You could also create other types of users, such as Legal Entities and Anonymous Users. Users can also be linked by hierarchical relations referred to as parent-children relations.
Simulate User KYC validation
Reading – Related documentation
In real life, Users must be verified to use Treezor services. This process includes sending documents and declarative data for Treezor to manually approve the User.
In Sandbox, you can use the following request to force the KYC validation, allowing you to proceed with the next steps.
bash
curl -X PUT {baseUrl}/v1/users/{userId} \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is a {payload}
example with the .validated
suffix to approve the KYC in Sandbox:
json
{
"lastname":"Oak.validated"
}
1
2
3
2
3
Returns the new User, but you might not see they are verified right away.
You need to make a /v1/users/{userId}
call to see the User object with the updated kycLevel
and kycReview
.
json
{
"userId":1545392,
"kycLevel":"2",
"kycReview":"2"
// [...] some attributes are hidden
}
1
2
3
4
5
6
2
3
4
5
6
Create a Wallet
Reading – Related documentation
Let's create a payment account, which is represented by the Wallet object in the API. We will define the previously created User as its owner.
bash
curl -X POST {baseUrl}/v1/wallets \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is a {payload}
example:
json
{
"walletTypeId":10, // required, 10 = Payment Account Wallet
"tariffId": 123, // usually required, fees applied to the Wallet, as defined by your contract with Treezor
"userId":1545392, // required, attach this wallet to the previously created user
"currency":"EUR", // required
"eventName":"AO's Account" // required, name the wallet
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Returns a Wallet object, with its id
(826210) and its ready-to-use IBAN:
json
{
"wallets": [
{
"walletId": 2702198,
"walletTypeId": 10,
"walletStatus": "VALIDATED",
"codeStatus": 120005,
"informationStatus": "",
"walletTag": "",
"userId": 1545392,
"userLastname": "Oak.validated",
"userFirstname": "Alex",
"jointUserId": 0,
"tariffId": 136,
"eventName": "AO's Account",
"eventAlias": "ao-s-account-65df2ab48f029",
"eventDate": "2024-03-06",
"eventMessage": "",
"eventPayinStartDate": "2024-02-28",
"eventPayinEndDate": "0000-00-00",
"contractSigned": 0,
"bic": "TRZOFR21XXX",
"iban": "FR7616798000010000270219811",
"urlImage": "",
"currency": "EUR",
"createdDate": "2024-02-28 13:44:36",
"modifiedDate": "0000-00-00 00:00:00",
"payinCount": 0,
"payoutCount": 0,
"transferCount": 0,
"solde": 0,
"authorizedBalance": 0,
"totalRows": 1,
"country": "FR"
}
]
}
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
26
27
28
29
30
31
32
33
34
35
36
37
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Note – Treezor API offers a variety of Wallets to fit your use cases
There are different types of wallets, some requiring KYC validation, some that don't.
Credit the Wallet
Reading – Related documentation
Let's simulate a payin into a Wallet by emulating an incoming SEPA Transfer. These fictitious funds will then be useful to further test Treezor abilities, such as payouts to external accounts, or Wallet-to-Wallet transfers.
Here is the simulation request, in which you must pass the IBAN of the wallet to credit and the amount (integer) to credit as query parameters.
bash
curl -X POST {baseUrl}/simulation/payin-sct?iban={iban}&amount={amount}' \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
1
2
3
2
3
Returns the id of the SCTR, its txId
(transaction id) and its payinId
.
json
{
"sctrs": [
{
"id": 10116,
"txId": "1zS0fKXhAuzDnNBL",
"payinId": 1287763,
"returnReasonCode": null
}
]
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Note – Discover all the ways to credit a Wallet
Treezor offers a large range of payins for you to credit wallets. Learn more in the How to credit wallets article.
Check the Wallet Balance
Let's make sure the Wallet was properly credited by checking its Balance.
Use the following request to retrieve a given Wallet Balance, with the corresponding walletId
expected as a query parameter.
bash
curl -X GET {baseUrl}/v1/balances?walletId=826210 \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
1
2
3
2
3
Returns the Balance object, with both the Authorized Balance (authorizedBalance
) and Balance (currentBalance
).
json
{
"balances": [
{
"walletId": 826210,
"currentBalance": 50, // Actual Balance, as credited in the previous step
"authorizations": 0, // Currently pending authorizations
"authorizedBalance": 50, // Balance, minus pending authorizations
"currency": "EUR", // Currency of the balance
"calculationDate": "2024-02-01 15:52:40" // When the Balance was last actualized
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Tip – Balance History is available
The dedicated Balance History endpoint gives the Balance evolution over time.
Create a Beneficiary
Reading – Related documentation
To send money to bank accounts outside your Treezor environment, you must create a Beneficiary beforehand.
bash
curl -X POST {baseUrl}/v1/beneficiaries \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is an example of {payload}
:
json
{
"userId":123456, // required, user ID allowed to use the beneficiary
"name":"Chris Oak", // Name of the Beneficiary
"tag":"oak-1982", // Custom field you're free to populate
"nickName":"C. Oak checking", // Alias of the Beneficiary
"address":"Woods Bank",
"iban":"FR7616798000010000012345678", // required, IBAN of the Beneficiary
"bic":"TRZOFR21XXX", // required, BIC of the Beneficiary
"usableForSct":true // required, if the Beneficiary can be used for SCT
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Returns the Beneficiary object, with its id
allowing you to send funds to it using a Payout.
json
{
"id": 11XXXX8,
"tag": "oak-1982",
"userId": 22XXXX6,
"nickName": "C. Oak checking",
"name": "Chris Oak",
"address": "Woods Bank",
"iban": "2XXXXXXXX X X 7XXXXXXXXX5 X X 75XXXXXXXX6 X X 1XXXXX4",
"bic": "BNPAFRPP",
"sepaCreditorIdentifier": "",
"sddB2bWhitelist": [],
"sddCoreBlacklist": [],
"usableForSct": true,
"sddCoreKnownUniqueMandateReference": [],
"isActive": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Send funds to an external account
Reading – Related documentation
This sends funds from the created Wallet, to the created Beneficiary using a SEPA transfer.
bash
curl -X POST {baseUrl}/v1/payouts \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is an example of {payload}
with an amount ending in 1.25
for the simulation:
json
{
"walletId":826210, // required, the wallet to debit
"beneficiaryId":{beneficiaryId}, // required, id of the beneficiary created in the previous step
"amount":11.25, // required, must end with 1.25
"currency":"EUR" // required
}
1
2
3
4
5
6
2
3
4
5
6
Returns a Payout object with its id
.
json
{
"payoutId": <integer>,
"payoutTag": "<string>",
"payoutStatus": "<string>",
"payoutTypeId": <integer>,
"payoutType": "<string>",
"walletId": <integer>,
"payoutDate": "<string>",
"walletEventName": "<string>",
"userId": <integer>,
"beneficiaryId": <integer>,
"amount": "<string>",
"currency": "<string>"
// [...] some attributes are hidden
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Tip – SEPA Direct Debit also available
You could also use Direct Debit to debit funds from the Wallet to an external account.
Send funds to another Wallet
Reading – Related documentation
You can also transfer funds from one Wallet to another in your Treezor environment.
bash
curl -X POST {baseUrl}/v1/transfers \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
-d '{payload}'
1
2
3
4
2
3
4
Here is a {payload}
example:
json
{
"walletId":826210, // required, source wallet for the transfer
"beneficiaryWalletId":123456, // required, destination wallet for the transfer
"amount":21.25, // required
"currency":"EUR" // required
}
1
2
3
4
5
6
2
3
4
5
6
Returns a Transfer object.
json
{
"transfers": [
{
"transferId": 4269222,
"transferStatus": "VALIDATED",
"transferTag": "",
"walletId": 826210,
"walletTypeId": 10,
"beneficiaryWalletId": 2301937,
"beneficiaryWalletTypeId": 10,
"transferDate": "0000-00-00",
"walletEventName": "Account A",
"walletAlias": "account-63346a643a7fa",
"beneficiaryWalletEventName": "Main account",
"beneficiaryWalletAlias": "main-account-64ad18c128f29",
"amount": "21.25",
"currency": "EUR",
"label": "",
"transferTypeId": 1,
"createdDate": "2024-02-07 14:17:51",
"modifiedDate": "2024-02-07 14:17:51",
"totalRows": null,
"foreignId": null,
"partnerFee": null,
"codeStatus": "150005",
"informationStatus": null,
"metadata": null
}
]
}
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
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
You can now recheck the balance of the Wallet.
Create a Card to make payments
Reading – Related documentation
If you already have a cardPrint
provided once your Card Program is set up, you can test the creation of Virtual Card and/or Physical Cards.
Let's take the example of the Virtual Card creation.
bash
curl -X POST {baseUrl}/v1/cards/CreateVirtual \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content: application/json' \
-d '{
"userId":1545392, // required, card owner
"walletId":826210, // required, wallet to which the card will be associated
"permsGroup":"TRZ-CU-016", // required, defines a set of permissions for the card
"cardPrint":"{cardPrint}" // required, as a string, defines your card program and card design
}'
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Here is an example of {payload}
:
json
{
"userId":1545392, // required, card owner
"walletId":826210, // required, wallet to which the card will be associated
"permsGroup":"TRZ-CU-016", // required, defines a set of permissions for the card
"cardPrint":"{cardPrint}" // required, as a string, defines your card program and card design
}
1
2
3
4
5
6
2
3
4
5
6
Returns a Card object with its id
, expiration date, CVV, etc.
json
{
"cardId": "10xxxx4",
"userId": "22xxxx7",
"walletId": "2xxxxx1",
"walletCardtransactionId": "2xxxxx1",
"expiryDate": "2023-06-30",
"CVV": "757",
"physical": "0"
// [...] some attributes are hidden
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Note – A lot of options come with your Card Product
You can set withdrawals and payments limits, options for payments, restrictions based on countries, business categories, and merchants. You can also digitize cards with Apple Pay, Google Pay and Samsung Pay.
Simulate a Card Transaction
Reading – Related documentation
Now that you've created a Virtual Card, you may simulate a Card Transaction.
bash
curl -X POST {baseUrl}/simulation/cardtransactions \
--header 'Authorization: Bearer {accessToken}' \
--header 'Content-Type: application/json' \
--data-raw '{payload}'
1
2
3
4
2
3
4
Here is a {payload}
example:
json
{
"publicToken": "103020378",
"date": "2022-02-12 13:00:00",
"amount": 15.90,
"mcc": "8574",
"merchantId": "3256",
"merchantName": "Merchant Name",
"paymentStatus": "A",
"paymentCode": "100000000000004"
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
The request returns a 201
HTTP Status Code without any content.
Note – Disclaimers about this emulation
- No impact on Wallet Balances: A
balance.update
webhook is sent, but values are set to0
. - No refunds and negative amount settlements support yet.