> 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 user

GET https://sandbox.trustly.one/api/v1/transactions/{transactionId}/user

Retrieve the User object associated with the Trustly ID authorization transaction.

Reference: https://amer.developers.trustly.com/api-reference/api/identity/get-trustly-id-user-data

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /transactions/{transactionId}/user:
    get:
      operationId: get-trustly-id-user-data
      summary: Get user
      description: >-
        Retrieve the User object associated with the Trustly ID authorization
        transaction.
      tags:
        - subpackage_identity
      parameters:
        - name: transactionId
          in: path
          description: Transaction ID retrieved from a Trustly Authorization transaction.
          required: true
          schema:
            type: string
        - name: expand
          in: query
          description: >-
            A field in the API response to be expanded in order for more details
            to be provided.

            Supported values:
             * `segmentedName`: returns a segmented version of the name field returned in the response.
          required: false
          schema:
            type: array
            items:
              $ref: >-
                #/components/schemas/TransactionsTransactionIdUserGetParametersExpandSchemaItems
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Get-trustly-id-user-dataRequestBadRequestError
servers:
  - url: https://sandbox.trustly.one/api/v1
components:
  schemas:
    TransactionsTransactionIdUserGetParametersExpandSchemaItems:
      type: string
      enum:
        - segmentedName
      title: TransactionsTransactionIdUserGetParametersExpandSchemaItems
    StateCode:
      type: string
      description: 2 character ISO State code.
      title: StateCode
    SchemasAddressCountry:
      type: string
      enum:
        - US
      description: 2 character ISO Country code. Currently only the US is supported.
      title: SchemasAddressCountry
    schemas-Address:
      type: object
      properties:
        address1:
          type: string
          description: Address Line 1.
        address2:
          type: string
          description: Address Line 2.
        city:
          type: string
          description: Address City.
        state:
          $ref: '#/components/schemas/StateCode'
        zip:
          type: string
          description: 5 character US Zip Code.
        country:
          $ref: '#/components/schemas/SchemasAddressCountry'
          description: 2 character ISO Country code. Currently only the US is supported.
      required:
        - country
      title: schemas-Address
    schemas-DriverLicense:
      type: object
      properties:
        number:
          type: string
          description: >-
            The driver's license number. Even though this field is called
            'number', it may contain non-numeric characters if the country
            allows that.
        state:
          $ref: '#/components/schemas/StateCode'
      description: A driver's license.
      title: schemas-DriverLicense
    SegmentedName:
      type: object
      properties:
        title:
          type: string
          description: The title of a given full name.
        firstName:
          type: string
          description: The first name of a given full name.
        middleName:
          type: array
          items:
            type: string
          description: The list of middle names of a given full name.
        lastName:
          type: string
          description: The last name of a given full name.
        suffix:
          type: string
          description: The suffix of a given full name.
      description: The segmented version of a given name.
      title: SegmentedName
    User:
      type: object
      properties:
        name:
          type: string
          description: The full name of the user
        address:
          type: array
          items:
            $ref: '#/components/schemas/schemas-Address'
          description: Array of addresses associated with the user.
        phone:
          type: array
          items:
            type: string
          description: Array of phone numbers associated with the user.
        email:
          type: array
          items:
            type: string
          description: Array of e-mail addresses associated with the user.
        dateOfBirth:
          type: string
          description: The date of birth of the user in the format YYYY-MM-DD
        taxId:
          type: string
          description: The user's government issued tax ID e.g. SSN (US) or SIN (CA)
        deceased:
          type: boolean
          description: If `true`, then the user is deceased.
        driverLicense:
          $ref: '#/components/schemas/schemas-DriverLicense'
        eligible:
          type: boolean
          description: >-
            Indicates if the user has got a successful result in all
            verifications and is eligible.
        createdAt:
          type: integer
          description: Timestamp representing the time the User Object was created.
        updatedAt:
          type: integer
          description: Timestamp representing the time the User Object was last updated.
        segmentedName:
          $ref: '#/components/schemas/SegmentedName'
      description: Trustly User
      title: User
    TransactionsTransactionIdUserGetResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        domain:
          type: string
        code:
          type: number
          format: double
        location:
          type: string
        message:
          type: string
        occurredAt:
          type: number
          format: double
      required:
        - domain
        - code
        - location
        - message
        - occurredAt
      title: >-
        TransactionsTransactionIdUserGetResponsesContentApplicationJsonSchemaErrorsItems
    Get-trustly-id-user-dataRequestBadRequestError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/TransactionsTransactionIdUserGetResponsesContentApplicationJsonSchemaErrorsItems
      required:
        - errors
      title: Get-trustly-id-user-dataRequestBadRequestError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## SDK Code Examples

```python User
import requests

url = "https://sandbox.trustly.one/api/v1/transactions/transactionId/user"

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

print(response.json())
```

```javascript User
const url = 'https://sandbox.trustly.one/api/v1/transactions/transactionId/user';
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 User
package main

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

func main() {

	url := "https://sandbox.trustly.one/api/v1/transactions/transactionId/user"

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

url = URI("https://sandbox.trustly.one/api/v1/transactions/transactionId/user")

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp User
using RestSharp;
using RestSharp.Authenticators;

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

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

```swift 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/transactions/transactionId/user")! 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()
```

```python User - With Segmented Name
import requests

url = "https://sandbox.trustly.one/api/v1/transactions/transactionId/user"

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

print(response.json())
```

```javascript User - With Segmented Name
const url = 'https://sandbox.trustly.one/api/v1/transactions/transactionId/user';
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 User - With Segmented Name
package main

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

func main() {

	url := "https://sandbox.trustly.one/api/v1/transactions/transactionId/user"

	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 User - With Segmented Name
require 'uri'
require 'net/http'

url = URI("https://sandbox.trustly.one/api/v1/transactions/transactionId/user")

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 User - With Segmented Name
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php User - With Segmented Name
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp User - With Segmented Name
using RestSharp;
using RestSharp.Authenticators;

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

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

```swift User - With Segmented Name
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/transactions/transactionId/user")! 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()
```