> This page is for North America.

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

# List Countries

GET https://sandbox.trustly.one/api/v1/countries

Returns a list of all available products by country.

Reference: https://trustly.ferndocs.com/api-reference/api/countries/get-countries

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Query parameters

- `country` (enum, optional) — 2-character ISO code of the country for the bank account that was selected. Currently only the US, CA, UK, DE, and AU are supported.
  - Allowed values: `US`, `CA`, `UK`, `DE`, `AU`
- `paymentType` (string, optional) — Returns the countries that support this Payment Type.
- `paymentProvider.subType` (string, optional) — Returns the countries that support this Payment Provider SubType
- `enabled` (string, optional) — If true, returns all countries that are currently supported. Default value is true.

## Response

### 200

OK

- `countries` (list of Country, optional)

## Errors

### 400 Bad Request Error

One of the request parameters is invalid (sending an invalid amount format string for example).

- `message` (string, optional)

## Types

### Country

- `numericCode` (integer, optional) — Number Country numeric code defined in ISO 3166-1
- `alpha2Code` (string, optional) — Country alpha2 code defined in ISO 3166-1
- `alpha3Code` (string, optional) — Country alpha3 code defined in ISO 3166-1
- `name` (string, optional) — Country name
- `currencies` (list of string, optional) — Array of currencies supported by country
- `paymentTypes` (list of enum, optional) — Array of payment types supported by country
  - Allowed values: `instant`, `deferred`, `recurring`, `disbursement`, `verification`, `retrieval`
- `paymentProviderSubtypes` (list of enum, optional) — Array of Payment Provider Subtypes values supported by country
  - Allowed values: `1000`, `2000`, `2001`
- `enabled` (boolean, optional) — Indicates if the country is currently supported

## Examples

**Response**

```json
{
  "countries": [
    {
      "numericCode": 840,
      "alpha2Code": "US",
      "alpha3Code": "USA",
      "name": "United States of America",
      "currencies": [
        "USD"
      ],
      "paymentTypes": [
        "instant",
        "deferred",
        "recurring",
        "disbursement",
        "verification",
        "retrieval"
      ],
      "paymentProviderSubtypes": [
        1000,
        2000,
        2001
      ],
      "enabled": true
    }
  ]
}
```

**SDK Code**

```python Example
import requests

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

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

print(response.json())
```

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

	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/countries")

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/countries")
  .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/countries', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

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

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

var client = new RestClient("https://sandbox.trustly.one/api/v1/countries");
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/countries")! 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()
```