{
  "openapi": "3.0.0",
  "info": {
    "title": "Transaction Sanction Checker API",
    "version": "0.3.2",
    "description": "API to check bank transactions against sanction lists."
  },
  "servers": [
    {
      "url": "https://complycontrol.com/"
    }
  ],
  "paths": {
    "/catalog": {
      "get": {
        "summary": "A catalog with a comprehensive list of sanction lists through which transactions are verified.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "datasets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entities_url": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/sanctions": {
      "post": {
        "summary": "Check transactions against sanctions list",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "benef_name": {
                    "type": "string",
                    "description": "Beneficiary name."
                  },
                  "benef_address": {
                    "type": "string",
                    "description": "Beneficiary address."
                  },
                  "benef_country": {
                    "type": "string",
                    "description": "Beneficiary country."
                  },
                  "benef_BIC": {
                    "type": "string",
                    "description": "Beneficiary BIC/SWIFT code."
                  },
                  "benef_bank_name": {
                    "type": "string",
                    "description": "Beneficiary bank name."
                  },
                  "benef_bank_address": {
                    "type": "string",
                    "description": "Beneficiary bank address."
                  },
                  "reference_text": {
                    "type": "string",
                    "description": "Reference text."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction checked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/PositiveResponse"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/PositiveResponse"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/BlacklistResponse"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PositiveResponse": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "caption": {
                "type": "string"
              },
              "datasets": { "type": "array", "items": { "type": "string" } },
              "features": {
                "type": "object",
                "properties": {
                  "country_mismatch": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "person_name_jaro_winkler": {
                    "type": "integer",
                    "format": "int32"
                  },
                  "person_name_phonetic_match": {
                    "type": "number"
                  }
                }
              },
              "first_seen": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "last_change": {
                "type": "string"
              },
              "last_seen": {
                "type": "string"
              },
              "match": {
                "type": "boolean"
              },
              "properties": {
                "type": "object",
                "properties": {
                  "alias": { "type": "array", "items": { "type": "string" } },
                  "birthCountry": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "birthDate": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "birthPlace": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "country": { "type": "array", "items": { "type": "string" } },
                  "createdAt": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "education": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "fatherName": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "firstName": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "gender": { "type": "array", "items": { "type": "string" } },
                  "innCode": { "type": "array", "items": { "type": "string" } },
                  "keywords": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "lastName": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "modifiedAt": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "name": { "type": "array", "items": { "type": "string" } },
                  "nationality": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "notes": { "type": "array", "items": { "type": "string" } },
                  "position": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "secondName": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "sourceUrl": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "status": { "type": "array", "items": { "type": "string" } },
                  "taxNumber": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "topics": { "type": "array", "items": { "type": "string" } },
                  "wikidataId": {
                    "type": "array",
                    "items": { "type": "string" }
                  }
                }
              },
              "referents": { "type": "array", "items": { "type": "string" } },
              "schema": {
                "type": "string"
              },
              "score": {
                "type": "number"
              },
              "target": {
                "type": "boolean"
              }
            }
          },
          "resultsFound": {
            "type": "boolean"
          },
          "uid": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whitelistMatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "word": {
                  "type": "string",
                  "description": "Whitelist matched word"
                },
                "id": {
                  "type": "string",
                  "description": "Whitelist matched word id"
                },
                "key": {
                  "type": "string",
                  "description": "Input object matched key name"
                },
                "value": {
                  "type": "string",
                  "description": "Input object matched value"
                }
              }
            }
          }
        },
        "type": "object"
      },
      "NegativeResponse": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "datasets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entities_url": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "resultsFound": {
            "type": "boolean"
          },
          "uid": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whitelistMatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "word": {
                  "type": "string",
                  "description": "Whitelist matched word"
                },
                "id": {
                  "type": "string",
                  "description": "Whitelist matched word id"
                },
                "key": {
                  "type": "string",
                  "description": "Input object matched key name"
                },
                "value": {
                  "type": "string",
                  "description": "Input object matched value"
                }
              }
            }
          }
        },
        "type": "object"
      },
      "BlacklistResponse": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "blacklist_matches": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "word": {
                      "type": "string",
                      "description": "Blacklist matched word"
                    },
                    "id": {
                      "type": "string",
                      "description": "Blacklist matched word id"
                    },
                    "key": {
                      "type": "string",
                      "description": "Input object matched key name"
                    },
                    "value": {
                      "type": "string",
                      "description": "Input object matched value"
                    }
                  }
                }
              }
            }
          },
          "resultsFound": {
            "type": "boolean"
          },
          "uid": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "whitelistMatches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "word": {
                  "type": "string",
                  "description": "Whitelist matched word"
                },
                "id": {
                  "type": "string",
                  "description": "Whitelist matched word id"
                },
                "key": {
                  "type": "string",
                  "description": "Input object matched key name"
                },
                "value": {
                  "type": "string",
                  "description": "Input object matched value"
                }
              }
            }
          }
        },
        "type": "object"
      }
    }
  }
}
