> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://amer.developers.trustly.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.com/_mcp/server.

# Look up whether a user is known to Trustly

GET https://sandbox.trustly.one/api/v1/users/lookup

Checks whether a user has previously used Trustly, based on one or more provided identifiers (email, phone, or your own customer ID).

Merchants can use this endpoint early in the payment funnel — before the user reaches the payment selection screen — to determine whether to surface Trustly as the top payment option. A `true` response indicates the user is already familiar with Pay by Bank and is more likely to complete a Trustly-powered transaction.

**How it works:** The lookup queries Trustly's user database across all stored identifiers. If any provided identifier matches a known Trustly user, `isTrustlyUser` is returned as `true`.

**Authentication:** Requests must be authenticated with HTTP Basic Auth using your `accessId` as the username and `accessKey` as the password.

Reference: https://amer.developers.trustly.com/api-reference/api/network-check-api/get-user-lookup

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /users/lookup:
    get:
      operationId: get-user-lookup
      summary: Look up whether a user is known to Trustly
      description: >-
        Checks whether a user has previously used Trustly, based on one or more
        provided identifiers (email, phone, or your own customer ID).


        Merchants can use this endpoint early in the payment funnel — before the
        user reaches the payment selection screen — to determine whether to
        surface Trustly as the top payment option. A `true` response indicates
        the user is already familiar with Pay by Bank and is more likely to
        complete a Trustly-powered transaction.


        **How it works:** The lookup queries Trustly's user database across all
        stored identifiers. If any provided identifier matches a known Trustly
        user, `isTrustlyUser` is returned as `true`.


        **Authentication:** Requests must be authenticated with HTTP Basic Auth
        using your `accessId` as the username and `accessKey` as the password.
      tags:
        - subpackage_networkCheckApi
      parameters:
        - name: email
          in: query
          description: User's email address.
          required: true
          schema:
            type: string
            format: email
        - name: externalId
          in: query
          description: Your external identifier for the Customer.
          required: true
          schema:
            type: string
        - name: phone
          in: query
          description: User's phone number in ITU E.164 format.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Lookup result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLookupResponse'
        '400':
          description: Bad Request — missing mandatory fields or invalid email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserLookupResponse'
        '401':
          description: Access not authorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Get-user-lookupRequestUnauthorizedError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://sandbox.trustly.one/api/v1
    description: Sandbox
components:
  schemas:
    UserLookupResponseErrorsListItems:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        location:
          type: string
        domain:
          type: string
        occurredAt:
          type: integer
      title: UserLookupResponseErrorsListItems
    UserLookupResponse:
      type: object
      properties:
        isTrustlyUser:
          type: boolean
          description: True if any provided identifier matches a TRM user.
        errorsList:
          type: array
          items:
            $ref: '#/components/schemas/UserLookupResponseErrorsListItems'
          description: Present only on error responses.
      title: UserLookupResponse
    BaseException:
      type: object
      properties:
        domain:
          type: string
        code:
          type: integer
        location:
          type: string
        message:
          type: string
        occurredAt:
          type: integer
      title: BaseException
    Get-user-lookupRequestUnauthorizedError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/BaseException'
      required:
        - errors
      title: Get-user-lookupRequestUnauthorizedError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## Examples

### Known user



**Response**

```json
{
  "isTrustlyUser": true
}
```

**SDK Code**

```python Known user
import requests

url = "https://sandbox.trustly.one/api/v1/users/lookup"

querystring = {"email":"jane.doe@example.com","externalId":"merchant_user_998877","phone":"+15550109988"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Known user
const url = 'https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Known user
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Known user
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java Known user
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php Known user
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Known user
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift Known user
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Unknown user



**Response**

```json
{
  "isTrustlyUser": false
}
```

**SDK Code**

```python Unknown user
import requests

url = "https://sandbox.trustly.one/api/v1/users/lookup"

querystring = {"email":"jane.doe@example.com","externalId":"merchant_user_998877","phone":"+15550109988"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript Unknown user
const url = 'https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Unknown user
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Unknown user
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java Unknown user
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php Unknown user
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp Unknown user
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift Unknown user
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.trustly.one/api/v1/users/lookup?email=jane.doe%40example.com&externalId=merchant_user_998877&phone=%2B15550109988")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```