API reference

Complete reference for the Trustly REST API — integrate account authorizations, payments, and online banking into your applications.

View as Markdown

The Trustly API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

You can use the Trustly API in sandbox mode to test your integration without affecting live data or processing real bank transactions. Your provisioned accessId and accessKey credentials determine whether requests are processed against sandbox or production environments.

Base URL

All API requests should be made to the following base URLs:

Sandbox: https://sandbox.trustly.one/api/v1
Production: https://api.trustly.one/api/v1

Authentication

The Trustly API uses HTTP Basic Authentication over HTTPS. Authenticate requests using your provisioned accessId (username) and accessKey (password).

$curl --user accessId:accessKey https://sandbox.trustly.one/api/v1/transactions

For additional security, you can encrypt individual requests and field-level data. See Secure Requests and Signature Validation for details.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Core resources

Browse the key resource groups available in the Trustly API:

Paging and filtering

Requests that return multiple items return 25 items per page by default. Use count and startIndex parameters to paginate through results.

ParameterDescription
countNumber of items to return. Default is 25, maximum is 100.
startIndexZero-based index of the first item to return.
orderByOrder results by createdAt or updatedAt.
sortOrderSort direction: asc (ascending) or desc (descending, default).
createdAt.start / createdAt.endFilter by creation time range (Unix timestamp).
updatedAt.start / updatedAt.endFilter by update time range (Unix timestamp).

Errors

The Trustly API uses conventional HTTP response codes to indicate success or failure:

CodeDescription
200OK — request succeeded.
400Bad Request — invalid parameters or missing required fields.
401Unauthorized — invalid or missing authentication credentials.
403Forbidden — insufficient permissions for the requested resource.
404Not Found — the requested resource doesn’t exist.
429Too Many Requests — rate limit exceeded.
500Server Error — something went wrong on Trustly’s end.