Trustly
Trustly provides payments directly from bank accounts in Europe, and is a popular way to pay in the Nordic countries. With Trustly, you can offer customers who prefer not to pay with cards a way to pay online using their bank accounts.
Payment type | Online banking |
Payin countries | Austria, Denmark, Estonia, Finland, Germany, Latvia, Lithuania, Netherlands, Norway, Spain, Sweden, United Kingdom |
Payout countries | Austria, Belgium, Bulgaria, Croatia, Cyprus, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden, United Kingdom |
Customer currencies | BGN, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, SEK |
Processing currencies | BGN, CZK, DKK, EUR, GBP, HRK, HUF, NOK, PLN, RON, SEK |
Refunds | Yes |
How to pay with Trustly
- Customers are redirected to a Trustly-hosted payment page where they see a list of available banks in their country.
- They select their bank and are prompted to provide their online banking log-in credentials and authenticate as they would when logging into their online bank account.
- They select the account from where they want to make the payment and are prompted to provide a one-time code to confirm the payment.
- After they complete the payment, they are redirected back to your website or app.
If you want to use Trustly logos in your marketing materials or on the checkout page, please use official guidelines from Trustly. Trustly’s design guidelines has different logo formats and designs which can be used in your materials.
General flow
POST Request -> to /payment_preauthorize
<- Response (direct, synchronous) with status=2000&errormessage=pending and redirect_url
Customer is redirected to redirect_url (Trustly URL)
<- Callback (asynchronous) with errorcode=0&payment_state=not_credited_yet to notification_url
<- Callback (asynchronous) with errorcode=0&payment_state=credited to notification_url
Step 1. Make a transaction request
From your server, make a POST /payment_preauthorize request.
POST https://sandbox.payabl.com/pay/backoffice/payment_preauthorize
Include in request:
Parameter | Format | Description |
---|---|---|
merchantid | 40 characters | Merchant identification number assigned during account creation |
orderid | max. 40 characters | The field orderid is optional and exclusively for the merchants' convenience |
amount | digits only, either no decimals or two decimal places (e.g. 8 or 8.50) | Transaction’s total amount that will be deducted from the customer |
currency | 3 characters. ISO 4217 | The currency field contains the alpha-3 currency code for the transaction. Links to ISO |
payment_method | 116 | payabl. Payment methods IDs |
signature | 40 characters | Signature Calculation |
country | 3 characters. ISO 3166-1 alpha-3 | Customer country. Supported countries: AUT, BEL, CZE, DEU, DNK, EST, ESP, FIN, GBR, LTU, LVA, NLD, NOR, POL, SWE, SVK |
language | 2 characters, ISO 639-1 | This parameter determines the language in which Trustly pages will be shown. Valid values: da de en es et fi fr lt lv nl no pl ru sk sv |
email | max. 50 characters | Customer email. An RFC 822 compliant email address |
firstname | max. 50 characters | First name of the customer |
lastname | max. 50 characters | Last name of the customer |
url_success | max. 255 characters starting with http or https | Successful transaction redirect URL |
url_failed | max. 255 characters starting with http or https | Failed transaction redirect URL |
url_return | max. 255 characters starting with http or https | URL for customer redirection |
You can see the full list of parameters in Pre-Authorization.
Request example:
merchantid=gateway_test&orderid=Payabl-Test&amount=19.99¤cy=EUR&payment_method=116&language=en&customerip=2.22.75.244&
[email protected]&firstname=John&lastname=Doe&zip=3035&street=Olympion&house=23&city=Limassol&country=CYP&
url_return=https://yourshop.example/thank_you¬ification_url=https://yourshop.example/notification&url_success=
https://yourshop.example/payment_successful&url_failed=https://yourshop.example/payment_failed&signature=c50a9f6e6dfdd065a6fac48ccb24f654e28f5e18
Public Sandbox information
Do not use your personal email address, Order ID with sensitive information, real customer details and credit card data in the public Sandbox. For email field you may use [email protected].
Redirection to
url_return
does not confirm that the transaction is successful. Always check the transaction vianotification_url
or use the diagnose interface to get the final status of the transaction.
Step 2. Handle the redirect
To complete the payment, you need to redirect the customer to the correct URL in the response.
Response example:
transactionid=104579097&transid=104579097&status=2000&errormessage=pending&errmsg=pending&amount=19.99&price=19.99&
currency=EUR&orderid=Payabl-Test&payment_method=116&redirect_url=https%3A%2F%2Fsandbox.payabl.com%2Fpay%2F73b4
08a26b3a06968cf3234140da43b6e803e574%2Fpayment%2Fredirect_to_bank&user_id=504459
Response fields reference:
Parameter | Description |
---|---|
transactionid | payabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team |
transid | The same as transactionid |
status | Transaction error code |
errormessage | Brief explanation of transaction decline reason (empty on success) |
errmsg | The same as errormessage |
amount | Transaction amount |
price | The same as amount |
currency | Transaction currency |
orderid | Optional transaction identifier assigned by the merchant |
payment_method | Payment method ID |
redirect_url | URL for customer redirection to finalize the payment (URL encoded) |
user_id | Payment system user identifier |
After the client completed payment on the Trustly side, he will be redirected back to your url_return
.
Additionally, you will get a notification to provided notification_url
, which should be used to update statuses in your system.
Step 3. Receive the final status
Once the customer completes the payment, we will send a notification with the transaction's final status to the notification_url
specified by you.
url_return
and notification_url
should be passed by you in the Pre-authorization request.
Alternatively, you can communicate a notifciation_url
to be used by default to payabl. technical team. By doing so, you won't need to send it in every request.
Trustly notifications contain an additional notification parameter which is payment_state
, which can contain the following values:
not_credited_yet
: Capture - Accepted.credited
: Capture - Successful.not_credited
: Capture - Failed.
Each state change would trigger a notification to the notification URL, notification URL is the URL that was provided when the merchant account was created.
Notification example - Accepted Capture:
transactionid=104579096&security=32ffe6f775a31a3ef694725bd8e9acd50e1e3345f57f11416b417e7a6505f1e9×tamp=1660132694&
errormessage=&errorcode=0&orderid=Payabl-Test&type=capture&amount=19.99&payment_state=not_credited_yet
Notification example - Successful Capture:
errorcode=0&transactionid=104579096&amount=19.99&type=capture&security=c9ec2d956a532f2c5e5e2c2fb2edc084e4b2df8e45a1fea
36fd6500cd47849ac&payment_state=credited×tamp=1660132695&errormessage=&orderid=Payabl-Test
Notification fields reference:
Parameter | Description |
---|---|
transactionid | payabl. internal transaction id. Please use this transaction id when referring to the transaction in communications with the payabl. team |
type | Transaction type |
errorcode | Transaction error code (0 for success) |
errormessage | Brief explanation of transaction decline reason (empty on success) |
amount | Transaction amount |
orderid | Optional transaction identifier given by the merchant |
security | Signature to verify the authenticity of the notification. You can find more information here |
timestamp | Notification timestamp |
payment_state | Transaction acceptance state as described above |
Additional Customer details can be added to both callbacks. Please contact Tech support to enable them:
Parameter | Description |
---|---|
bank_country | Customer bank country |
bic | Customer bank BIC |
bank_name | Customer bank name |
account_number | Customer account number |
bank_number | Customer bank number |
account_holder | Account holder name |
Notification example - Accepted Capture (additional parameters):
transactionid=104579097&bank_country=SWEDEN&bank_name=Nordea&security=32ffe6f775a31a3ef694725bd8e9acd50e1e3345f57f11416b
417e7a6505f1e9×tamp=1660132694&errormessage=&errorcode=0&orderid=Payabl-Test&type=capture&amount=19.99&
account_number=6000279&bank_number=3201&account_holder=Erik+Lindstr%C3%B6m&payment_state=not_credited_yet
Notification example - Successful Capture (additional parameters):
errorcode=0&transactionid=104579097&amount=19.99&account_number=6000279&account_holder=Erik+Lindstr%C3%83%C2%B6m&
bank_number=3201&type=capture&security=c9ec2d956a532f2c5e5e2c2fb2edc084e4b2df8e45a1fea36fd6500cd47849ac&payment_state=credited&
bank_country=SWEDEN&bank_name=Nordea×tamp=1660132695&errormessage=&orderid=Payabl-Test
When the customer finished or canceled the payment, he will be redirected back to url_return
, provided by you in the initial request to payment_preauthorize. After that, you will receive a notification, posted to notification_url
, with the final transaction status, which you suppose to use to update your system.
Notification URL can be configured by our tech support team in your account on our side,
or you can send it as a parameternotification_url
in the initial request topayment_preauthorize
.
In case 15 days pass and payabl. didn't receive any funds from an issuer, the transaction will be failed automatically. You will receive a notification update.
Refunds
Trustly supports refunds and can be initiated only on a successful captured transaction.
The request will send a credit note to the authorization system after the customer has already been charged. The refund amount will be credited to the customer and the merchant’s account will be charged.
The refund can be done in two ways:
- Through API integration
- Through payabl. dashboard
If you have API integration, you can check more in our documentation Refund.
Payouts
Trustly payout allows merchants to send funds to any bank account from listed countries via wire transfer. This can be done for customers who already have a deposit through the Trustly system or when the merchant has the bank details of the customer.
This is a server-to-server API request with no callbacks/webhooks.
POST https://sandbox.powercash21.com/pay/backoffice/payment_cft
The payout request through Trustly can be done in two ways:
- Payout based on an existing transaction
- New account details.
Based on an existing transaction
Merchant can choose an existing successful deposit or CFT transaction ID to automatically extract the account details for payouts.
Request example:
merchantid=gateway_test&amount=9.99¤cy=EUR&payment_method=116&transactionid=104579097&signature=fbb556b32974892ce3c13f231db7e3ec6acf76f7
After you send a payout request, the system will validate your current balance. If your balance is sufficient then the transaction will be sent to Trustly for processing.
payabl. will send you a response letting you know if the payout was successful or not.
Response example:
transactionid=105159142&transid=105159142&status=0&errormessage=&errmsg=&amount=9.99&price=9.99¤cy=EUR&orderid=Payabl-Test
New account details
Merchant (non-gambling) can also send funds to accounts of customers that do not have an associated transaction id. For this, the account details need to be sent via API. Please pay attention to the country list table for information on the formatting of the account number field as it can contain IBANs.
Parameter | Description |
---|---|
bankcountry | ISO 3166-1 alpha-2 country code of the recipient’s bank. Please check the table below for support countries |
accountnumber | IBAN or bank account number |
banknumber | This parameter is an option if IBAN is sent |
email | The customer's email |
birthday | The customer's date of birth |
Request example:
merchantid=gateway_test&amount=9.99¤cy=EUR&payment_method=116&bankcountry=FI&accountnumber=FI2618203060000015&
birthday=08021990&signature=c9e4259d5b640210f21e248b7dfdc7894afa2b80
payabl. will send you a response.
Response example:
transactionid=105159149&transid=105159149&status=0&errormessage=&errmsg=&amount=9.99&price=9.99¤cy=EUR&
orderid=Payabl-Test&payment_method=116
Failed payouts
In case an error occurs when processing the payout, a notification will be sent to the provided Notification URL so that you can flag the payout as failed in your system. Note that the notification will be sent AFTER the synchronous response has been sent.
There are 2 main reasons why a payout can fail after the response has been sent:
- There are not enough funds on the merchant’s account. In this case, the notification will be sent immediately after the payout request has been received.
- The funds are sent to the end user’s bank account, but then later Trustly is notified by the bank that the transfer failed, for example, if the recipient’s bank account has been closed. This is usually very uncommon, but if it happens the notification can be sent several days after the payout request was sent.
Failed notification example:
type=cft&security=48b2a585ef95beb5d07b0f752d61cb09ec8e1985&errormessage=MID+is+near+to+negative+balance&orderid=
Payabl-Test&errorcode=-6209&captured_amount=0&transactionid=105159138
Supported countries for payout
BANK COUNTRY | BANKNUMBER [REGEX] | ACCOUNTNUMBER [REGEX] |
---|---|---|
AUSTRIA | ^AT[0-9]{18}$ | |
BELGIUM | ^BE[0-9]{14}$ | |
BULGARIA | ^BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}$ | |
CROATIA | ^HR[0-9]{2}[0-9]{7}[0-9]{10}$ | |
CYPRUS | ^CY[0-9]{10}[0-9A-Z]{16}$ | |
CZECH_REPUBLIC | ^[0-9]{4}$ | ^[0-9]{16}$ |
DENMARK | ^[0-9]{4}$ | ^[0-9]{4,10}$ |
ESTONIA | ^[0-9]{2}$ | ^[0-9]{4,14}$ |
FINLAND | ^FI[0-9]{16}$ | |
FRANCE | ^FR[0-9]{12}[0-9A-Z]{11}[0-9]{2}$ | |
GERMANY | ^DE[0-9]{20}$ | |
GREECE | ^GR[0-9]{25}$ | |
HUNGARY | ^[0-9]{8}$ | ^[0-9]{24}$ |
IRELAND | ^IE[0-9]{2}[A-Z]{4}[0-9]{14}$ | |
ITALY | ^IT[0-9]{2}[A-Z][0-9]{10}[0-9A-Z]{12}$ | |
LATVIA | ^LV[0-9]{2}[A-Z]{4}[0-9A-Z]{13}$ | |
LITHUANIA | ^LT[0-9]{18}$ | |
LUXEMBOURG | ^LU[0-9]{18}$ | |
MALTA | ^MT[0-9]{2}[A-Z]{4}[0-9]{5}[0-9A-Z]{18}$ | |
NETHERLANDS | ^NL[0-9]{2}[A-Z]{4}[0-9]{10}$ | |
NORWAY | ^[0-9]{4}$ | ^[0-9]{7}$ |
POLAND | ^PL[0-9]{26}$ | |
PORTUGAL | ^[0-9]{8}$ | ^[0-9]{13}$ |
ROMANIA | ^RO[0-9]{2}[A-Z]{4}[0-9A-Z]{16}$ | |
SLOVAKIA | ^SK[0-9]{22}$ | |
SLOVENIA | ^SI56[0-9]{15}$ | |
SPAIN | ^ES[0-9]{22}$ | |
SWEDEN | ^[0-9]{4,5}$ | ^[0-9]{1,15}$ |
UNITED_KINGDOM | ^[0-9]{6}$ | ^[0-9]{8}$ |
Our Technical Support team is there to help you:
Email: [email protected]
Available Monday – Friday between 09:00 and 17:00 CET/CEST
Updated 10 months ago