> 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/customers/lookup

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

Merchants can use this endpoint without having to launch Trustly widget/lightbox. One such use case could be to 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, `isInTrustlyNetwork` 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-customer-lookup

## Authentication

- `Authorization` header (basic auth, required)

## Request

### Query parameters

- `email` (string, required) — User's email address.
- `phone` (string, optional) — User's phone number in ITU E.164 format.

## Response

### 200

Lookup result

- `isInTrustlyNetwork` (boolean, optional) — True if a transaction has ever been made with any of the provided identifiers.
- `errorsList` (list of object, optional) — Present only on error responses.
  - `code` (integer, optional)
  - `message` (string, optional)
  - `location` (string, optional)
  - `domain` (string, optional)
  - `occurredAt` (integer, optional)

## Examples

### Known user

**Response**

```json
{
  "isInTrustlyNetwork": true
}
```

**SDK Code**

```python Known user
import requests

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

querystring = {"email":"jane.doe@example.com","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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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
{
  "isInTrustlyNetwork": false
}
```

**SDK Code**

```python Unknown user
import requests

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

querystring = {"email":"jane.doe@example.com","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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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/customers/lookup?email=jane.doe%40example.com&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()
```