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

# List Countries

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

Returns a list of all available products by country.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Trustly API
  version: 1.0.0
paths:
  /countries:
    get:
      operationId: get-countries
      summary: List Countries
      description: Returns a list of all available products by country.
      tags:
        - subpackage_countries
      parameters:
        - name: country
          in: query
          description: >-
            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.
          required: false
          schema:
            $ref: '#/components/schemas/CountriesGetParametersCountry'
        - name: paymentType
          in: query
          description: Returns the countries that support this Payment Type.
          required: false
          schema:
            type: string
        - name: paymentProvider.subType
          in: query
          description: Returns the countries that support this Payment Provider SubType
          required: false
          schema:
            type: string
        - name: enabled
          in: query
          description: >-
            If true, returns all countries that are currently supported. Default
            value is true.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Countries_get-countries_Response_200'
        '400':
          description: >-
            One of the request parameters is invalid (sending an invalid amount
            format string for example).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Get-countriesRequestBadRequestError'
servers:
  - url: https://sandbox.trustly.one/api/v1
components:
  schemas:
    CountriesGetParametersCountry:
      type: string
      enum:
        - US
        - CA
        - UK
        - DE
        - AU
      title: CountriesGetParametersCountry
    PaymentType:
      type: string
      enum:
        - instant
        - deferred
        - recurring
        - disbursement
        - verification
        - retrieval
      description: |-
        Payment Type:
          * `instant`: Instant payment. The debit instruction is automatically initiated with that day''s batch after consumer authorization.
          * `deferred`: Deferred payment. Payment is authorized but the capture operation must be called to initiate the debit. You can start to initiate multiple captures that are less than or equal to the original transaction authorization amount.
          * `recurring`: Recurring payment. Same as deferred but associated to a payment agreement between consumer and merchant that defines how much and when the capture can be started.
          * `disbursement`: Disbursement payment. This payment type can only be used for disbursements.
          * `verification`: This payment type is used to verify the customer financial institution account as the payments will be done outside of the Trustly system.
          * `retrieval`: Data retrieval. This payment type is used to retrieve account and user information from Trustly without an associated payment request. This payment type is not enabled by default. Contact Trustly if you need this feature.
      title: PaymentType
    PaymentProviderSubtype:
      type: string
      enum:
        - '1000'
        - '2000'
        - '2001'
      description: |-
        Payment Provider Subtype:
          * `1000`: EasyOnline
          * `2000`: MEC
          * `2001`: MCD
      title: PaymentProviderSubtype
    Country:
      type: object
      properties:
        numericCode:
          type: integer
          description: Number Country numeric code defined in ISO 3166-1
        alpha2Code:
          type: string
          description: Country alpha2 code defined in ISO 3166-1
        alpha3Code:
          type: string
          description: Country alpha3 code defined in ISO 3166-1
        name:
          type: string
          description: Country name
        currencies:
          type: array
          items:
            type: string
          description: Array of currencies supported by country
        paymentTypes:
          type: array
          items:
            $ref: '#/components/schemas/PaymentType'
          description: Array of payment types supported by country
        paymentProviderSubtypes:
          type: array
          items:
            $ref: '#/components/schemas/PaymentProviderSubtype'
          description: 'Array of Payment Provider Subtypes values supported by country '
        enabled:
          type: boolean
          description: Indicates if the country is currently supported
      title: Country
    Countries_get-countries_Response_200:
      type: object
      properties:
        countries:
          type: array
          items:
            $ref: '#/components/schemas/Country'
      title: Countries_get-countries_Response_200
    Get-countriesRequestBadRequestError:
      type: object
      properties:
        message:
          type: string
      title: Get-countriesRequestBadRequestError
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
      description: ''

```

## SDK Code Examples

```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()
```