Trustly provides a robust API for facilitating bank account authorizations and building powerful Online Banking integrations.

Authentication

Trustly's APIs prioritize security through robust measures designed to safeguard sensitive data and ensure a secure transaction environment. In addition to the HTTPS authentication described here, individual requests and even field-level data can be encrypted for additional layers of security. See Securing Requests for more details.

Basic Authentication for HTTPS APIs involves sending a username and password encoded in Base64 within the request header. The client includes an "Authorization" header with the value "Basic" followed by the Base64-encoded concatenation of the username and password, separated by a colon. Read more about Basic Authentication on MDN.

Using Basic Auth with the Trustly API requires your provisioned credentials (accessId and accessKey) utilizing your accessId as the username and your accessKey as the password. (when using cURL, you can specify them as --user accessId:accessKey).

  1. accessId and accessKey are combined into a string: accessId:accessKey
  2. Encode the string using Base64
  3. Set the encoded string as the authorization header prefixed by the string Basic .

Example result:

Authorization: Basic SUZfWU9VX0FSRV9SRUFESU5HX1RISVM6WU9VX0dPVF9JVA==

Using curl this can be done following the example below:

# Simply pass the correct username and password with each request
curl --user accessId:accessKey https://sandbox.trustly.one/api/v1/transactions

Make sure to replace accessId and accessKey with your credentials.

Transactions

Transactions are a critical element of the Trustly API. Transactions can have various types and depending on the type, the correlating transactionId is required for use with most Transactions endpoints.

See more about Transaction types

Paging and Filtering

Requests that return multiple items will by default return 25 items per page. By combining the count and startIndex parameters, lists can be easily paged to retrieve all available data.

Though some endpoints may have additional filtering attributes, the common methods are listed here.

ParameterDescription
countNumber of items to return. Default is 25 with a maximum value of 100.
startIndexStart index (starts at 0) of the resources to be returned. Typically used to jump to a specific position in the resource list based on its order. Example for starting at the second item in a list of results: ?startIndex=1
orderByOrder returned items by createdAt or updatedAt.
sortOrderSort based on order of results. Options include asc for ascending order or desc for descending order (default).
createdAt.startResource create time (Unix Timestamp) that indicates the start of a range of results.
createdAt.endResource create time (Unix Timestamp) that indicates the end of a range of results.
updatedAt.startResource update time (Unix Timestamp) that indicates the start of a range of results.
updatedAt.endResource update time (Unix Timestamp) that indicates the end of a range of results.

Errors

Read more about error handling on the Errors page.