> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quidkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List countries

> Lists every country and the rules for collecting details there, ordered by name. Most of these refuse a customer at create: `CURRENCY_COUNTRY_MISMATCH`, or `CUSTOMER_COUNTRY_NOT_SUPPORTED` when the payment transaction is in the country's own currency.

Credentials: `partner`, `merchant`

Permission: `countries:list`



## OpenAPI

````yaml /api-reference/v1/openapi.json get /countries
openapi: 3.1.0
info:
  title: Quidkey API
  version: 1.0.0
  description: >-
    The Quidkey public API.


    Within a version, a response can carry what this document doesn't list yet:
    a new field, a new value of an enum, a new error code. Handle a value you
    don't recognise rather than refusing the response. A client generated from
    this document turns an `enum` into a closed type unless told otherwise, so
    turn on its option for unknown values, such as openapi-generator's
    `enumUnknownDefaultCase`. A request is held to what's listed: a value it
    doesn't list is refused.
  contact:
    name: Quidkey
    url: https://docs.quidkey.com
servers:
  - url: https://api.quidkey.com/v1
security:
  - bearer: []
tags:
  - name: account_owner
  - name: agreement
  - name: agreement_acceptance
  - name: api_key
  - name: bank
  - name: bank_account
  - name: capability
  - name: country
  - name: identity_verification
  - name: legal_entity
  - name: merchant
  - name: party
  - name: payment_link
  - name: payout
  - name: transaction
  - name: webhook_endpoint
paths:
  /countries:
    get:
      tags:
        - country
      summary: List countries
      description: >-
        Lists every country and the rules for collecting details there, ordered
        by name. Most of these refuse a customer at create:
        `CURRENCY_COUNTRY_MISMATCH`, or `CUSTOMER_COUNTRY_NOT_SUPPORTED` when
        the payment transaction is in the country's own currency.


        Credentials: `partner`, `merchant`


        Permission: `countries:list`
      operationId: country.list
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            An opaque cursor from `next_cursor`, valid with the filters it was
            issued for.
          schema:
            minLength: 1
            maxLength: 1024
            type: string
        - name: has_onboarding_rules
          in: query
          required: false
          description: Only countries where this holds, or only those where it doesn't.
          schema:
            type: boolean
        - name: limit
          in: query
          required: false
          description: The page size.
          schema:
            minimum: 1
            maximum: 100
            default: 25
            type: integer
      responses:
        '200':
          description: A list of country, in the full view.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - result
                  - entities
                  - not_included
                  - pagination
                properties:
                  result:
                    type: array
                    items:
                      $ref: '#/components/schemas/CountryFull'
                  entities:
                    additionalProperties: false
                    description: Nothing can be included here.
                    type: object
                    properties: {}
                  not_included:
                    type: array
                    items:
                      $ref: '#/components/schemas/NotIncludedEntry'
                  pagination:
                    $ref: '#/components/schemas/CursorPagination'
        '400':
          description: '`VALIDATION_FAILED`: The request is malformed or failed validation.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - VALIDATION_FAILED
        '401':
          description: '`UNAUTHENTICATED`: A valid bearer token is required.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - UNAUTHENTICATED
        '403':
          description: >-
            `FORBIDDEN`: This credential doesn't have permission for this
            endpoint.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - FORBIDDEN
        '404':
          description: '`NOT_FOUND`: Not found.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - NOT_FOUND
        '406':
          description: '`NOT_ACCEPTABLE`: This endpoint doesn''t offer the format in Accept.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - NOT_ACCEPTABLE
        '429':
          description: '`RATE_LIMITED`: Too many requests.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - RATE_LIMITED
        '500':
          description: '`INTERNAL_ERROR`: Something went wrong on our side.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - INTERNAL_ERROR
        '503':
          description: '`SERVICE_UNAVAILABLE`: The service is busy. Try again shortly.'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          x-error-codes:
            - SERVICE_UNAVAILABLE
components:
  headers:
    RequestId:
      description: Identifies this request. Quote it to support.
      schema:
        type: string
    RetryAfter:
      description: How many seconds to wait before retrying.
      schema:
        minimum: 0
        type: integer
  schemas:
    CountryFull:
      additionalProperties: false
      type: object
      required:
        - _type
        - _uri
        - _view
        - id
        - created_at
        - updated_at
        - name
        - has_onboarding_rules
        - phone_dial_code
        - address_fields
        - regions
        - field_rules
        - legal_structures
        - payment_schemes
      properties:
        _type:
          const: country
          type: string
        _uri:
          pattern: ^/
          description: The canonical URI, relative to the version root.
          type: string
        _view:
          const: full
          type: string
        id:
          type: string
        created_at:
          anyOf:
            - format: date-time
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$
              type: string
            - type: 'null'
        updated_at:
          anyOf:
            - format: date-time
              pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$
              type: string
            - type: 'null'
        name:
          type: string
        has_onboarding_rules:
          type: boolean
          description: >-
            Whether Quidkey holds onboarding rules for merchants in this
            country. A merchant or legal entity naming a country where it's
            `false` isn't refused for that, and where it's `true`,
            `legal_structures` and `field_rules` can still be empty.
        phone_dial_code:
          anyOf:
            - pattern: ^[0-9]{1,4}$
              type: string
            - type: 'null'
          description: >-
            The international dialling code, without the plus. Phone numbers are
            sent in E.164 regardless.
        address_fields:
          type: array
          items:
            type: string
            enum:
              - line1
              - line2
              - city
              - region
              - postal_code
              - country
          description: >-
            The fields of an `Address` Quidkey collects in this country.
            Collecting isn't requiring: an address needs `line1`, `city`,
            `postal_code` and `country`, with `postal_code` empty where the
            country has none, and can leave out `line2` or `region` wherever
            they're listed.
        regions:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - code
              - name
              - short_name
            properties:
              code:
                pattern: ^[A-Z]{2}-[A-Z0-9]{1,3}$
                type: string
                description: The ISO 3166-2 code.
              name:
                type: string
              short_name:
                type: string
          description: >-
            The values `region` can take on an `Address`. Empty where the API
            holds no list.
        field_rules:
          additionalProperties: false
          type: object
          required:
            - postal_code
            - registration_number
            - vat_number
            - tax_id
          properties:
            postal_code:
              anyOf:
                - $ref: '#/components/schemas/FieldRule'
                - type: 'null'
            registration_number:
              anyOf:
                - $ref: '#/components/schemas/FieldRule'
                - type: 'null'
            vat_number:
              anyOf:
                - $ref: '#/components/schemas/FieldRule'
                - type: 'null'
            tax_id:
              anyOf:
                - $ref: '#/components/schemas/FieldRule'
                - type: 'null'
        legal_structures:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - code
              - name
              - fields
            properties:
              code:
                type: string
                enum:
                  - limited_liability_company
                  - private_limited_company
                  - public_limited_company
                  - general_partnership
                  - limited_liability_partnership
                  - limited_partnership
                  - limited_liability_entrepreneurial_company
                  - joint_stock_company
                  - single_member_llc
                  - multi_member_llc
                  - private_partnership
                  - private_corporation
                  - public_company
                description: The value of `legal_structure` on a legal entity.
              name:
                type: string
              fields:
                type: array
                items:
                  additionalProperties: false
                  type: object
                  required:
                    - field
                    - is_required
                  properties:
                    field:
                      type: string
                      enum:
                        - registration_number
                        - vat_number
                        - tax_id
                    is_required:
                      type: boolean
                description: >-
                  The legal entity fields this structure uses. `is_required`
                  means the merchant needs this field to finish onboarding. A
                  create only refuses a missing `registration_number`, so a
                  field marked required can be supplied later.
          description: >-
            The legal structures Quidkey lists for this country. A create takes
            any `legal_structure`, listed here or not.
        payment_schemes:
          maxItems: 20
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - _type
              - id
              - is_default
            properties:
              _type:
                const: payment_scheme
                type: string
              id:
                type: string
              is_default:
                type: boolean
            x-link-target:
              resource: payment_scheme
              kind: resource
              is_published: false
          description: >-
            The payment schemes active in this country, the default first, which
            is what a bank account here can take. `id` is the scheme's stable
            code, such as `faster_payments`. Empty where there are none.
    NotIncludedEntry:
      additionalProperties: false
      type: object
      required:
        - link
        - reason
      properties:
        link:
          $ref: '#/components/schemas/AnyLink'
        reason:
          type: string
          enum:
            - no_permission
            - not_published
          description: >-
            Why this link has no entity.


            - `no_permission`: This credential can't read it. Fetching it
            answers 403, or 404 where a 403 would reveal that it exists.

            - `not_published`: The API doesn't show it: a type it doesn't
            publish, or a record it doesn't show on a type it does, such as a
            failed payout. Fetching it, where it has a URI, answers 404.
    CursorPagination:
      additionalProperties: false
      type: object
      required:
        - type
        - limit
        - next_cursor
        - has_more
      properties:
        type:
          const: cursor
          type: string
        limit:
          minimum: 1
          maximum: 100
          type: integer
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
        has_more:
          type: boolean
    Error:
      additionalProperties: false
      type: object
      required:
        - error
      properties:
        error:
          additionalProperties: false
          type: object
          required:
            - code
            - message
            - details
            - retryable
            - request_id
          properties:
            code:
              description: Branch on this. New codes can appear.
              type: string
            message:
              description: For people. It can change.
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
            retryable:
              description: >-
                Whether sending the same request again unchanged, after a wait,
                can succeed with nothing else changing.
              type: boolean
            request_id:
              description: Quote this to support.
              type: string
    FieldRule:
      description: >-
        How Quidkey asks for a field in this country. A missing part is `null`.
        A create holds a `tax_id` to its `pattern` once its separators are out,
        and an Australian one to its checksum as well. It doesn't check
        `registration_number` or `vat_number` against these, and onboarding can,
        so send them without separators: they're kept as sent. A `postal_code`
        isn't checked against these at create.
      additionalProperties: false
      type: object
      required:
        - label
        - min_length
        - max_length
        - pattern
        - placeholder
      properties:
        label:
          anyOf:
            - type: string
            - type: 'null'
        min_length:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
        max_length:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          description: An ECMA-262 regular expression.
        placeholder:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            How a person would write the value, which can carry separators
            `pattern` leaves out.
    AnyLink:
      anyOf:
        - additionalProperties: false
          type: object
          required:
            - _link
            - _type
            - id
          properties:
            _link:
              pattern: ^/
              type: string
            _type:
              type: string
            id:
              type: string
        - additionalProperties: false
          type: object
          required:
            - _type
            - id
          properties:
            _type:
              type: string
            id:
              type: string
      x-link-target:
        resource: any
        kind: any
        is_published: true
    ErrorDetail:
      anyOf:
        - additionalProperties: false
          type: object
          required:
            - field
            - message
          properties:
            field:
              type: string
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - required_actions
            - message
          properties:
            required_actions:
              description: The `required_actions` codes holding this back.
              type: array
              items:
                type: string
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - available_percent
            - message
          properties:
            available_percent:
              $ref: '#/components/schemas/Percent'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - agreement
            - message
          properties:
            agreement:
              $ref: '#/components/schemas/AgreementLink'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - agreement
            - current_agreement
            - message
          properties:
            agreement:
              $ref: '#/components/schemas/AgreementLink'
            current_agreement:
              $ref: '#/components/schemas/AgreementLink'
            message:
              type: string
        - additionalProperties: false
          type: object
          required:
            - legal_entity
            - message
          properties:
            legal_entity:
              $ref: '#/components/schemas/LegalEntityLink'
            message:
              type: string
    Percent:
      pattern: ^\d+(\.\d+)?$
      description: 'A percentage as a decimal string: `"25.00"` is 25%.'
      type: string
    AgreementLink:
      additionalProperties: false
      type: object
      required:
        - _link
        - _type
        - id
      properties:
        _link:
          pattern: ^/
          type: string
        _type:
          const: agreement
          type: string
        id:
          type: string
      x-link-target:
        resource: agreement
        kind: resource
        is_published: true
        views:
          - full
    LegalEntityLink:
      additionalProperties: false
      type: object
      required:
        - _link
        - _type
        - id
      properties:
        _link:
          pattern: ^/
          type: string
        _type:
          const: legal_entity
          type: string
        id:
          type: string
      x-link-target:
        resource: legal_entity
        kind: resource
        is_published: true
        views:
          - full
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.