{
  "openapi": "3.1.0",
  "info": {
    "title": "Blaaiz Platform API - Delete KYB Document",
    "version": "1.0.0",
    "description": "Soft-delete a KYB document on a business-type customer. Not allowed when the document is locked (status `APPROVED` or `PROCESSING`)."
  },
  "tags": [
    {
      "name": "Customer"
    }
  ],
  "servers": [
    {
      "url": "https://api-prod.blaaiz.com"
    },
    {
      "url": "https://api-dev.blaaiz.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2ClientCredentials": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "customer:write": "Create and update customers and KYC data."
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/external/customer/{customer}/document/{document}": {
      "delete": {
        "summary": "Delete a KYB document",
        "description": "Removes a KYB document from the customer's collection. Returns 400 if the document is locked (status APPROVED or PROCESSING). Required scope: `customer:write`.",
        "tags": [
          "Customer"
        ],
        "security": [
          {
            "oauth2ClientCredentials": [
              "customer:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "document",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document deleted.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Document deleted successfully"
                }
              }
            }
          },
          "400": {
            "description": "Document is locked (APPROVED or PROCESSING)."
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Customer or document not found."
          }
        }
      }
    }
  }
}