Retrieve Bank & User Info
With a valid Bank Authorization, use the Trustly Get Transaction API to retrieve information about the Users bank account that can be displayed in their account on your system. You can also use the Trustly Get User API to retrieve personal information (name, address, email, etc) that can be used to pre-fill fields on your flow or verify the information you have already collected from the User.
Use Get Transaction to display Bank information
Calling the Get Transaction API allows you to get transaction details and the current status of a transaction. You call the Get Transaction API by executing a GET
request to the Get Transaction endpoint (/transactions/{transactionId}
), where {transactionId}
is the Bank Account Authorization transaction id.
Example Get Transaction request
https://sandbox.trustly.one/api/v1/transactions/1002548448
The Get Transaction call returns a JSON response with Bank Account data that you can use in your application. Relevant fields from the response include:
payment.account.name
: Name (friendly identifier) of the Users Bank Account.payment.account.type
: Type of Account selected (Checking or Savings).payment.account.accountNumber
: Last 4 digits of the Bank Account number selected.payment.paymentProvider.paymentProviderId
: Trustly Identifier for the Bank selected. Use this identifier to display the Bank logo to the User.payment.paymentProvider.name
: Name of the Bank the User selected.statusMessage
: Status of the transaction. Should beAuthorized
.
You can then use this information to display the selected Payment Method to your user.
Example Get Transaction response (abbreviated)
{
"transaction": {
"transactionId": "1002580075",
"payment": {
"account": {
"name": "Adv Plus Banking",
"type": 1,
"accountNumber": "3254",
},
"paymentProvider": {
"paymentProviderId": "051000017",
"name": "Bank of America"
},
},
"statusMessage": "Authorized",
}
}
Please refer to the Get Transaction definition in the API Reference for more information.
Use Get User to retrieve, validate, and display User information
Data Ready Event Notification
Warning, calling any of the Account Data APIs for a new authorization transaction prior to receiving the
DataReady
event can result in partial data being returned.To ensure optimal performance, wait to receive the
DataReady
event prior to making a request to an calling an Account Data API.
Warning
The Get User API is not available to Electronic Gaming clients.
Calling the Get User API allows you to get the personal information (Account Owner name, address, phone, and email) of the User from their selected Bank Account. Call the Get User API by executing a GET
request to the following endpoint:
/transactions/{transactionId}/payment/paymentProvider/user
Replacing {transactionId}
with the Bank Account Authorization Transaction Id.
Example Get User request
https://sandbox.trustly.one/api/v1/transactions/1002548448/payment/paymentProvider/user
The Get User call returns a JSON response with User data that you can use in your application. Relevant fields from the response include:
name
: Name(s) associated with the User's Bank Account.address
: Address(es) associated with the User's Bank Account.phone
: Phone Number(s) associated with the User's Bank Account.email
: Email Address(es) associated with the User's Bank Account.
You can then use this information to pre-fill or display the Users information in your flow. You can also use this information to validate the personal information the User may have previously provided in your flow.
Example Get User response (abbreviated)
{
"user": {
"name": [
"John Smith",
"Mary Smith"
],
"address": [
{
"address1": "2000 Broadway Street",
"address2": "",
"city": "Redwood City",
"state": "CA",
"zip": "94063",
"country": "US"
},
{
"address1": "105 Alternate1 Street",
"address2": "#401",
"city": "Redmond",
"state": "WA",
"zip": "98052",
"country": "US"
},
],
"phone": [
"2145553434"
],
"email": [
"[email protected]"
],
}
}
Please refer to the Get User definition in the API Reference for more information.
Updated 13 days ago