{
  "openapi": "3.1.0",
  "info": {
    "title": "Trusted Agent Protocol",
    "description": "A merchant (or bot protection service) facing specification defining how to verify the signatures provided by agents and recommendations for the use of the signed content",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://sandbox.api.visa.com",
      "description": "Sandbox server"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Trusted Agent Protocol",
      "description": "Trusted Agent Protocol"
    },
    {
      "name": "Visa Merchant Registry Service",
      "description": " A high-performance micro service for managing merchant identities and encryption key distribution, enabling secure payment request encryption in the TAP ecosystem"
    }
  ],
  "paths": {
    "/vmrs/v1/merchants/{merchantId}/keys/{keyId}": {
      "get": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Get Merchant Key",
        "description": "Get a specific key by merchant ID and key ID. Raises 404 if key or merchant not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "Unique key identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant or key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys~1{keyId}/get",
            "default": false
          }
        ],
        "x-hideTryIt": true
      },
      "put": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Update Merchant Key",
        "description": "Update key information. Updatable fields: keyName, encryptionKey, algorithm, encryptionType, expirationDate. Raises 404 if merchant or key not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "Unique key identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Key update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Key updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant or key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "keyUpdate",
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys~1{keyId}/put",
            "default": false
          }
        ],
        "x-hideTryIt": true
      },
      "delete": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Delete Merchant Key",
        "description": "Delete a key. Returns 200 with confirmation message. Raises 404 if key not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "Unique key identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                },
                "example": {
                  "message": "Key deleted successfully"
                }
              }
            }
          },
          "404": {
            "description": "Merchant or key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys~1{keyId}/delete",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    },
    "/vmrs/v1/merchants/{merchantId}": {
      "get": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Get Merchant",
        "description": "Get merchant by ID with all associated keys. Raises 404 if merchant not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Merchant details with keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantResponse"
                },
                "example": {
                  "id": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
                  "keys": [],
                  "vmid": "40010030273",
                  "isActive": true,
                  "createdAt": "2024-01-15T10:30:00.000Z",
                  "indicator": "TAP",
                  "updatedAt": "2024-01-15T10:30:00.000Z",
                  "merchantUrl": "https://acme.example.com",
                  "merchantName": "Acme Corp",
                  "cryptogramType": "DAVV",
                  "paymentPayloadType": "UNENCRYPTED"
                }
              }
            }
          },
          "404": {
            "description": "Merchant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}/get",
            "default": false
          }
        ],
        "x-hideTryIt": true
      },
      "put": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Update Merchant",
        "description": "Update merchant information. All fields are optional. Raises 404 if merchant not found, 409 if new merchantUrl already exists.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Merchant update request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Merchant updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - merchantUrl already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "merchantUpdate",
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}/put",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    },
    "/vmrs/v1/merchants": {
      "post": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Create Merchant",
        "description": "Register a new merchant.",
        "requestBody": {
          "description": "Merchant registration request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Merchant created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantResponse"
                },
                "example": {
                  "id": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
                  "keys": [],
                  "vmid": "40010030273",
                  "isActive": true,
                  "createdAt": "2024-01-15T10:30:00.000Z",
                  "indicator": "TAP",
                  "updatedAt": "2024-01-15T10:30:00.000Z",
                  "merchantUrl": "https://acme.example.com",
                  "merchantName": "Acme Corp",
                  "cryptogramType": "DAVV",
                  "paymentPayloadType": "UNENCRYPTED"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - merchantUrl already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "merchantRequest",
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants/post",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    },
    "/vmrs/v1/merchants/{merchantId}/keys": {
      "get": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "List Merchant Keys",
        "description": "List all encryption keys for a specific merchant.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of keys",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantKeysListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys/get",
            "default": false
          }
        ],
        "x-hideTryIt": true
      },
      "post": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Create Merchant Key",
        "description": "Add a new encryption key for a merchant. New keys are created in deactivated state; use the activate endpoint to enable them. Raises 404 if merchant not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Key creation request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Key created successfully (deactivated by default)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResponse"
                },
                "example": {
                  "id": "a1b2c384-56c7-48d9-be0f-1e2d3c4b5a6f",
                  "keyName": "primary-key",
                  "isActive": false,
                  "algorithm": "RSA-OAEP",
                  "createdAt": "2024-01-15T10:30:00.000Z",
                  "updatedAt": "2024-01-15T10:30:00.000Z",
                  "merchantId": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a",
                  "merchantName": "Acme Corp",
                  "encryptionKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...",
                  "encryptionType": "A256GCM",
                  "expirationDate": "2026-12-31T23:59:59.000Z"
                }
              }
            }
          },
          "404": {
            "description": "Merchant not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "keyRequest",
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys/post",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    },
    "/vmrs/v1/merchants/{merchantId}/keys/{keyId}/activate": {
      "post": {
        "tags": ["Visa Merchant Registry Service"],
        "summary": "Activate Merchant Key",
        "description": "Activate a key. Idempotent — activating an already-active key returns 200. Raises 404 if merchant or key not found.",
        "parameters": [
          {
            "name": "merchantId",
            "in": "path",
            "description": "Unique merchant identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "description": "Unique key identifier (UUID)",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key activated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Merchant or key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1vmrs~1v1~1merchants~1{merchantId}~1keys~1{keyId}~1activate/post",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    },
    "/v1/trustedAgentProtocol": {
      "get": {
        "tags": ["Trusted Agent Protocol"],
        "summary": "Trusted Agent Protocol",
        "description": "Trusted Agent Protocol",
        "x-operationVersions": [
          {
            "label": "v1 - Latest",
            "operationPointer": "#/paths/~1v1~1trustedAgentProtocol/get",
            "default": false
          }
        ],
        "x-hideTryIt": true
      }
    }
  },
  "components": {
    "schemas": {
      "MerchantUpdate": {
        "type": "object",
        "properties": {
          "merchantUrl": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Base merchant URL",
            "example": "https://acme-updated.example.com"
          },
          "merchantName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Doing business as (DBA) name",
            "example": "Acme Corp Updated"
          },
          "cryptogramType": {
            "type": "string",
            "description": "Authentication method",
            "example": "TAVV",
            "enum": ["TAVV", "DAVV"]
          },
          "apiIntegrations": {
            "$ref": "#/components/schemas/ApiIntegrations"
          },
          "webIntegrations": {
            "$ref": "#/components/schemas/WebIntegrations"
          },
          "paymentPayloadType": {
            "type": "string",
            "description": "Credential format",
            "example": "UNENCRYPTED",
            "enum": ["UNENCRYPTED", "ENCRYPTED"]
          },
          "protocolInteractions": {
            "type": "array",
            "description": "List of protocol interaction configurations",
            "items": {
              "$ref": "#/components/schemas/ProtocolInteraction"
            }
          },
          "acceptanceRelationships": {
            "type": "array",
            "description": "List of acceptance network relationships",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "KeyResponse": {
        "required": [
          "algorithm",
          "createdAt",
          "encryptionKey",
          "encryptionType",
          "id",
          "isActive",
          "keyName",
          "merchantId",
          "merchantName",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique key identifier (UUID)",
            "example": "a1b2c384-56c7-48d9-be0f-1e2d3c4b5a6f"
          },
          "keyName": {
            "type": "string",
            "description": "Key name",
            "example": "primary-key"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the key is active",
            "example": false
          },
          "algorithm": {
            "type": "string",
            "description": "Key wrapping algorithm",
            "example": "RSA-OAEP"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "merchantId": {
            "type": "string",
            "description": "Merchant identifier",
            "example": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a"
          },
          "merchantName": {
            "type": "string",
            "description": "Merchant name",
            "example": "Acme Corp"
          },
          "encryptionKey": {
            "type": "string",
            "description": "Base64-encoded asymmetric public key",
            "example": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
          },
          "encryptionType": {
            "type": "string",
            "description": "Content encryption algorithm",
            "example": "A256GCM"
          },
          "expirationDate": {
            "type": "string",
            "description": "Key expiration date",
            "format": "date-time",
            "example": "2026-12-31T23:59:59Z"
          }
        }
      },
      "KeyCreate": {
        "required": ["algorithm", "encryptionKey", "encryptionType", "keyName"],
        "type": "object",
        "properties": {
          "keyName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Unique identifier for the key",
            "example": "primary-key"
          },
          "algorithm": {
            "type": "string",
            "description": "Key wrapping algorithm",
            "example": "RSA-OAEP",
            "enum": ["RSA-OAEP", "RSA-OAEP-256", "RSA-OAEP-384", "RSA-OAEP-512"]
          },
          "encryptionKey": {
            "type": "string",
            "description": "Base64-encoded asymmetric public key (DER, PEM, JWK, or OpenSSH format)",
            "example": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
          },
          "encryptionType": {
            "type": "string",
            "description": "Content encryption algorithm",
            "example": "A256GCM",
            "enum": [
              "A256GCM",
              "A128GCM",
              "C20P",
              "A256CBC_HS512",
              "A128CBC_HS256",
              "A256CCM",
              "A128CCM"
            ]
          },
          "expirationDate": {
            "type": "string",
            "description": "Key expiration date (must be in the future)",
            "format": "date-time",
            "example": "2026-12-31T23:59:59Z"
          }
        }
      },
      "CredentialsResponse": {
        "required": ["merchantId", "merchantName", "merchantUrl"],
        "type": "object",
        "properties": {
          "vmid": {
            "type": "string",
            "description": "Visa Merchant ID",
            "example": "40010030273"
          },
          "message": {
            "type": "string",
            "description": "Message indicating default response when merchant not found",
            "example": "Merchant not found, returning default configuration"
          },
          "merchantId": {
            "type": "string",
            "description": "Merchant unique identifier",
            "example": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a"
          },
          "merchantUrl": {
            "type": "string",
            "description": "Base merchant URL",
            "example": "https://acme.example.com"
          },
          "merchantName": {
            "type": "string",
            "description": "Doing business as (DBA) name",
            "example": "Acme Corp"
          },
          "encryptionKey": {
            "$ref": "#/components/schemas/KeyResponseWithoutMerchant"
          },
          "cryptogramType": {
            "type": "string",
            "description": "Authentication method",
            "example": "DAVV"
          },
          "paymentPayloadType": {
            "type": "string",
            "description": "Credential format",
            "example": "UNENCRYPTED"
          }
        }
      },
      "MessageResponse": {
        "required": ["message"],
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Response message",
            "example": "Operation completed successfully"
          }
        }
      },
      "KeyResponseWithoutMerchant": {
        "required": [
          "algorithm",
          "createdAt",
          "encryptionKey",
          "encryptionType",
          "id",
          "isActive",
          "keyName",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique key identifier (UUID)",
            "example": "a1b2c384-56c7-48d9-be0f-1e2d3c4b5a6f"
          },
          "keyName": {
            "type": "string",
            "description": "Key name",
            "example": "primary-key"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the key is active",
            "example": false
          },
          "algorithm": {
            "type": "string",
            "description": "Key wrapping algorithm",
            "example": "RSA-OAEP"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "encryptionKey": {
            "type": "string",
            "description": "Base64-encoded asymmetric public key",
            "example": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
          },
          "encryptionType": {
            "type": "string",
            "description": "Content encryption algorithm",
            "example": "A256GCM"
          },
          "expirationDate": {
            "type": "string",
            "description": "Key expiration date",
            "format": "date-time",
            "example": "2026-12-31T23:59:59Z"
          }
        }
      },
      "ProtocolInteraction": {
        "required": ["protocol", "url"],
        "type": "object",
        "properties": {
          "url": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Endpoint URL for protocol interaction",
            "example": "https://api.example.com/ucp"
          },
          "metadata": {
            "type": "object",
            "properties": {},
            "description": "Additional protocol configuration (max 10KB)",
            "example": {
              "version": "1.0",
              "features": ["payments"]
            }
          },
          "protocol": {
            "type": "string",
            "description": "Communication protocol type",
            "example": "ucp",
            "enum": ["ucp", "acp", "x402"]
          },
          "documentationUrl": {
            "maxLength": 512,
            "type": "string",
            "description": "URL to protocol documentation",
            "example": "https://docs.example.com/ucp"
          }
        }
      },
      "ErrorResponse": {
        "required": ["detail"],
        "type": "object",
        "properties": {
          "detail": {
            "type": "string",
            "description": "Error description",
            "example": "Resource not found"
          }
        }
      },
      "ApiIntegrations": {
        "required": ["integrationSpec", "url"],
        "type": "object",
        "properties": {
          "url": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Endpoint URL for API integration",
            "example": "https://api.example.com/v1"
          },
          "metadata": {
            "type": "object",
            "properties": {},
            "description": "Additional API configuration (max 10KB)",
            "example": {
              "rateLimit": 1000
            }
          },
          "integrationSpec": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Integration specification URL",
            "example": "https://docs.example.com/rest-v1"
          }
        }
      },
      "KeyUpdate": {
        "type": "object",
        "properties": {
          "keyName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Unique identifier for the key",
            "example": "updated-key"
          },
          "algorithm": {
            "type": "string",
            "description": "Key wrapping algorithm",
            "example": "RSA-OAEP-256",
            "enum": ["RSA-OAEP", "RSA-OAEP-256", "RSA-OAEP-384", "RSA-OAEP-512"]
          },
          "encryptionKey": {
            "type": "string",
            "description": "Base64-encoded asymmetric public key",
            "example": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
          },
          "encryptionType": {
            "type": "string",
            "description": "Content encryption algorithm",
            "example": "A256GCM",
            "enum": [
              "A256GCM",
              "A128GCM",
              "C20P",
              "A256CBC_HS512",
              "A128CBC_HS256",
              "A256CCM",
              "A128CCM"
            ]
          },
          "expirationDate": {
            "type": "string",
            "description": "Key expiration date (must be in the future)",
            "format": "date-time",
            "example": "2027-12-31T23:59:59Z"
          }
        }
      },
      "MerchantCreate": {
        "required": ["indicator", "merchantName", "merchantUrl"],
        "type": "object",
        "properties": {
          "vmid": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Visa Merchant ID (optional)",
            "example": "40010030273"
          },
          "indicator": {
            "type": "string",
            "description": "Transaction processing type",
            "example": "TAP",
            "enum": ["TAP", "ACG", "BOTH"]
          },
          "merchantUrl": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Base merchant URL",
            "example": "https://acme.example.com"
          },
          "merchantName": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "Doing business as (DBA) name for agent interactions",
            "example": "Acme Corp"
          },
          "encryptionKey": {
            "$ref": "#/components/schemas/KeyCreate"
          },
          "cryptogramType": {
            "type": "string",
            "description": "Authentication method (default: DAVV)",
            "example": "DAVV",
            "default": "DAVV",
            "enum": ["TAVV", "DAVV"]
          },
          "apiIntegrations": {
            "$ref": "#/components/schemas/ApiIntegrations"
          },
          "webIntegrations": {
            "$ref": "#/components/schemas/WebIntegrations"
          },
          "paymentPayloadType": {
            "type": "string",
            "description": "Credential format (default: UNENCRYPTED)",
            "example": "UNENCRYPTED",
            "default": "UNENCRYPTED",
            "enum": ["UNENCRYPTED", "ENCRYPTED"]
          },
          "protocolInteractions": {
            "type": "array",
            "description": "List of protocol interaction configurations",
            "items": {
              "$ref": "#/components/schemas/ProtocolInteraction"
            }
          },
          "acceptanceRelationships": {
            "type": "array",
            "description": "List of acceptance network relationships",
            "example": ["visa", "mastercard"],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WebIntegrations": {
        "required": ["integrationSpec", "url"],
        "type": "object",
        "properties": {
          "url": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Endpoint URL for web integration",
            "example": "https://web.example.com/api"
          },
          "metadata": {
            "type": "object",
            "properties": {},
            "description": "Additional integration configuration (max 10KB)",
            "example": {
              "retries": 3,
              "timeout": 30
            }
          },
          "integrationSpec": {
            "maxLength": 512,
            "minLength": 1,
            "type": "string",
            "description": "Integration specification URL",
            "example": "https://docs.example.com/openapi3.0"
          }
        }
      },
      "MerchantKeysListResponse": {
        "required": ["keys", "merchantId", "merchantName"],
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "description": "List of encryption keys",
            "items": {
              "$ref": "#/components/schemas/KeyResponseWithoutMerchant"
            }
          },
          "merchantId": {
            "type": "string",
            "description": "Merchant identifier",
            "example": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a"
          },
          "merchantName": {
            "type": "string",
            "description": "Merchant name",
            "example": "Acme Corp"
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "loc": {
                  "type": "array",
                  "description": "Location of the error",
                  "items": {
                    "type": "string"
                  }
                },
                "msg": {
                  "type": "string",
                  "description": "Error message"
                },
                "type": {
                  "type": "string",
                  "description": "Error type"
                }
              }
            }
          }
        }
      },
      "MerchantResponse": {
        "required": [
          "createdAt",
          "id",
          "indicator",
          "isActive",
          "merchantName",
          "merchantUrl",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique merchant identifier (UUID)",
            "example": "7f4c82a1-305e-4f9c-8d2a-1b3e5f7c502a"
          },
          "keys": {
            "type": "array",
            "description": "List of encryption keys associated with the merchant",
            "items": {
              "$ref": "#/components/schemas/KeyResponseWithoutMerchant"
            }
          },
          "vmid": {
            "type": "string",
            "description": "Visa Merchant ID",
            "example": "40010030273"
          },
          "isActive": {
            "type": "boolean",
            "description": "Whether the merchant is active",
            "example": true
          },
          "createdAt": {
            "type": "string",
            "description": "Creation timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "indicator": {
            "type": "string",
            "description": "Transaction processing type",
            "example": "TAP"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update timestamp",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "merchantUrl": {
            "type": "string",
            "description": "Base merchant URL",
            "example": "https://acme.example.com"
          },
          "merchantName": {
            "type": "string",
            "description": "Doing business as (DBA) name",
            "example": "Acme Corp"
          },
          "cryptogramType": {
            "type": "string",
            "description": "Authentication method",
            "example": "DAVV"
          },
          "apiIntegrations": {
            "$ref": "#/components/schemas/ApiIntegrations"
          },
          "webIntegrations": {
            "$ref": "#/components/schemas/WebIntegrations"
          },
          "merchantMetadata": {
            "type": "object",
            "properties": {},
            "description": "Additional merchant metadata"
          },
          "paymentPayloadType": {
            "type": "string",
            "description": "Credential format",
            "example": "UNENCRYPTED"
          },
          "protocolInteractions": {
            "type": "array",
            "description": "List of protocol interaction configurations",
            "items": {
              "$ref": "#/components/schemas/ProtocolInteraction"
            }
          },
          "acceptanceRelationships": {
            "type": "array",
            "description": "List of acceptance network relationships",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "responses": {},
    "parameters": {},
    "examples": {},
    "requestBodies": {},
    "headers": {},
    "callbacks": {}
  },
  "webhooks": {},
  "x-tagGroups": [
    {
      "name": "API Reference",
      "tags": ["Trusted Agent Protocol", "Visa Merchant Registry Service"]
    }
  ]
}
