{
  "openapi": "3.1.0",
  "info": {
    "title": "Ospree Service",
    "version": "0.1.0",
    "x-ospree-baseline": {
      "legacy_repo": "compliance-engine",
      "legacy_ref": "main",
      "legacy_sha": "d0ff1a62f06e82cc39fcb0eab7a1699f6e08b3a9",
      "rendered_by": "none in repo history \u2014 rendered with the equivalent in docs/api/baseline/README.md",
      "api_prefix": "/api/v2",
      "surface": "/api/v2/ only \u2014 see scripts/legacy_baseline.py",
      "adr": "ADR-0035"
    }
  },
  "paths": {
    "/api/v2/engine/evaluate": {
      "post": {
        "tags": [
          "rule evaluation"
        ],
        "summary": "Evaluate Transaction",
        "operationId": "evaluate_transaction_api_v2_engine_evaluate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleEvalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "RuleEvalRequest": {
        "properties": {
          "transaction": {
            "$ref": "#/components/schemas/TransactionRequest",
            "description": "Transaction details to evaluate against the rules"
          },
          "rule_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Rule Codes",
            "description": "List of rule codes to evaluate, if not provided all active rules will be evaluated"
          }
        },
        "type": "object",
        "required": [
          "transaction",
          "rule_codes"
        ],
        "title": "RuleEvalRequest"
      },
      "TransactionRequest": {
        "properties": {
          "transaction_id": {
            "type": "string",
            "minLength": 3,
            "title": "Transaction Id",
            "description": "Unique transaction identifier"
          },
          "originator_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Originator Address",
            "description": "Wallet involved in the transaction"
          },
          "originator_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Originator Name",
            "description": "Sender identifier"
          },
          "originator_account_reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Originator Account Reference Id",
            "description": "Sender account identifier"
          },
          "beneficiary_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beneficiary Address",
            "description": "Recepient wallet involved in the transaction"
          },
          "beneficiary_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beneficiary Name",
            "description": "Recipient identifier"
          },
          "beneficiary_account_reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beneficiary Account Reference Id",
            "description": "Recepient account identifier"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Amount",
            "description": "Amount transferred"
          },
          "currency": {
            "type": "string",
            "maxLength": 5,
            "minLength": 2,
            "title": "Currency",
            "description": "Currency code (e.g., AED, USD)"
          },
          "country_code": {
            "type": "string",
            "minLength": 2,
            "title": "Country Code",
            "description": "Country to verify the threshold (use ISO 3166-1 alpha-2 country code, e.g. AE for United Arab Emirates)."
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata",
            "description": "Additional transaction metadata"
          }
        },
        "type": "object",
        "required": [
          "transaction_id",
          "amount",
          "currency",
          "country_code"
        ],
        "title": "TransactionRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
