{
  "openapi": "3.1.0",
  "info": {
    "title": "Fidem API",
    "version": "0.2.0",
    "summary": "Check the company behind an online shop before an AI agent pays.",
    "description": "Free lookup of any online shop by domain. Every fact carries its source and date. It says whether the shop publishes a signed Merchant Verification File (MVF), which company it claims to be and whether that company is in an official register (VIES in the EU, Companies House in the UK), plus domain age, first archived copy, TLS certificate and published return window. It does not rate products, deliveries or service. An unverified shop is not a fraudulent shop. Limit: 300 lookups per hour per IP. Use GET /api/v1/shop for English field names. GET /api/v1/tienda is the original endpoint with the same data and Spanish field names, kept for existing integrations. Also available as a remote MCP server at https://fidemcheck.com/mcp (tool check_shop, English; tool consultar_tienda, Spanish).",
    "contact": {
      "name": "Fidem",
      "email": "hola@fidemcheck.com",
      "url": "https://fidemcheck.com/for-agents.html"
    },
    "license": {
      "name": "MVF specification: CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://fidemcheck.com"
    }
  ],
  "paths": {
    "/api/v1/shop": {
      "get": {
        "operationId": "checkShop",
        "summary": "Check an online shop by domain",
        "description": "Use before paying in an unfamiliar online shop. Answers in under 20 seconds. English field names, codes and notes.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Shop domain or URL, for example shop.example",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facts about the shop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShopLookup"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid domain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "invalid_domain"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 300 lookups per hour from this IP"
          }
        }
      }
    },
    "/api/v1/tienda": {
      "get": {
        "operationId": "consultarTienda",
        "summary": "Check an online shop by domain (Spanish field names)",
        "description": "Original endpoint, kept for existing integrations. Same data as /api/v1/shop, with Spanish field names and codes. Use before paying in an unfamiliar online shop. Answers in under 20 seconds.",
        "parameters": [
          {
            "name": "dominio",
            "in": "query",
            "required": true,
            "description": "Shop domain or URL, for example shop.example",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Facts about the shop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Consulta"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid domain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "const": "dominio_no_valido"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 300 lookups per hour from this IP"
          }
        }
      }
    },
    "/v/{dominio}": {
      "get": {
        "operationId": "estadoVerificacion",
        "summary": "Verification status of a shop (revocation check)",
        "description": "JSON for agents; HTML when the Accept header asks for text/html. status is valid, in_review, expired, revoked or not_verified.",
        "parameters": [
          {
            "name": "dominio",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The shop has a verification record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estado"
                }
              }
            }
          },
          "404": {
            "description": "The shop has not verified with Fidem",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estado"
                }
              }
            }
          }
        }
      }
    },
    "/v/{dominio}/merchant-verification.json": {
      "get": {
        "operationId": "archivoFirmado",
        "summary": "Current signed MVF file of a verified shop",
        "parameters": [
          {
            "name": "dominio",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Signed MVF 0.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No signed file"
          }
        }
      }
    },
    "/.well-known/mvf-keys.json": {
      "get": {
        "operationId": "clavesPublicas",
        "summary": "Fidem public keys (Ed25519) to check MVF signatures",
        "responses": {
          "200": {
            "description": "Key set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kid": {
                            "type": "string"
                          },
                          "alg": {
                            "type": "string"
                          },
                          "x": {
                            "type": "string"
                          },
                          "not_after": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fact": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "confirmed, no_data, published, not_published, not_checked"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "ShopLookup": {
        "type": "object",
        "required": [
          "schema",
          "domain",
          "checked_at",
          "level",
          "notice"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "const": "fidem-lookup/0.1"
          },
          "domain": {
            "type": "string"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          },
          "level": {
            "type": "string",
            "enum": [
              "merchant_verified",
              "public_lookup"
            ],
            "description": "merchant_verified only when the shop publishes a valid signed MVF file for this domain."
          },
          "owner_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "company",
              "sole_trader",
              null
            ],
            "description": "Only when level is merchant_verified. company: public name and register ID. sole_trader: registered with the Spanish tax agency; identity held by the verifier, not published."
          },
          "notice": {
            "type": "string",
            "description": "Plain sentence to pass to the user."
          },
          "mvf_file": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "verified",
                  "no_file",
                  "invalid",
                  "expired",
                  "revoked"
                ]
              },
              "legal_entity": {
                "type": "object"
              },
              "expires_at": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "hosting": {
                "type": "string",
                "enum": [
                  "on_shop_site",
                  "delegated_to_verifier",
                  "verifier_registry"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "company": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "in_register",
                  "not_in_vies",
                  "not_active",
                  "in_certificate",
                  "published",
                  "not_published",
                  "not_checked",
                  "sole_trader"
                ]
              },
              "identifier": {
                "type": "object",
                "properties": {
                  "scheme": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                }
              },
              "registered_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "declared_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "register": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "domain_registered": {
            "$ref": "#/components/schemas/Fact"
          },
          "first_archived_copy": {
            "$ref": "#/components/schemas/Fact"
          },
          "certificates": {
            "$ref": "#/components/schemas/Fact"
          },
          "return_window": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "days": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "quote": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Sentence on the shop page the number comes from, quoted as written."
              }
            }
          },
          "phishing_lists": {
            "type": "object",
            "description": "Whether the domain is on an open phishing list. code: listed, not_listed or pending.",
            "properties": {
              "code": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "updated_on": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "agent_access": {
            "type": "object",
            "description": "What the shop robots.txt tells AI agents. code: open (none of the user-triggered agents or AI search bots is blocked), partial, closed or no_data.",
            "properties": {
              "code": {
                "type": "string"
              },
              "robots_txt": {
                "type": "string",
                "enum": [
                  "read",
                  "none"
                ]
              },
              "source": {
                "type": "string"
              },
              "acting_for_users": {
                "type": "object",
                "description": "ChatGPT-User, Claude-User, Perplexity-User.",
                "properties": {
                  "allowed": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "blocked": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "ai_search": {
                "type": "object",
                "description": "OAI-SearchBot, Claude-SearchBot, PerplexityBot.",
                "properties": {
                  "allowed": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "blocked": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "training": {
                "type": "object",
                "description": "Training crawlers.",
                "properties": {
                  "allowed": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "blocked": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "note": {
                "type": "string"
              }
            }
          },
          "does_not_say": {
            "type": "string"
          },
          "specification": {
            "type": "string"
          }
        }
      },
      "Dato": {
        "type": "object",
        "properties": {
          "codigo": {
            "type": "string",
            "description": "confirmado, sin_dato, publicado, no_publicado, sin_comprobar"
          },
          "fuente": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "Consulta": {
        "type": "object",
        "required": [
          "esquema",
          "dominio",
          "comprobado",
          "nivel",
          "aviso"
        ],
        "properties": {
          "esquema": {
            "type": "string",
            "const": "fidem-consulta/0.1"
          },
          "dominio": {
            "type": "string"
          },
          "comprobado": {
            "type": "string",
            "format": "date-time"
          },
          "nivel": {
            "type": "string",
            "enum": [
              "verificada_por_la_tienda",
              "consulta_publica"
            ],
            "description": "verificada_por_la_tienda only when the shop publishes a valid signed MVF file for this domain."
          },
          "aviso": {
            "type": "string",
            "description": "Plain sentence to pass to the user."
          },
          "archivo_mvf": {
            "type": "object",
            "properties": {
              "codigo": {
                "type": "string",
                "enum": [
                  "verificada",
                  "sin_archivo",
                  "invalido",
                  "caducado",
                  "revocada"
                ]
              },
              "empresa": {
                "type": "object"
              },
              "expira": {
                "type": "string"
              },
              "alojamiento": {
                "type": "string"
              },
              "tipo_titular": {
                "type": "string",
                "enum": [
                  "sociedad",
                  "autonomo"
                ]
              }
            },
            "additionalProperties": true
          },
          "empresa": {
            "type": "object",
            "properties": {
              "codigo": {
                "type": "string",
                "enum": [
                  "en_registro",
                  "no_en_vies",
                  "no_activa",
                  "en_certificado",
                  "publicado",
                  "no_publicado",
                  "sin_comprobar",
                  "persona_fisica"
                ]
              },
              "identificador": {
                "type": "object",
                "properties": {
                  "esquema": {
                    "type": "string"
                  },
                  "valor": {
                    "type": "string"
                  }
                }
              },
              "nombre_registrado": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "nombre_certificado": {
                "type": "string"
              },
              "registro": {
                "type": "string"
              },
              "nota": {
                "type": "string"
              },
              "nombre_declarado": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Company name the site states next to its tax ID in its legal notice. What the site says, not what the register says."
              }
            },
            "additionalProperties": true
          },
          "dominio_registrado": {
            "$ref": "#/components/schemas/Dato"
          },
          "primera_copia_archivada": {
            "$ref": "#/components/schemas/Dato"
          },
          "certificados": {
            "$ref": "#/components/schemas/Dato"
          },
          "plazo_devolucion": {
            "type": "object",
            "properties": {
              "codigo": {
                "type": "string"
              },
              "dias": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "fuente": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cita": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Sentence on the shop page the number comes from."
              }
            }
          },
          "no_dice": {
            "type": "string"
          },
          "especificacion": {
            "type": "string"
          },
          "tipo_titular": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sociedad",
              "autonomo",
              null
            ],
            "description": "Only when nivel is verificada_por_la_tienda. sociedad: company with public name and register ID. autonomo: sole trader registered with the tax agency; identity held by the verifier, not published."
          },
          "listas_webs_peligrosas": {
            "type": "object",
            "description": "Whether the domain is on an open phishing list. codigo: en_lista, no_en_listas or pendiente.",
            "properties": {
              "codigo": {
                "type": "string"
              },
              "fuente": {
                "type": "string"
              },
              "actualizada": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "acceso_agentes": {
            "type": "object",
            "description": "What the shop robots.txt tells AI agents. codigo: abierto (none of the user-triggered agents or AI search bots is blocked), parcial, cerrado or sin_dato.",
            "properties": {
              "codigo": {
                "type": "string"
              },
              "robots_txt": {
                "type": "string"
              },
              "fuente": {
                "type": "string"
              },
              "actuan_por_usuario": {
                "type": "object",
                "description": "ChatGPT-User, Claude-User, Perplexity-User: permitidos and bloqueados."
              },
              "buscadores_ia": {
                "type": "object",
                "description": "OAI-SearchBot, Claude-SearchBot, PerplexityBot: permitidos and bloqueados."
              },
              "entrenamiento": {
                "type": "object",
                "description": "Training crawlers: permitidos and bloqueados."
              },
              "nota": {
                "type": "string"
              }
            }
          }
        }
      },
      "Estado": {
        "type": "object",
        "properties": {
          "dominio": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "valid",
              "in_review",
              "expired",
              "revoked",
              "not_verified"
            ]
          },
          "expires_at": {
            "type": "string"
          },
          "legal_entity": {
            "type": "object"
          },
          "file": {
            "type": "string"
          }
        }
      }
    }
  }
}
