Skip to content

Emulation

Emulation features are only available in Sandbox environment.

Bulb icon

Tip – You can also rely on webhooks

For operations that cannot be emulated in the Sandbox, webhook examples are provided.

SDDR

SDDR Core emulation can be done using th dedicated POST /simulation/payout-sddr endpoint.

Parameters

AttributeTypeDescription
debitorIbanstringIBAN or Virtual IBAN of the debited Wallet.
amountintegerAmount of the SDD (will be divided by the nbTxs).
Decimal amounts are not supported.
typeSDDstringEither CORE (default) or B2B.
typeRejectstringThe type of error returned if the SDDR fails. Can be: rejected (default), returned, refunded, or today (specifies that we want the SDDR to be executed today).
scistringThe SEPA Credit Identifier of the user. In the case of simulation, this defaults to a random string.
nbTxsintegerThe number of transactions for the SDD. Defaults to 1.
mandateIdintegerThe Beneficiary Mandate unique identifier. This field is optional.
executeAfterParseintegerWhen set to 1, launch the job to execute pending SDDRs on the due date (must be used in combination with typeReject = today).

Request

bash
curl -X POST {baseUrl}/simulation/payout-sddr \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{
  "amount": "26",
  "debitorIban": "FR7616798000010000071474474", 
  "sci": "FR44ZZZ332801",
  "typeSDD":"CORE",
  "typeReject":"today",
  "executeAfterParse":1
}

Response example (if executeAfterParse is set to 1):

json
{
    "messages":[
        "[Simulation] [POST /payoutSddr] CORE SDDR created",
        "[Simulation] batchExecuteSddr() launched"
    ]
}

SDDE

The following request can be used to emulate an SDDE in your Sandbox.

Paperclip icon

Prerequisites – Prior to emulating an SDDE, you must have a KYC validated legal entity with

  • A SEPA Creditor Identifier (SCI) – To enable a SCI, please contact your Treezor Account Manager.
  • A signed Mandate – Must be the correct sddType.

Mandatory parameters

AttributeTypeDescription
walletIdintegerThe unique identifier of the Wallet to credit.
paymentMethodIdintegerSet this value to 21 for crediting funds in Sandbox only.
amountfloatThe amount to credit. Must end with 1.25.
currencystringThe currency of the transfer. Must be EUR.
mandateIdintegerThe unique identifier of the Mandate.

Request

bash
curl -X POST {baseUrl}/v1/payins \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{
	"walletId":"{walletId}",
	"userId":"{userId}",
	"paymentMethodId":21,
	"amount":1.25,
	"currency":"EUR",
	"mandateId":"{mandateId}"
}

Returns a Payin object.

json
{
	"payins": [
		{
			"payinId": "<integer>",
			"payinTag": "<string>",
			"payinStatus": "<string>",			
			"codeStatus": "<integer>",
			"informationStatus": "<string>",
			"walletId": "<integer>",			// id of the wallet to credit
			"userId": "<integer>",
			"amount": "<string>",
			"currency": "<string>",
			[...] // some attributes are hidden
		}
	]
}
Note icon

Note – Funds availability latency

Funds are usually available in the Wallet within 5 minutes following the request.

SCTR

SCTR emulation can be useful in multiple situations, including the emulation of recalls.

Query parameters

The following query parameters are required.

AttributeTypeDescription
ibanstringThe IBAN of the Wallet to credit.
amountintegerThe amount to credit. Decimal amounts are not supported.

Request

bash
curl -X POST {baseUrl}/simulation/payin-sct?iban={iban}&amount={amount}' \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \

Returns the id of the SCTR, its txId (transaction id) and its payinId.

json
{
    "sctrs": [
        {
            "id": 10022,
            "txId": "xxCN7gLRpqmjS6p5",
            "payinId": 1234567,
            "returnReasonCode": null
        }
    ]
}
Bulb icon

Tip – The returnReasonCode provides more information

The returnReasonCode can inform you of the reason for a rejection, in which case the payinId will be null.

Accepted SCTR

Refused SCTR

  • The IBAN can be erroneous (you can for example use FR76169999999999999999999) or,
  • The User KYC status can be NONE/PENDING or,
  • The Wallet status can be PENDING or CANCELED

Legacy

SCTR Emulation can also be achieved using the same procedure as for SDDE, by changing the paymentMethodId to 20.

SCTR Inst

To emulate an SCTR Inst, you can use the following request.

bash
curl -X POST {baseUrl}/simulation/sct-inst/payin \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{
  "name":"M. Firstname LASTNAME", 	  // Name of the recipient (User)
  "bic":"TRZOFR21XXX",                // BIC of the recipient (User)
  "iban":"FR76167980019999999999999", // IBAN of the recipient (Wallet)
  "currency":"EUR", 
  "amount":10.0
}

Outputs an object containing the paymentID and sctInstID.

json
{
    "sctInstID": "2333c7a8-25c5-54ff-a06e-7ed2bd8c2f66",
    "paymentID": "RECEPTION_6cde3d9f-58d2-11ec-8593-86285561c46d"
}

The sctInstID can be used to retrieve the payin using the GET /v1/payins/{sctInstId} endpoint.

Accepted SCTR Inst

For an emulated SCTR Inst to be accepted:

  • The IBAN must be valid and,
  • The Wallet must be validated.

Refused SCTR Inst

The emulated SCTR Inst may be refused if:

  • The IBAN can be erroneous (you can for example use FR76169999999999999999999) or,
  • The Wallet status can be PENDING or CANCELED
  • The SCTR Inst amount can be greater that €10,000 in a B2C context or greater than €50,000 in a B2B context

In which case, you'll receive a sepaSctrInst.reject_sctr_inst webhook.

SCTR Recalls

To initiate an SCTR Recall, you can use the following request.

Paperclip icon

Prerequisites – You need an SCTR first

A valid SCTR must have been emulated beforehand.

Parameters

AttributeTypeDescription
cxlIdstringThe unique identifier of the Recall. We recommend that you use the SCTR's id.
statusIdintegerThe status of the recall resource. For simulation purposes, you must set this to 2 (PENDING_PAYIN_REFUND_CREATED).
sctrIdintegerThe SCTR's id as provided by the SCTR simulation endpoint.
reasonCodestringReason code of the recall request see available values.
createPayinRefundbooleanCreates a payinrefund resource and receives the corresponding webhooks if set to true.

Request

bash
curl -X POST {baseUrl}/simulation/recall-r' \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{ 
  "cxlId": "401", 
  "statusId": 2, 
  "sctrId": 401, 
  "txId": "401", 
  "reasonCode": "TECH", 
  "createPayinRefund": true 
}

Returns the id of the Recall.

json
{
	"recalls": {
    	"id": 10
	}
}

SCTR Inst Recalls

To initiate an SCTR Inst Recall, you can use the following request.

Paperclip icon

Prerequisites – You need an SCTR Inst first

A valid SCTR Inst must have been emulated beforehand.

Parameters

AttributeTypeDescription
sctInstIdstringThe SCTR Inst's id as provided by the SCTR Inst simulation endpoint.
demandDatestringThe date of the recall request.
reasonCodestringThe reason code of the recall request see available values.
additionalInformationstringInformation on top of the recall reason code you want to receive (can only be used with reasonCode of type FRAD).

Request

bash
curl -X POST {baseUrl}/simulation/sct-inst/recall \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is a {payload} example:

json
{ 
	"sctInstId": "1380aeca-963b-5497-aef4-a9532086653c",
	"demandDate": "2022-11-24",
	"reasonCode": "FRAD",
	"additionalInformation": ""
}

Returns the id for the Recall:

json
{
    "sctInstId": "c8457258-b18c-5647-9950-9ba3c99a9543",
    "recallrId": "f3f6a9c8-2f4b-5906-9ac7-2d908d04b681"
}

SCTE

Emulating SCTE in Sandbox only requires you use your regular payout endpoint. Any amount will return a PENDING status (and the Wallet Balance will be updated the day after around 10:30AM Paris time), except for amounts ending in 1.25.

For the later, retrieving the Payout shortly after will return a VALIDATED result, and the debited Wallet Balance is updated at the same time.

Mandatory parameters

AttributeTypeDescription
walletId integerThe unique identifier of the debited Wallet.
beneficiaryId integerThe unique identifier of the Beneficiary of the Transfer. You must have created the Beneficiary object beforehand.
amount floatThe amount of the credit transfer. Must end with 1.25 for a VALIDATED result.
currency stringThe currency of the credit transfer. Must be EUR.

Request

bash
curl -X POST {baseUrl}/v1/payouts \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{
	"walletId":{walletId},
	"beneficiaryId":{beneficiaryId},
	"amount":11.25,
	"currency":"EUR"
}

Returns a Payout object.

json
{
    "payouts": [
        {
            "payoutId": 191317,
            "payoutTag": "",
            "payoutStatus": "PENDING",
            "payoutTypeId": 1,
            "payoutType": "Credit Transfer",
            "walletId": 2548369,
            "payoutDate": "0000-00-00",
            "walletEventName": "wallet transfer",
            "walletAlias": "wallet-transfer-65844f47b3766",
            "userFirstname": "Alex",
            "userLastname": "Oak",
            "userId": 4248201,
            "bankaccountId": 0,
            "beneficiaryId": 411981,
            "uniqueMandateReference": "",
            "bankaccountIBAN": "",
            "label": "payout_test",
            "amount": "11.25",
            "currency": "EUR",
            "partnerFee": "0",
            "createdDate": "2024-04-03 12:06:48",
            "modifiedDate": "0000-00-00 00:00:00",
            "virtualIbanId": null,
            "virtualIbanReference": null,
            "codeStatus": "160001",
            "informationStatus": "Demande de remboursement saisie",
            "supportingFileLink": "",
            "endToEndId": null,
            "reasonCode": null,
            "reasonDescription": null,
            "metadata": null,
            "totalRows": 1
        }
    ]
}

You can use the /v1/payouts/{payoutId} endpoint to view the updated payout with its VALIDATED status.

json
{
    "payouts": [
        {
            "payoutId": 191317,
            "payoutTag": "",
            "payoutStatus": "VALIDATED",
            "payoutTypeId": 1,
            "payoutType": "Credit Transfer",
            "walletId": 2548369,
            "payoutDate": "2024-04-03",
            "walletEventName": "wallet transfer",
            "walletAlias": "wallet-transfer-65844f47b3766",
            "userFirstname": "Alex",
            "userLastname": "Oak",
            "userId": 4248201,
            "bankaccountId": 0,
            "beneficiaryId": 411981,
            "uniqueMandateReference": "",
            "bankaccountIBAN": "",
            "label": "payout_test",
            "amount": "11.25",
            "currency": "EUR",
            "partnerFee": "0",
            "createdDate": "2024-04-03 12:06:48",
            "modifiedDate": "2024-04-03 12:07:06",
            "virtualIbanId": null,
            "virtualIbanReference": null,
            "codeStatus": "160005",
            "informationStatus": "Remboursement par virement Validé",
            "supportingFileLink": "",
            "endToEndId": null,
            "reasonCode": null,
            "reasonDescription": null,
            "metadata": null,
            "totalRows": 1
        }
    ]
}

SCTE Inst

Emulating SCTE in Sandbox only requires you use your regular payout endpoint.

Prerequisites:

  • User must be KYC validated.
  • Beneficiary userId and Wallet owner must be the same User.
  • Necessary funds must be available on the debited Wallet.

Mandatory parameters

AttributeTypeDescription
payoutTypeId integerMust be 3 for an SCTE Inst.
walletId integerThe unique identifier of the debited Wallet.
beneficiaryId integerThe unique identifier of the Beneficiary of the transfer. You must have created the Beneficiary object beforehand.
amount floatThe amount of the credit transfer, which value defines the result of the emulation:
  • VALIDATED – Provide an amount stricly below 1000.00
  • CANCELED – Provide an amount stricly above 1000.00
currency stringThe currency of the credit transfer. Must be EUR.

Request

bash
curl -X POST {baseUrl}/v1/payouts \
	--header 'Authorization: Bearer {accessToken}' \
	--header 'Content-Type: application/json' \
	-d '{payload}'

Here is an example of {payload}:

json
{
    "payoutTypeId":"3",
	"walletId":{walletId},
	"beneficiaryId":{beneficiaryId},
	"amount":800.00,
	"currency":"EUR"
}

Returns a Payout object.

json
{
    "payouts": [
        {
            "payoutId": "8929329c-b4a5-4bb9-b792-0e9e9d98xxxa",
            "payoutTag": "",
            "payoutStatus": "PENDING",
            "payoutTypeId": 3,
            "payoutType": "Instant Credit Transfer",
            "walletId": 3059736,
            "payoutDate": "2024-06-26 10:15:17",
            "walletEventName": "Name of the Wallet",
            "walletAlias": "name-of-the-wallet-667bcd66d546b",
            "userFirstname": "Alex",
            "userLastname": "Oak.validated",
            "userId": 965725,
            "bankaccountId": 0,
            "beneficiaryId": 40963,
            "uniqueMandateReference": "",
            "bankaccountIBAN": "FR761679800001000030XXXXXX3",
            "label": "",
            "amount": "800.00",
            "currency": "EUR",
            "partnerFee": "0",
            "createdDate": "2024-06-26 10:15:17",
            "modifiedDate": "",
            "virtualIbanId": null,
            "virtualIbanReference": null,
            "codeStatus": "160001",
            "informationStatus": "PENDING",
            "supportingFileLink": "",
            "endToEndId": "8929329cb4a54bb9b7920e9xxx8891a",
            "reasonCode": null,
            "reasonDescription": null,
            "metadata": null,
            "totalRows": null
        }
    ]
}

You can use the /v1/payouts/{payoutId} endpoint to view the updated payout with its VALIDATED status.

json
{
    "payouts": [
        {
            "payoutId": "8929329c-b4a5-4bb9-b792-0e9e9d98xxxa",
            "payoutTag": "",
            "payoutStatus": "VALIDATED",
            "payoutTypeId": 3,
            "payoutType": "Instant Credit Transfer",
            "walletId": 3059736,
            "payoutDate": "2024-06-26 10:15:17",
            "walletEventName": "Name of the Wallet",
            "walletAlias": "name-of-the-wallet-667bcd66d546b",
            "userFirstname": "Alex",
            "userLastname": "Oak.validated",
            "userId": 965725,
            "bankaccountId": 0,
            "beneficiaryId": 40963,
            "uniqueMandateReference": "",
            "bankaccountIBAN": "FR761679800001000030XXXXXX3",
            "label": "",
            "amount": "800.00",
            "currency": "EUR",
            "partnerFee": "0",
            "createdDate": "2024-06-26 10:15:17",
            "modifiedDate": "",
            "virtualIbanId": null,
            "virtualIbanReference": null,
            "codeStatus": "160004",
            "informationStatus": "VALIDATED",
            "supportingFileLink": "",
            "endToEndId": "8929329cb4a54bb9b7920e9xxx8891a",
            "reasonCode": null,
            "reasonDescription": null,
            "metadata": null,
            "totalRows": null
        }
    ]
}