{
  "openapi": "3.1.0",
  "info": {
    "x-metadata": {
      "status": "published",
      "tags": [
        "Featured"
      ]
    },
    "version": "1.0.1",
    "license": {
      "name": "Proprietary"
    },
    "title": "Check and Decide",
    "description": "\nEndpoints to access pre-configured decision trees to automate\ncredit decisions. Decision Engine can help you save time and money across\nyour company by automating time consuming processes which drain your\ncompany's resources. This can free you and your staff to spend more time\nto work on achieving your business goals.</br></br>A full audit trail of\nprevious decisions is maintained for user access and decisions in a\npending state can be manually approved or declined.\n"
  },
  "tags": [
    {
      "name": "Authentication",
      "description": "Endpoint for a user authentication and token management."
    },
    {
      "name": "Instance Management",
      "description": "Endpoints for managing decision engine instances, including retrieval, and updating."
    },
    {
      "name": "Decision Trees",
      "description": "Endpoints for accessing and managing pre-configured decision trees used for automated credit decisions."
    },
    {
      "name": "Decision Logs",
      "description": "Endpoints for retrieving and managing logs of past decisions."
    },
    {
      "name": "Run Decision",
      "description": "Endpoints for executing decision trees to automate credit decisions."
    },
    {
      "name": "Decision Outcome",
      "description": "Endpoints for retrieving the outcomes of executed decisions, including detailed results."
    }
  ],
  "servers": [
    {
      "url": "https://connect.sandbox.creditsafe.com/v1",
      "description": "Sandbox server"
    },
    {
      "url": "https://connect.creditsafe.com/v1",
      "description": "Production server"
    }
  ],
  "paths": {
    "/authenticate": {
      "post": {
        "operationId": "authenticate",
        "summary": "Authenticate",
        "security": [],
        "tags": [
          "Authentication"
        ],
        "description": "Supply username and password to generate Authentication Token.\n  \n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectAuthenticationAuthRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAuthenticationAuthResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectAuthFailedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/instances": {
      "get": {
        "tags": [
          "Instance Management"
        ],
        "description": "Returns all instances (Decision Trees) a user has permission to access.",
        "operationId": "returnAllInstances",
        "summary": "Return All Available Instances",
        "parameters": [
          {
            "name": "customerId",
            "description": "The unique identifier of the customer. If used it will return all the Decision Trees associated to that customer.",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "userId",
            "description": "The unique identifier of the user. If used it will return all the Decision Trees that user has access to.",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDecisionEngineInstancesResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/instance/{guid}": {
      "get": {
        "tags": [
          "Instance Management"
        ],
        "description": "Returns instance user has permission to access.",
        "operationId": "instanceConfiguration",
        "summary": "Return Instance Configuration",
        "parameters": [
          {
            "name": "guid",
            "in": "path",
            "required": true,
            "description": "Get results by guid.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filters instance by contract category i.e., Bronze, Silver or Gold.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Instance Management"
        ],
        "description": "Update the instances information.<br><br>You will need to call the `GET /decisionEngine/instance/{guid}` endpoint to get the current configuration and then update the fields you want to change.",
        "operationId": "updateInstanceConfiguration",
        "summary": "Update Instance Configuration",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDecisionEngineInstanceRequestBodyWithExample"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "guid",
            "in": "path",
            "required": true,
            "description": "get results by guid.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/GUID": {
      "get": {
        "tags": [
          "Decision Trees"
        ],
        "description": "Returns all decision trees that the user has permission to access.",
        "operationId": "decisionTrees",
        "summary": "Return Decision Trees",
        "parameters": [
          {
            "$ref": "#/components/parameters/sortDir"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter the returned decision trees by their associated decision tree type.",
            "schema": {
              "type": "string",
              "enum": [
                "Credit Approval",
                "CS Decision Module",
                "Demo",
                "Credit Approval, CS Decision Module"
              ]
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Sort results by this column.",
            "schema": {
              "type": "string",
              "enum": [
                "friendlyName"
              ]
            }
          },
          {
            "name": "decisionOutcome",
            "in": "query",
            "description": "Fetch decision outcome in guid list endpoint.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineGUIDListResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/{provenirId}/userDataFields": {
      "get": {
        "tags": [
          "Decision Trees"
        ],
        "description": "Returns the user data fields defined for the given decision tree GUID.",
        "operationId": "userDataFields",
        "summary": "Return User Data Fields",
        "parameters": [
          {
            "name": "provenirId",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the decision tree, obtained from `/GUID`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineUserDataFieldsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/{provenirId}": {
      "post": {
        "tags": [
          "Run Decision"
        ],
        "description": "Runs the provided decision tree for the given company, optionally using the data provided in the body of the call.",
        "operationId": "runDecisionTree",
        "summary": "Run Decision Tree",
        "parameters": [
          {
            "name": "provenirId",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the decision tree to run, obtained from `/GUID`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "companyId",
            "in": "query",
            "required": true,
            "description": "The Connect ID for the company that you wish to run the decision tree on. Obtained from `/companies` search results. A Connect ID is the primary Company identifier that is used to uniquely identify all companies across Creditsafe's Universe and Partner Network.",
            "schema": {
              "type": "string",
              "example": "GB-0-03836192"
            }
          },
          {
            "name": "originationId",
            "in": "query",
            "required": false,
            "description": "An optional field that will allow text passed through to be stored against the decision. Typically used for internal identifiers (e.g. SalesForce IDs).",
            "schema": {
              "type": "string",
              "example": "SFC-1976"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The POST body should contain the User Data Fields for the decision tree you want to run obtained via the `/{guid}/userDataFields` endpoint.",
                "example": {
                  "productType": "Product A",
                  "isCustomer": "Yes",
                  "salesValue": 197600
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineRunDecisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/usageLog": {
      "get": {
        "tags": [
          "Decision Logs"
        ],
        "description": "Returns a log of all previously ran decisions that the user has permission to access, optionally filtered.",
        "operationId": "decisionHistory",
        "summary": "Return Decision History",
        "parameters": [
          {
            "name": "provenirId",
            "in": "query",
            "description": "Filter the returned usage log by the GUID for the associated decision trees, obtained from `/GUID`.",
            "schema": {
              "type": "string",
              "example": "repoObj_0ed6a4aa_16e17d977e9_07ffb16e17d977e9"
            }
          },
          {
            "name": "companyId",
            "in": "query",
            "description": "Filter the returned usage log by the Connect ID for the associated companies for each decision.",
            "schema": {
              "type": "string",
              "example": "US001-X-US60521352"
            }
          },
          {
            "name": "companyName",
            "in": "query",
            "description": "Filter the returned usage log by the Company Name for the associated companies for each decision.",
            "schema": {
              "type": "string",
              "example": "CREDITSAFE"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter the returned usage log by the status for each decision.",
            "schema": {
              "type": "number",
              "example": 1
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Filter the returned usage log by the date the the decision was run.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Filter the returned usage log by the date the the decision was run.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/pageSize"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineUsageLogResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/usageLog/{decisionLogId}": {
      "get": {
        "tags": [
          "Decision Logs"
        ],
        "description": "Returns a specified decision log for a previously ran decision.",
        "operationId": "getDecisionLog",
        "summary": "Return Decision Log",
        "parameters": [
          {
            "name": "decisionLogId",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the decision log to retrieve, obtained from `/usageLog`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineDecisionLogResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Decision Logs"
        ],
        "description": "Updates the status and/or notes for a specified decision.",
        "operationId": "updateDecisionLog",
        "summary": "Update Decision Log",
        "parameters": [
          {
            "name": "decisionLogId",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the decision log to retrieve, obtained from `/usageLog`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectDecisionEngineUpdateDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectDecisionEngineDecisionLogResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/decisionOutcome/{guid}": {
      "get": {
        "tags": [
          "Decision Outcome"
        ],
        "description": "Returns decision outcomes which is set for decision tree.",
        "operationId": "decisionOutcome",
        "summary": "Return Decision Outcome",
        "parameters": [
          {
            "name": "guid",
            "in": "path",
            "required": true,
            "description": "get results by guid.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDecisionEngineDecisionOutcomeResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Decision Outcome"
        ],
        "description": "This allows the user to manually update the decision outcome",
        "operationId": "updateDecisionEngineDecisionOutcomeDetails",
        "summary": "Update Decision Outcome",
        "parameters": [
          {
            "name": "guid",
            "in": "path",
            "required": true,
            "description": "updates decision outcomes by guid.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectDecisionEnginePatchDecisionOutcomeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Decision outcome updated successfully."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      }
    },
    "/decisionEngine/decisionHistory/export": {
      "post": {
        "operationId": "decisionEngineDecisionHistoryExportPost",
        "tags": [
          "Decision Logs"
        ],
        "description": "Exports decision history based on searchId.",
        "summary": "Export Decision History",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "searchId"
                ],
                "properties": {
                  "searchId": {
                    "type": "string",
                    "description": "The unique identifier for the search",
                    "example": "23979b50-5499-4878-b15b-5ebd3657c08d"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully exported decision history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "description": "Export data"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesBadRequest"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesInvalidToken"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesAccessForbidden"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectErrorResponsesResourceNotFoundRequest"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "This API requires authentication for access to protected endpoints. Authentication is performed by providing a valid JWT token in the `Authorization` header of each request."
      }
    },
    "schemas": {
      "ConnectAuthenticationAuthRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Credentials assigned upon sign up",
            "example": "username@domain.com"
          },
          "password": {
            "type": "string",
            "example": "^1gHySRA56aj>tf421o"
          }
        }
      },
      "ConnectAuthenticationAuthResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Authentication Token",
            "example": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImRodTNnNkFtTG5QQXVpOEJSMUFEVnp5ZHBnZyIsInR5cCI6IkpXVCIsIng1dCI6ImRodTNnNkFtTG5QQXVpOEJSMUFEVnp5ZHBnZyJ9.eyJuYmYiOjE1OTU0MTYyMDksImV4cCI6MTU5NTQxOTgwOSwiaXNzIjoiaHR0cHM6Ly9teWxvZ2luLnRlc3QuY3JlZGl0c2FmZS5jb20iLCJhdWQiOlsiaHR0cHM6Ly9teWxvZ2luLnRlc3QuY3JlZGl0c2FmZS5jb20vcmVzb3VyY2VzIiwiY29ubmVjdF9hcGkiLCJ1Ym9fYXBpX2dhdGV3YXkiXSwiY2xpZW50X2lkIjoiY29ubmVjdC5hcGkuY2xpZW50Iiwic3ViIjoiMTAxNTIwMjg1IiwiYXV0aF90aW1lIjoxNTk1NDE2MjA5LCJpZHAiOiJsb2NhbCIsInVzZXJuYW1lIjoiQ29ubmVjdHUxIiwiZW1haWwiOiJDb25uZWN0MUBnbWFpbC5jb20iLCJjdXN0b21lcklkIjoiMTAxNzY0NDA1IiwiY291bnRyeSI6IkMwIiwidXNlclJvbGUiOiJDcm1BZG1pblBsdXMiLCJzYl9jb3VudHJ5IjoiVVMiLCJzY29wZSI6WyJjb25uZWN0X2FwaSIsInVib19hcGlfZ2F0ZXdheSJdLCJhbXIiOlsicHdkIl19.p8kPAlKNB9iWEKiQbfbRXBoLQuBG7NuEDN__A8AQ55CL-gcIwkS1717Af1f9W0uifwIQ6HAZQR_x191LVkvuWD94Zw8zLzzr1ioUIhQny_zYuAS3G6EFNaTHh_mvOQ9XVi1FyuIy6YYcYcNLNZurFuITF2w5LuX4YQBjQy3rhEAdRoKcUKbtCClMFaH2dV35jiX2d7BqyhtJ8GeZyJ6yfMfdzznqxlJ4Osf5aasKUy8RYKEpjU2pkCURojoy5_oviGs8X4U9mJWcuajmPF3i5DHkqbhq1Mp0UZrDyoq_0BDStV5xqRgq6aOY8mc45kX7cwY3O2hPeGE7Ak8YtKFbA"
          }
        }
      },
      "ConnectAuthFailedResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "example": {
          "message": "Access denied -  Please check that your username and password are correct.  Please be aware that usernames and passwords are case sensitive. If the problem persists, please contact your Creditsafe account manager."
        }
      },
      "GetDecisionEngineInstancesResponse": {
        "properties": {
          "correlationId": {
            "description": "A unique ID assigned to this request.",
            "type": "string"
          },
          "instances": {
            "description": "The list of decision trees and GUID's available to user.",
            "items": {
              "properties": {
                "decisionTreeName": {
                  "type": "string"
                },
                "guid": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ConnectErrorResponsesBadRequest": {
        "type": "object",
        "description": "Bad Request",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": "A unique ID assigned to this request."
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string",
            "description": "Provides further information on why the request was rejected"
          }
        }
      },
      "ConnectErrorResponsesInvalidToken": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "description": "401 - Authorization Token has either expired or is not a valid Connect Token"
      },
      "ConnectErrorResponsesAccessForbidden": {
        "type": "object",
        "description": "403 - Access Forbidden",
        "properties": {
          "message": {
            "type": "string",
            "example": "Access forbidden"
          }
        }
      },
      "ConnectErrorResponsesResourceNotFoundRequest": {
        "type": "object",
        "description": "404 - Not Found",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": "A unique ID assigned to this request.",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string",
            "description": "Provides further information on why the request was rejected"
          }
        }
      },
      "UpdateDecisionEngineInstanceRequestBody": {
        "type": "object",
        "required": [
          "templateId",
          "guid",
          "decisionTreeName"
        ],
        "properties": {
          "templateId": {
            "description": "The template ID of the decision tree to be updated.",
            "example": "72a7e73e799a4c3ea2a8b89bd2002829",
            "type": "string"
          },
          "guid": {
            "description": "The GUID to be updated.",
            "example": "02dce1bbb81b11ed962c01ff1787b18e",
            "type": "string"
          },
          "decisionTreeName": {
            "description": "The name of the decision tree to be updated.",
            "example": "Test US after NL test update5",
            "type": "string"
          },
          "customerId": {
            "description": "The customer ID to be updated.",
            "example": 103361848,
            "type": "integer"
          },
          "inputParams": {
            "description": "The input parameters to be updated can be obtained from the `GET/instance configuration` endpoint.",
            "type": "object"
          },
          "configurationVariables": {
            "description": "The Configuration Variables to be updated can be obtained from the `GET/instance configuration` endpoint.",
            "type": "object"
          },
          "scalarVariables": {
            "description": "The Scalar Variables to be updated can be obtained from the `GET/instance configuration` endpoint.",
            "type": "object"
          }
        }
      },
      "UpdateDecisionEngineInstanceRequestBodyWithExample": {
        "allOf": [
          {
            "$ref": "#/components/schemas/UpdateDecisionEngineInstanceRequestBody"
          },
          {
            "type": "object",
            "example": {
              "templateId": "72a7e73e799a4c3ea2a8b89bd2002829",
              "guid": "232101f5cfbf11edb2a53f274007bfbe",
              "decisionTreeName": "Default US-Test Tree",
              "publilshed": true,
              "customerId": 103361848,
              "inputParams": {
                "creditAmount": {
                  "labelName": "Sales Amount",
                  "failedStatus": 3,
                  "unavailableStatus": 2,
                  "isMandatory": true,
                  "orderInde": 100,
                  "fieldType": "Integer"
                }
              },
              "configurationVariables": {
                "companyStatus": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2
                },
                "internationalScore": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": "B"
                },
                "riskScore": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 50
                },
                "dbt": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 1
                },
                "possibleOFAC": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2
                },
                "estimatedAnnualRevenue": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 1000
                },
                "yearsInBusiness": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 5
                },
                "derogatoryLegalFilingsCount": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 3
                },
                "derogatoryLegalFilingsValue": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 1000
                },
                "numberOfEmployees": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 1000
                },
                "bankruptcy": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2
                },
                "totalNumberOfTradeLines": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 25
                },
                "percentageOfTotalPastDue": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 15
                },
                "percentageSeverelyPastDue": {
                  "isRequired": true,
                  "failedStatus": 2,
                  "unavailableStatus": 2,
                  "value": 10
                },
                "businessCompliance": {
                  "isRequired": false,
                  "failedStatus": null,
                  "unavailableStatus": 2,
                  "value": null
                },
                "directorCompliance": {
                  "isRequired": true,
                  "failedStatus": null,
                  "unavailableStatus": null,
                  "value": null
                }
              },
              "scalarVariables": {
                "creditLimitAdjustmentModifier": {
                  "isRequired": false,
                  "value": 1
                }
              }
            }
          }
        ]
      },
      "ConnectDecisionEngineGUIDListResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": "A unique ID assigned to this request.",
            "example": "23921650-c073-11ea-860f-06bc8182190e"
          },
          "GUIDList": {
            "type": "array",
            "items": {
              "properties": {
                "friendlyName": {
                  "type": "string",
                  "description": "The name of the decision tree.",
                  "example": "Check & Decide Demo"
                },
                "GUID": {
                  "type": "string",
                  "description": "The unique reference for the decision tree.",
                  "example": "repoObj_0ed6a4aa_16e17d977e9_07ffb16e17d977e9"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "Credit Approval",
                    "Bespoke",
                    "Demo"
                  ],
                  "description": "The type of the decision tree."
                },
                "serviceLine": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The internal reference for the service line that credits will be deducted from on each decision tree run.",
                  "example": "dec_eng_cas"
                }
              }
            }
          }
        }
      },
      "ConnectDecisionEngineUserDataFieldsResponse": {
        "type": "object",
        "properties": {
          "decisionEngineId": {
            "type": "string",
            "description": "The unique reference for the decision tree.",
            "example": "repoObj_0ed6a4aa_16e17d977e9_07ffb16e17d977e9"
          },
          "fields": {
            "type": "array",
            "description": "A list of user-input data fields that are supported by the provided decision tree. The values for these fields should be passed to the `/{guid}` endpoint call when running a decision.",
            "items": {
              "properties": {
                "orderIndex": {
                  "type": "number",
                  "description": "Used to assist ordering of the user data fields on a UI.",
                  "example": 100
                },
                "label": {
                  "type": "string",
                  "description": "The user-friendly label for the field for display on a UI.",
                  "example": "Product Type"
                },
                "paramName": {
                  "type": "string",
                  "description": "The string value for the parameter to be used when calling the `/{guid}` endpoint.",
                  "example": "productType"
                },
                "fieldType": {
                  "type": "string",
                  "enum": [
                    "Text",
                    "Integer",
                    "Dropdown"
                  ],
                  "description": "The type of user data field.",
                  "example": "Dropdown"
                },
                "mandatory": {
                  "type": "boolean",
                  "description": "Flag to dictate whether the user data field is required when running the associated decision tree.",
                  "example": true
                },
                "dropdownDetails": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "properties": {
                      "label": {
                        "type": "string",
                        "description": "The user-friendly label for the drop-down option for display on a UI.",
                        "example": "Product A"
                      },
                      "presentationOrder": {
                        "type": "number",
                        "description": "Used to assist ordering of the drop-down options on a UI.",
                        "example": 100
                      }
                    }
                  }
                },
                "validation": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "description": "Optional validation rules that should be applied to the corresponding user data field prior to running the decision tree.",
                  "items": {
                    "properties": {
                      "validationType": {
                        "type": "string",
                        "enum": [
                          "Regex Match",
                          "Maximum",
                          "Minimum",
                          "Length",
                          "Custom"
                        ],
                        "description": "The type of validation rule.",
                        "example": "Minimum"
                      },
                      "validationValue": {
                        "type": "string",
                        "description": "The value for the validation rule.",
                        "example": "100"
                      },
                      "description": {
                        "type": "string",
                        "description": "A description for the validation rule.",
                        "example": "Minimum Sales Value $100"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ConnectDecisionEngineRunDecisionResponse": {
        "type": "object",
        "properties": {
          "Decision": {
            "type": [
              "string",
              "null"
            ],
            "description": "The decision returned by the automated decision model.",
            "example": "Reject"
          },
          "DecisionText": {
            "type": [
              "string",
              "null"
            ],
            "description": "The text output to accompany the decision returned by the decision model.",
            "example": "The Sales Value requested is greater than Creditsafe's recommended credit limit."
          },
          "Audits": {
            "type": [
              "array",
              "null"
            ],
            "description": "An array of audit values. The parameters output for audit are tailored and bespoke to each decision tree.",
            "items": {
              "properties": {
                "description": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The value for the audit parameter at the point in time in which the decision tree was run.",
                  "example": "A"
                },
                "RuleName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The friendly name for the audit parameter.",
                  "example": "International Score"
                }
              }
            }
          },
          "originationId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Displays the optional text passed through to be stored against the decision in the original call to `/{provenirId}`. Typically used for internal identifiers (e.g. SalesForce IDs).",
            "example": "SFC-1976"
          },
          "statusCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status and 3 for negative outcomes.",
            "example": "3"
          }
        }
      },
      "ConnectDecisionEngineUsageLogResponse": {
        "type": "object",
        "properties": {
          "totalCount": {
            "type": "number",
            "description": "The total number of previous decisions matching the defined filter criteria.",
            "example": 3108
          },
          "usageLog": {
            "type": "array",
            "items": {
              "properties": {
                "decisionLogId": {
                  "type": "number",
                  "description": "The unique identifier for the decision log.",
                  "example": 64492
                },
                "provenirId": {
                  "type": "string",
                  "description": "The unique identifier of the decision tree.",
                  "example": "repoObj_0ed6a4aa_16e17d977e9_07ffb16e17d977e9"
                },
                "friendlyName": {
                  "type": "string",
                  "description": "The name of the decision tree.",
                  "example": "Check & Decide Demo"
                },
                "userId": {
                  "type": "number",
                  "description": "The unique identifier for the user's account, used across the Creditsafe product suite.",
                  "example": 101445010
                },
                "companyId": {
                  "type": "string",
                  "description": "The connectId of the company that the decision was ran on. A connectId is the primary Company identifier that is used to uniquely identify all companies across Creditsafe's Universe and Partner Network.",
                  "example": "US001-X-US60521352"
                },
                "companyName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The name of the company that the decision was ran on.",
                  "example": "CREDITSAFE USA INC."
                },
                "response": {
                  "type": "object",
                  "properties": {
                    "Decision": {
                      "type": "string",
                      "description": "The decision returned by the automated decision model.",
                      "example": "Reject"
                    },
                    "DecisionText": {
                      "type": "string",
                      "description": "The text output to accompany the decision returned by the decision model.",
                      "example": "The Sales Value requested is greater than Creditsafe's recommended credit limit."
                    },
                    "Audits": {
                      "type": "array",
                      "description": "An array of audit values. The parameters output for audit are tailored and bespoke to each decision tree.",
                      "items": {
                        "properties": {
                          "description": {
                            "type": "string",
                            "description": "The value for the audit parameter at the point in time in which the decision tree was run.",
                            "example": "A"
                          },
                          "RuleName": {
                            "type": "string",
                            "description": "The friendly name for the audit parameter.",
                            "example": "International Score"
                          }
                        }
                      }
                    },
                    "originationId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Displays the optional text passed through to be stored against the decision in the original call to `/{provenirId}`. Typically used for internal identifiers (e.g. SalesForce IDs).",
                      "example": "SFC-1976"
                    },
                    "statusCode": {
                      "type": "string",
                      "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status and 3 for negative outcomes.",
                      "example": "3"
                    }
                  }
                },
                "decisionDate": {
                  "type": "string",
                  "format": "date-time",
                  "description": "The timestamp that the decision model was run."
                },
                "notes": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The notes associated with this decision."
                },
                "status": {
                  "type": "number",
                  "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status and 3 for negative outcomes.",
                  "example": 3
                }
              }
            }
          }
        }
      },
      "ConnectDecisionEngineDecisionLogResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": "A unique ID assigned to this request.",
            "example": "23921650-c073-11ea-860f-06bc8182190e",
            "deprecated": true
          },
          "decisionLogId": {
            "type": "number",
            "description": "The unique identifier for the decision log.",
            "example": 64492
          },
          "provenirId": {
            "type": "string",
            "description": "The unique identifier of the decision tree.",
            "example": "repoObj_0ed6a4aa_16e17d977e9_07ffb16e17d977e9"
          },
          "friendlyName": {
            "type": "string",
            "description": "The name of the decision tree.",
            "example": "Check & Decide Demo"
          },
          "userId": {
            "type": "number",
            "description": "The unique identifier for the user's account, used across the Creditsafe product suite.",
            "example": 101445010
          },
          "companyId": {
            "type": "string",
            "description": "The connectId of the company that the decision was ran on. A connectId is the primary Company identifier that is used to uniquely identify all companies across Creditsafe's Universe and Partner Network.",
            "example": "US001-X-US60521352"
          },
          "companyName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the company that the decision was ran on.",
            "example": "CREDITSAFE USA INC."
          },
          "response": {
            "$ref": "#/components/schemas/ConnectDecisionEngineRunDecisionResponse"
          },
          "decisionDate": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp that the decision model was run."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The notes associated with this decision."
          },
          "status": {
            "type": "number",
            "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status and 3 for negative outcomes.",
            "example": 3
          },
          "modifiedDate": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp that this decision was last modified."
          }
        }
      },
      "ConnectDecisionEngineUpdateDecisionRequest": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "The status that the decision will be updated to. Typically, 1 is reserved for positive outcomes, 2 for pending status and 3 for negative outcomes.",
            "example": 1
          },
          "notes": {
            "type": "string",
            "description": "Free text field to allow for the saving of notes on the associated decision object.",
            "example": "Manually approved by Senior Credit Controller."
          }
        }
      },
      "GetDecisionEngineDecisionOutcomeResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": "A unique ID assigned to this request.",
            "example": "23921650-c073-11ea-860f-06bc8182190e"
          },
          "includeInManualReview": {
            "type": "boolean",
            "description": "This key is used to enable or restrict the manual review process for pending status.",
            "example": true
          },
          "decisionOutcomes": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number",
                      "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status, 3 for negative outcomes,5 for manually approved outcomes and 6 for manually rejected outcomes."
                    },
                    "label": {
                      "type": "string",
                      "description": "Value that is typically chosen to depict the possible outcome for different statuses."
                    },
                    "description": {
                      "type": "string",
                      "description": "Statement that defines the reasoning behind an outcome for a status."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ConnectDecisionEnginePatchDecisionOutcomeRequest": {
        "type": "object",
        "properties": {
          "includeInManualReview": {
            "type": "boolean",
            "description": "This key is used to enable or restrict the manual review process for pending status.",
            "example": true
          },
          "decisionOutcomes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "number",
                  "description": "The status of the decision. typically, 1 is reserved for positive outcomes, 2 for pending status, 3 for negative outcomes, 5 for manually approved outcomes and 6 for manually rejected outcomes."
                },
                "label": {
                  "type": "string",
                  "description": "Value that is typically chosen to depict the possible outcome for different statuses."
                },
                "description": {
                  "type": "string",
                  "description": "Statement that defines the reasoning behind an outcome for a status."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "sortDir": {
        "name": "sortDir",
        "in": "query",
        "description": "The direction that you wish to sort results by.",
        "schema": {
          "type": "string",
          "default": "asc",
          "enum": [
            "asc",
            "desc"
          ]
        }
      },
      "page": {
        "name": "page",
        "in": "query",
        "description": "Starting page number.",
        "schema": {
          "type": "integer",
          "default": 1
        }
      },
      "pageSize": {
        "name": "pageSize",
        "in": "query",
        "description": "Specifies the number of items to be displayed per page. Allowed values are between 1 and 100.",
        "schema": {
          "type": "integer"
        }
      }
    }
  },
  "security": [
    {
      "bearerToken": []
    }
  ]
}