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/1002548448

Response fields

The following table lists the data returned in the response object, which you can use to display the payment method to your user.

FieldDescription
payment.account.nameThe friendly name of the user's bank account. For example, Adv Plus Banking.
payment.account.typeThe type of account selected. For example, Checking or Savings.
payment.account.accountNumberThe last four digits of the selected account number.
payment.paymentProvider.nameThe name of the financial institution.
payment.paymentProvider.paymentProviderIdThe unique Trustly identifier for the bank.
statusMessageThe 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.

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 Notification

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.

The DataReady event 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/user

Example 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.

FieldDescription
nameThe name(s) associated with the bank account.
addressThe physical address(es) on file with the bank.
phoneThe phone number(s) associated with the account.
emailThe email address(es) associated with the account.