{
  "openapi": "3.1.0",
  "info": {
    "title": "Kartapay Data API",
    "summary": "Read-only public data on UK-licensed card-payment acquirers.",
    "description": "Machine-readable access to the Kartapay UK Card Acquirer Index: verified acquirer entity data (legal name, Companies House number, parent group, commercial model, onboarding language) and a current snapshot. Source of truth is the on-site UK Card Acquirer Index Dataset. English only (this is a data layer, not localised content). Read-only, no authentication, no PII, CC BY 4.0. Also exposed as an MCP server at /mcp (see /.well-known/mcp.json).",
    "version": "2026-05-26",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "name": "Kartapay",
      "url": "https://kartapay.co.uk/data/api/"
    }
  },
  "servers": [
    { "url": "https://kartapay.co.uk", "description": "Production" }
  ],
  "externalDocs": {
    "description": "Human-readable API documentation",
    "url": "https://kartapay.co.uk/data/api/"
  },
  "paths": {
    "/api/acquirers": {
      "get": {
        "operationId": "listAcquirers",
        "summary": "List UK-licensed card-payment acquirers",
        "description": "Returns all tracked acquirers, or a filtered subset when query params are supplied.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text match on acquirer name, parent group and note.",
            "schema": { "type": "string" }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "description": "Filter by commercial model.",
            "schema": {
              "type": "string",
              "enum": ["payment-facilitator", "acquirer", "iso-acquirer"]
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Only acquirers Kartapay has verified offer this onboarding / support language, e.g. Polish.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of acquirers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": { "type": "string" },
                    "source": { "type": "string", "format": "uri" },
                    "license": { "type": "string", "format": "uri" },
                    "count": { "type": "integer" },
                    "acquirers": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Acquirer" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/acquirers/{slug}": {
      "get": {
        "operationId": "getAcquirer",
        "summary": "Get a single acquirer by slug",
        "description": "Returns one acquirer record by its stable slug (e.g. sumup, worldpay, dojo).",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "example": "sumup"
          }
        ],
        "responses": {
          "200": {
            "description": "The matching acquirer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schema_version": { "type": "string" },
                    "source": { "type": "string", "format": "uri" },
                    "license": { "type": "string", "format": "uri" },
                    "acquirer": { "$ref": "#/components/schemas/Acquirer" }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No acquirer matches the slug.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    },
    "/api/acquirers-snapshot": {
      "get": {
        "operationId": "getAcquirersSnapshot",
        "summary": "Current UK card acquirer snapshot",
        "description": "Total tracked acquirers, a count by commercial model, and how many offer Polish or Romanian onboarding.",
        "responses": {
          "200": {
            "description": "Acquirer snapshot.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Snapshot" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Acquirer": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "legal_name": { "type": "string" },
          "company_number": { "type": "string" },
          "companies_house_url": { "type": "string", "format": "uri" },
          "parent": { "type": "string" },
          "homepage": { "type": "string", "format": "uri" },
          "model": {
            "type": "string",
            "enum": ["payment-facilitator", "acquirer", "iso-acquirer"]
          },
          "model_label": { "type": "string" },
          "onboarding_language": { "type": "array", "items": { "type": "string" } },
          "note": { "type": "string" },
          "last_reviewed": { "type": "string", "format": "date" }
        },
        "required": ["slug", "name", "legal_name", "company_number", "homepage", "model"]
      },
      "Snapshot": {
        "type": "object",
        "properties": {
          "schema_version": { "type": "string" },
          "as_of": { "type": "string", "format": "date" },
          "region": { "type": "string" },
          "acquirers_count": { "type": "integer" },
          "by_model": {
            "type": "object",
            "additionalProperties": { "type": "integer" }
          },
          "onboarding_language": {
            "type": "object",
            "properties": {
              "polish": { "type": "integer" },
              "romanian": { "type": "integer" },
              "note": { "type": "string" }
            }
          },
          "source": { "type": "string", "format": "uri" },
          "license": { "type": "string", "format": "uri" }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string" },
          "detail": { "type": "string" }
        }
      }
    }
  }
}
