Request a settlement of funds via API
Overview
This API method will initiate a settlement of funds, which will always be sent to the last settlement account for that specific currency.
The first settlement is required to be done through Trustly Back Office as the receiving bank account needs to be registered before a settlement can be processed.
Request example
{
"method": "MerchantSettlement",
"params": {
"Signature": "K5+hjuMqbsH0Ku ... S16VbzRsw==",
"UUID": "258a2184-2842-b485-25ca-293525152425",
"Data": {
"Amount": "800.00",
"Currency": "EUR",
"MessageID": "771463386074",
"Password": "*",
"Username": "your_username",
"Attributes": null
}
},
"version": "1.1"
}
SenderInformation attributes
Parameter name | Description | Required | Type | Example |
---|---|---|---|---|
Username | The username. | Yes | Text | joe |
Password | The password. | Yes | Text | secret |
MessageID | Your unique ID for the payout. If the MessageID is a previously initiated P2P order then the payout will be attached to that P2P order and the amount must be equal to or lower than the previously deposited amount. | Yes | Text | 12345678 |
Amount | The amount to send. See format in Handling currencies. Only digits. Use dot (.) as decimal separator. If the end-user holds a balance in the merchant's system then the amount must have been deducted from that balance before calling this method. | Yes | Text | 98.02 |
Currency | The currency of the amount to send. | Yes | Text | SEK |
Attributes | Attributes for this method. Currently NULL | No | Object |
Response example
{
"result": {
"signature": "K47hjudG6sH0Ku ... S16VbzfG8==",
"uuid": "258a2184-2842-b485-25ca-293525152425",
"method": "MerchantSettlement",
"data": {
"reference": "7653345737",
}
},
"version":"1.1"
}
Response attributes
The result returned is a hash with the following elements:
Hash key | Description | Type | Example |
---|---|---|---|
Reference | The unique reference generated for the settlement. | Text | 7653345737 |
Error codes
These error codes can be returned for MerchantSettlement calls. To handle errors, see Error handling.
Error number | Error code | Description |
---|---|---|
603 | ERROR_INSUFFICIENT_FUNDS | The amount requested is higher than the balance. Try with a lower amount. |
621 | ERROR_NO_SUITABLE_BANK_ACCOUNT_FOUND | No settlement has been performed before for this specific currency. |