Appearance
Are you an LLM? You can read better optimized documentation at /guide/wallets/faking-operations.md for this page in Markdown format
Emulation
Emulation features are only available in Sandbox
environment.
Tip – You can also rely on webhooks
For operations that cannot be emulated in the Sandbox, webhook examples are provided.
Credit funds
To credit funds, check out the transfer emulations page.
Operations
You can emulate Operations in Sandbox for a given month. This is a prerequisite to test the Account Statements.
Parameters
Attribute | Type | Description |
---|---|---|
walletId | string | The Wallet for which you wish to emulate operations. |
date | string | The month for which the operations are going to be emulated. Please note that you can't emulate operations multiple times for the same month. |
operations | object | In this object, you can list the number of operations to generate per operation as in the example. As Treezor generates operations with random values (including for types and statuses), it is recommended to have a reasonably high number of payins and payouts for data diversity. |
Request example
Endpoint: /simulation/operations
bash
curl -X POST {baseUrl}/simulation/operations \
--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
{
"walletId": "{walletId}",
"date": "2023-10",
"operations": {
"payin": 5,
"payinrefund": 2,
"payout": 6,
"payoutrefund": 1,
"transfer": 3,
"cardtransaction": 7,
"transferfees": 2,
"transfercreditnote": 1
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Returns an HTTP 201 Created
status code. You can now view your operations by either:
- Generating an account statement
/core-connect/statements/{walletId}/raw
- Retrieving operations
/core-connect/operations
Status
Wallets are created in a pending status that is usually very shortly after validated.
To emulate a different status, prefix the Wallet eventName
attribute with the following characters.
Prefix | walletStatus | codeStatus | Description |
---|---|---|---|
p.1 | PENDING | 120001 | Information control |
p.2 | PENDING | 120002 | Late information control |
c.3 | CANCELED | 120003 | Wallet was closed internally |
c.4 | CANCELED | 120004 | Wallet was closed by the User |
v.5 | VALIDATED | 120005 | Wallet is valid |
Wait a few minutes and make a GET /v1/wallets
request for the Wallet you've just created. The API returns the Wallet with the emulated status.
Example
Let's take an example in which we'd like to simulate a Wallet closed by the User.
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
With a {payload}
containing the prefixed eventName
:
json
{
"walletTypeId": "10",
"tariffId": 136,
"userId": 100113410,
"currency": "EUR",
"eventName": "c.4Test Wallet"
}
1
2
3
4
5
6
7
2
3
4
5
6
7
The request returns the validated Wallet for now.
You need to retrieve the Wallet a few moments after the creation with the following request:
bash
curl -X GET '{baseUrl}/v1/wallets/{WalletId}' \
--header 'Authorization: Bearer {accessToken}' \
1
2
2
The Wallet object returned is CANCELED
, with the mocked codeStatus
:
json
{
"wallets": [
{
"walletId": 2643119,
"walletTypeId": 9,
"walletStatus": "CANCELED",
"codeStatus": 120003,
"informationStatus": "",
"walletTag": "",
"userId": 100113410,
"userLastname": "Alex",
"userFirstname": "Oak",
"tariffId": 136,
"eventName": "c.3test",
"eventMessage": "",
"contractSigned": 0,
"bic": "TRZOFR21XXX",
"iban": "FR7616798000010000264311929",
"currency": "EUR",
"createdDate": "2024-02-06 06:57:56",
"modifiedDate": "2024-02-06 06:58:16",
"payinCount": 0,
"payoutCount": 0,
"transferCount": 0,
"solde": 0.0,
"authorizedBalance": 0.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
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