> 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 full documentation content, see https://amer.developers.trustly.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://amer.developers.trustly.com/_mcp/server.

# Get Customer by ID

GET https://sandbox.trustly.one/api/v1/customers/{customerId}

Retrieves the details of a Customer using the unique `customerId` that was returned upon customer creation.

Reference: https://amer.developers.trustly.com/api-reference/api/customers/get-customers-customer-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /customers/{customerId}:
    get:
      operationId: get-customers-customer-id
      summary: Get Customer by ID
      description: >-
        Retrieves the details of a Customer using the unique `customerId` that
        was returned upon customer creation.
      tags:
        - subpackage_customers
      parameters:
        - name: customerId
          in: path
          description: The identifier of the Customer to be retrieved.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Customers_get-customers-customerId_Response_200
servers:
  - url: https://sandbox.trustly.one/api/v1
components:
  schemas:
    Address:
      type: object
      properties:
        address1:
          type: string
          description: Address line 1 (e.g., street or PO Box)
        address2:
          type: string
          description: Address line 2 (e.g., apartment, suite or unit number)
        city:
          type: string
          description: City, district, town or village
        state:
          type: string
          description: State, province or region code
        zip:
          type: string
          description: ZIP or Postal Code
        country:
          type: string
          description: >-
            2 character [ISO Country
            code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
      required:
        - country
      description: Valid mailing or billing address associated with the customer
      title: Address
    CustomerCustomData:
      type: object
      properties: {}
      description: Object for sending merchant-specific custom data.
      title: CustomerCustomData
    DriverLicense:
      type: object
      properties:
        number:
          type: string
          description: Driver License number.
        state:
          type: string
          description: 2 character ISO State code.
      required:
        - number
        - state
      title: DriverLicense
    Customer:
      type: object
      properties:
        name:
          type: string
          description: Full name of the Customer
        taxId:
          type: string
          description: >-
            Customer tax ID (e.g. SSN [US], SIN [CA]). *May be required
            depending on industry and location.*
        address:
          $ref: '#/components/schemas/Address'
        phone:
          type: string
          description: Customer phone number.
        email:
          type: string
          description: Customer email address.
        dateOfBirth:
          type: string
          description: Customer date of birth.
        createdAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
        updatedAt:
          type: integer
          description: The record created date and time as a UNIX timestamp.
        customerId:
          type: string
          description: A unique Trustly customer identifier.
        externalId:
          type: string
          description: A unique merchant customer identifier.
        merchantId:
          type: string
          description: A unique Trustly merchant identifier.
        enrollDate:
          type: integer
          description: >-
            Date of the user's first transaction in your system, regardless of
            payment method used as a UNIX timestamp.
        vip:
          type: string
          description: >-
            Range that determines how low-risk the customer represents to the
            merchant
        currency:
          type: string
          description: Customer currency.
        balance:
          type: string
          description: >-
            Customer account balance (not associated with a financial
            institution account).
        organizationNumber:
          type: string
          description: Organization number for business accounts
        externalTier:
          type: string
          description: >-
            It should describe the customer''s rank to the merchant (e.g. Gold,
            Diamond, 4 stars, etc.)
        personId:
          type: string
          description: Unique customer identity throughout different banks.
        customData:
          $ref: '#/components/schemas/CustomerCustomData'
          description: Object for sending merchant-specific custom data.
        driverLicense:
          $ref: '#/components/schemas/DriverLicense'
        nationalId:
          type: string
          description: Customer National ID
      required:
        - name
        - address
        - phone
        - email
      description: >-
        The Trustly customer object, containing identification details and
        contact information.
      title: Customer
    Customers_get-customers-customerId_Response_200:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
      title: Customers_get-customers-customerId_Response_200
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## SDK Code Examples

```python Example
import requests

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

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

print(response.json())
```

```javascript Example
const url = 'https://sandbox.trustly.one/api/v1/customers/customerId';
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 Example
package main

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

func main() {

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

	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 Example
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/customers/customerId")

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 Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.trustly.one/api/v1/customers/customerId")
  .basicAuth("<username>", "<password>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.trustly.one/api/v1/customers/customerId', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

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

```csharp Example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://sandbox.trustly.one/api/v1/customers/customerId");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

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

```swift Example
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/customerId")! 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()
```