{
  "openapi": "3.0.1",
  "info": {
    "title": "Screening Hits",
    "description": "This is a generated connector for [SAPS4HANA SAP Watch List Screening Hits API v1.7](https://api.sap.com/api/ScreeningHits/resource) OpenAPI specification. \nThis microservice manages Screening Hits created by the Screening microservice and enables users to decide whether they are true matches or false positives. The Screening Hits are grouped in Screening Hit Collections. The Screening Hit Collection refers to a Business Context e.g. a Sales Order and contains one or more Screened Addresses.",
    "version": "1.7",
    "x-ballerina-init-description": "The connector initialization requires setting the API credentials.\nCreate and configure an OAuth2 client credentials by following [this guide](https://help.sap.com/viewer/b865ed651e414196b39f8922db2122c7/LATEST/en-US/7aefa21a65f94b25b7e639c3931b6f83.html).\n",
    "x-ballerina-display": {
      "label": "SAPS4HANA Watch List Screening Hits",
      "iconPath": "icon.png"
    }
  },
  "externalDocs": {
    "description": "Business Documentation",
    "url": "https://help.sap.com/wls"
  },
  "security": [
    {
      "OAuth2": [
        "ReadScreeningHit",
        "EditBusinessContext",
        "DeleteScreeningHit",
        "LogicallyDeleteScreeningHit"
      ]
    }
  ],
  "paths": {
    "/screeningDecisions": {
      "get": {
        "tags": [
          "Screening Decisions"
        ],
        "summary": "With the parameter screeningRequestKey as input, this API provides the current decision status of a ScreeningHitCollection. This is essential for either blocking or releasing the business transaction.",
        "operationId": "get",
        "parameters": [
          {
            "name": "$filter",
            "in": "query",
            "description": "Filter containing the UUID of the screening request, for example `screeningRequestKey eq 'be9828a4-6992-11e8-adc0-fa7ae01bbebc'`",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Screening Decisions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningDecisions"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Screening request not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/screeningHitCollections": {
      "put": {
        "tags": [
          "Screening Hit Collections"
        ],
        "summary": "In some cases, you may want to post the initial screening request without the businessContext and add it later on. For example, when you screen your business document before it has been persisted, it may not have a documentId yet, and you may want to amend that once saving has been completed. PUT the /screeningHitCollections resource with the screeningRequestKey received in response to the screeningRequest to set the businessContext.",
        "operationId": "put",
        "parameters": [
          {
            "name": "screeningRequestKey",
            "in": "query",
            "description": "UUID of the screening request",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Business context",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessContext"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Business context in the screening hit collection updated",
            "content": {}
          },
          "400": {
            "description": "Bad request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Screening request not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Invalid assumptions",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      },
      "delete": {
        "tags": [
          "Screening Hit Collections"
        ],
        "summary": "To remove old screening hits whose business purpose is fullfilled, you need to delete screeningHitCollections that are older than the effective date and also have the status `Completed`. Use the query parameter logicalDelete to remove the hits physically from storage (logicalDelete=false) or only logically (logicalDelete=true), meaning they are still there but no longer displayed in the user interfaces.",
        "operationId": "Delete",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Screening hits created before this date are deleted (effective date, format YYYY-MM-DD (ISO8601) in UTC).",
            "required": true,
            "schema": {
              "maxLength": 10,
              "type": "string"
            }
          },
          {
            "name": "logicalDelete",
            "in": "query",
            "description": "Screening hits are logically deleted",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deletion successful",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "423": {
            "description": "Locked",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/businessPartnerData": {
      "get": {
        "tags": [
          "Business Partner Data"
        ],
        "summary": "Get Business Partner Data",
        "operationId": "getBPData",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Name of the business partner",
            "required": true,
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          },
          {
            "name": "street",
            "in": "query",
            "description": "Street",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "description": "City",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          },
          {
            "name": "countryISOCode",
            "in": "query",
            "description": "Country ISO Code",
            "schema": {
              "maxLength": 2,
              "type": "string"
            }
          },
          {
            "name": "postalCode",
            "in": "query",
            "description": "Postal Code",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          },
          {
            "name": "logicalDeleteIncluded",
            "in": "query",
            "description": "Include logically deleted business partners",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business Partner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPartners"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ScreeningDecisions": {
        "type": "array",
        "description": "Screening Decisions",
        "items": {
          "$ref": "#/components/schemas/ScreeningDecision"
        }
      },
      "ScreeningDecision": {
        "type": "object",
        "properties": {
          "inputKey": {
            "maxLength": 255,
            "type": "string",
            "description": "Externally provided Key of Business Partner Input"
          },
          "status": {
            "maxLength": 1,
            "type": "string",
            "description": "Screening Hit Decision [ N - No Hit, C - Confirmed Hit, P - Possible Hit]",
            "enum": [
              "N",
              "C",
              "P"
            ]
          }
        }
      },
      "BusinessContext": {
        "type": "object",
        "properties": {
          "businessSystem": {
            "maxLength": 255,
            "type": "string",
            "description": "Business System"
          },
          "businessObjectType": {
            "maxLength": 255,
            "type": "string",
            "description": "The type of business object whose business partners are screened. Possible values are `SO` for _Sales Order_, `OD` for _Outbound Delivery_, `PO` for _Purchase Order_, `PC` for _Purchase Contract_, `PA` for _Purchase Scheduling Agreement_, `SC` for _Sales Contract_, `SA` for _Sales Scheduling Agreement_, `APMPAYMENTREQUEST` for _Payment_, `SQ` for _Sales Quotation_, `ID` for _Inbound Delivery_ and `PR` for _Purchase Requisition_.",
            "enum": [
              "SO",
              "OD",
              "PO",
              "PC",
              "PA",
              "SC",
              "SA",
              "APMPAYMENTREQUEST",
              "SQ",
              "ID",
              "PR"
            ]
          },
          "documentId": {
            "maxLength": 255,
            "type": "string",
            "description": "Document ID"
          }
        }
      },
      "BusinessPartners": {
        "type": "array",
        "description": "Business Partners",
        "items": {
          "$ref": "#/components/schemas/BusinessPartner"
        }
      },
      "BusinessPartner": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 255,
            "type": "string"
          },
          "street": {
            "maxLength": 255,
            "type": "string"
          },
          "city": {
            "maxLength": 255,
            "type": "string"
          },
          "countryISOCode": {
            "maxLength": 2,
            "type": "string"
          },
          "postalCode": {
            "maxLength": 255,
            "type": "string"
          },
          "inputKey": {
            "maxLength": 255,
            "type": "string"
          },
          "logicalDelete": {
            "type": "boolean"
          },
          "logicalDeleteOn": {
            "type": "string",
            "description": "Date on which the record was logically deleted in UTC"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Error text"
          }
        }
      },
      "DeletionResult": {
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "description": "Number of (logically) deleted records"
          },
          "text": {
            "type": "string",
            "description": "Description of deletion result"
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://sap-wls.authentication.eu10.hana.ondemand.com/oauth/token",
            "scopes": {
              "ReadScreeningHit": "Read screening hit",
              "EditBusinessContext": "Edit business context",
              "DeleteScreeningHit": "Delete screening hit",
              "LogicallyDeleteScreeningHit": "Logically delete screening hit"
            }
          }
        }
      }
    }
  },
  "x-sap-shortText": "Work with screening hits and obtain business partner data.",
  "x-servers": [
    {
      "url": "https://screeninghits-sap.cfapps.eu10.hana.ondemand.com/grc/watchlistScreening/screeningHits/v1"
    }
  ]
}