{
  "swagger": "2.0",
  "info": {
    "title": "Zetaleap Edge Finance & 2FA",
    "description": "8 sub-2ms Zetaleap Cloud APIs for Power Automate & Power Apps: SEPA EPC GiroCode & TR FAST Payment QR Card SVGs, corporate fuzzy vendor matching & deduplication, 9-language legal invoice Amount-to-Words, JSON Audit Diff HTML tables, RFC 6238 TOTP 2FA + QR, Cron scheduler, and safe OData.",
    "version": "1.0.0",
    "contact": {
      "name": "Zetaleap Support Team",
      "url": "https://zetaleap.com/#contact",
      "email": "support_team@zetaleap.com"
    }
  },
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://zetaleap.com"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://zetaleap.com/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Finance;Security and Compliance"
    }
  ],
  "host": "zetaleap.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Enter your Zetaleap Personal Access Token prefixed with Bearer (example: Bearer zl_your_api_token). Generate tokens free at https://zetaleap.com/profile."
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/api/edge/amount-to-words": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "ConvertAmountToWords",
        "summary": "Convert invoice amount to legal words in 9 languages",
        "description": "Converts numeric invoice or check totals into localized legal spell-out text across 9 languages (TR, EN, DE, FR, ES, IT, NL, PT, PL) including Turkish e-Fatura #Yalniz...# format.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "x-ms-summary": "Invoice Amount"
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "TRY",
                    "USD",
                    "EUR",
                    "GBP"
                  ],
                  "default": "TRY",
                  "x-ms-summary": "Currency Code"
                },
                "lang": {
                  "type": "string",
                  "enum": [
                    "tr",
                    "en",
                    "de",
                    "fr",
                    "es",
                    "it",
                    "nl",
                    "pt",
                    "pl"
                  ],
                  "default": "tr",
                  "x-ms-summary": "Language"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Legal amount in words",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "words": {
                      "type": "string",
                      "x-ms-summary": "Amount in Words"
                    },
                    "accountingCompact": {
                      "type": "string",
                      "x-ms-summary": "Check / e-Fatura Compact String"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/json-diff": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "DiffJsonRecordAudit",
        "summary": "Compare Before and After JSON records into HTML Audit Table",
        "description": "Computes field-level changes between two SharePoint or Dataverse JSON objects with automatic secret masking and Outlook-ready HTML table output.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "before",
                "after"
              ],
              "properties": {
                "before": {
                  "type": "object",
                  "x-ms-summary": "Before JSON Snapshot"
                },
                "after": {
                  "type": "object",
                  "x-ms-summary": "After JSON Snapshot"
                },
                "redactSecrets": {
                  "type": "boolean",
                  "default": true,
                  "x-ms-summary": "Mask Sensitive Keys"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audit diff result",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "hasChanges": {
                      "type": "boolean"
                    },
                    "changedCount": {
                      "type": "integer"
                    },
                    "htmlAuditTable": {
                      "type": "string",
                      "x-ms-summary": "Inline HTML Audit Table"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/edge/totp": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "ManageTotpAuthenticator",
        "summary": "Provision or verify RFC 6238 2FA Authenticator OTP",
        "description": "Generates Base32 TOTP secrets + Authenticator QR SVGs or verifies 6-digit OTP codes for high-value Power Apps approvals.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "provision",
                    "verify"
                  ],
                  "default": "provision",
                  "x-ms-summary": "Mode"
                },
                "secret": {
                  "type": "string",
                  "x-ms-summary": "Base32 Secret"
                },
                "token": {
                  "type": "string",
                  "x-ms-summary": "6-Digit OTP Token (Verify mode)"
                },
                "issuer": {
                  "type": "string",
                  "default": "Zetaleap",
                  "x-ms-summary": "Issuer Name"
                },
                "accountName": {
                  "type": "string",
                  "x-ms-summary": "Account Email"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "TOTP provisioning or verification result"
          }
        }
      }
    },
    "/api/edge/cron-schedule": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "AnalyzeCronSchedule",
        "summary": "Explain 5-field Cron expression and calculate next runs",
        "description": "Validates Cron expressions, returns EN/TR human descriptions, and calculates upcoming ISO run timestamps.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "required": [
                "expression"
              ],
              "properties": {
                "expression": {
                  "type": "string",
                  "default": "30 9 * * 1-5",
                  "x-ms-summary": "5-Field Cron Expression"
                },
                "utcOffsetHours": {
                  "type": "integer",
                  "default": 3,
                  "x-ms-summary": "UTC Offset Hours"
                },
                "count": {
                  "type": "integer",
                  "default": 5,
                  "x-ms-summary": "Number of Upcoming Runs"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cron summary and upcoming runs"
          }
        }
      }
    },
    "/api/edge/jwt-odata": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "BuildOdataOrInspectJwt",
        "summary": "Build safe SharePoint/Dataverse OData filter or inspect JWT claims",
        "description": "Escapes OData $filter expressions for SharePoint and Dataverse or safely decodes JWT payload claims and expiry.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "odata",
                    "jwt"
                  ],
                  "default": "odata"
                },
                "token": {
                  "type": "string",
                  "x-ms-summary": "JWT Token (jwt mode)"
                },
                "logicalJoin": {
                  "type": "string",
                  "enum": [
                    "and",
                    "or"
                  ],
                  "default": "and"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OData filter or decoded JWT claims"
          }
        }
      }
    },
    "/api/edge/smart-link": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "BuildSmartCampaignLink",
        "summary": "Build WhatsApp, Teams chat or UTM link with QR SVG",
        "description": "Generates clickable WhatsApp Business (wa.me), Microsoft Teams direct chat, or UTM links plus scannable QR SVGs.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "whatsapp",
                    "teams",
                    "utm"
                  ],
                  "default": "whatsapp"
                },
                "phone": {
                  "type": "string",
                  "x-ms-summary": "WhatsApp Phone (+CountryCode)"
                },
                "teamsUserEmail": {
                  "type": "string",
                  "x-ms-summary": "Teams User Email"
                },
                "targetUrl": {
                  "type": "string",
                  "x-ms-summary": "Target URL (UTM mode)"
                },
                "message": {
                  "type": "string",
                  "x-ms-summary": "Pre-filled Message"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated deep link and QR Data URI"
          }
        }
      }
    },
    "/api/edge/payment-qr": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "GeneratePaymentQrCard",
        "summary": "Generate SEPA EPC GiroCode or TR FAST IBAN Payment QR Card SVG",
        "description": "Validates ISO 13616 MOD-97 IBAN and generates bank-app-scannable EU SEPA EPC GiroCode, TR FAST/IBAN, or Payment Link QR SVGs and printable Payment Card SVGs.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "standard": {
                  "type": "string",
                  "enum": [
                    "sepa_epc",
                    "tr_fast",
                    "payment_url"
                  ],
                  "default": "sepa_epc",
                  "x-ms-summary": "Payment QR Standard"
                },
                "beneficiaryName": {
                  "type": "string",
                  "x-ms-summary": "Beneficiary Legal Name"
                },
                "iban": {
                  "type": "string",
                  "x-ms-summary": "Beneficiary IBAN (MOD-97 Checked)"
                },
                "bic": {
                  "type": "string",
                  "x-ms-summary": "Optional SWIFT / BIC Code"
                },
                "amount": {
                  "type": "number",
                  "x-ms-summary": "Payment Amount"
                },
                "currency": {
                  "type": "string",
                  "enum": [
                    "EUR",
                    "TRY",
                    "USD",
                    "GBP"
                  ],
                  "default": "EUR",
                  "x-ms-summary": "Currency Code"
                },
                "remittanceText": {
                  "type": "string",
                  "x-ms-summary": "Invoice / Remittance Reference"
                },
                "paymentUrl": {
                  "type": "string",
                  "x-ms-summary": "HTTPS Checkout Link (payment_url mode)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "rawPayload, qrSvg, cardSvg, cardDataUri, and Outlook htmlImgTag"
          }
        }
      }
    },
    "/api/edge/fuzzy-match": {
      "post": {
        "tags": [
          "Edge Finance & Security"
        ],
        "operationId": "FuzzyMatchAndDeduplicateRecords",
        "summary": "Fuzzy match vendor/customer names or deduplicate JSON records",
        "description": "Normalizes Turkish/European diacritics and corporate legal suffixes (A.S., Ltd. Sti., GmbH, B.V., Inc.) and scores records via hybrid Jaro-Winkler + Token Jaccard similarity.",
        "x-ms-visibility": "important",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "match",
                    "deduplicate"
                  ],
                  "default": "match",
                  "x-ms-summary": "Operation Mode"
                },
                "query": {
                  "type": "string",
                  "x-ms-summary": "Target Vendor / Customer Name (match mode)"
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "Candidate Records Array (match mode)"
                },
                "records": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  },
                  "x-ms-summary": "Records Array to Deduplicate"
                },
                "keyField": {
                  "type": "string",
                  "default": "name",
                  "x-ms-summary": "Field Name to Compare"
                },
                "threshold": {
                  "type": "number",
                  "default": 0.78,
                  "x-ms-summary": "Similarity Threshold (0.30-0.99)"
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "bestMatch + ranked matches[] or uniqueRecords[] + duplicateClusters[]"
          }
        }
      }
    }
  }
}