Retrieve bank and user Information
After a user successfully authorizes a transaction, your application often needs to retrieve specific details to display a confirmation screen, visualize the selected bank, or pre-fill checkout forms. Trustly provides the Get Transaction and Get User APIs to fetch this account and identity data.
Transaction and bank details
To retrieve the current status of a transaction and details about the user's selected financial institution, send a GET request to the Get Transaction endpoint.
Endpoint: /transactions/{transactionId}
Request
GET https://sandbox.trustly.one/api/v1/transactions/1002548448Response fields
The following table lists the data returned in the response object, which you can use to display the payment method to your user.
| Field | Description |
|---|---|
payment.account.name | The friendly name of the user's bank account. For example, Adv Plus Banking. |
payment.account.type | The type of account selected. For example, Checking or Savings. |
payment.account.accountNumber | The last four digits of the selected account number. |
payment.paymentProvider.name | The name of the financial institution. |
payment.paymentProvider.paymentProviderId | The unique Trustly identifier for the bank. |
statusMessage | The current status of the transaction. For example, Authorized. |
Display bank logos and icons
You can use the paymentProviderId returned in the response to dynamically generate URLs for the bank's official visual assets.
- Bank Name: Display the
payment.paymentProvider.nametext beside the icon or logo. - Visuals: Insert the
paymentProviderIdinto the following URL patterns:
The following image shows an example checkout UI displaying the retrieved bank logo and account details.
Example response (abbreviated)
{
"transaction": {
"transactionId": "1002580075",
"payment": {
"account": {
"name": "Adv Plus Banking",
"type": 1,
"accountNumber": "3254",
},
"paymentProvider": {
"paymentProviderId": "051000017",
"name": "Bank of America"
},
},
"statusMessage": "Authorized",
}
}User identity information
Data Ready Event NotificationCalling any of the Account Data APIs for a new authorization transaction prior to receiving the
DataReadyevent can result in partial data being returned.To ensure optimal performance, wait to receive the
DataReadyevent prior to making a request to an calling an Account Data API.The
DataReadyevent is not sent when a customer enters their account and routing number manually.
The Get User API is not available to Electronic Gaming clients.
You can use the Get User API to retrieve the account owner's personal information - such as the name, address, phone, and email associated with the selected bank account. This is useful for pre-filling checkout forms or validating customer input.
To fetch this data, send a GET request to the Get User endpoint using the transactionId generated during authorization.
Endpoint: /transactions/{transactionId}/payment/paymentProvider/user
Replace {transactionId} with the Bank Account Authorization Transaction ID.
The following image demonstrates a checkout interface where the shipping address has been pre-filled using the identity data retrieved from the user's bank account.
Example request
https://sandbox.trustly.one/api/v1/transactions/1002548448/payment/paymentProvider/userExample 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]"
],
}
}Response fields
The following table describes the user data arrays returned in the response. A single bank account may be associated with multiple values.
| Field | Description |
|---|---|
name | The name(s) associated with the bank account. |
address | The physical address(es) on file with the bank. |
phone | The phone number(s) associated with the account. |
email | The email address(es) associated with the account. |
Updated 8 days ago