{
  "swagger" : "2.0",
  "info" : {
    "description" : "Create approve related entity",
    "version" : "v1.0.0",
    "title" : "Related entity"
  },
  "host" : "api.server.com",
  "basePath" : "/api/v1.0.0/",
  "tags" : [ {
    "name" : "RETAIL"
  } ],
  "schemes" : [ "http", "https" ],
  "security" : [ {
    "basicAuth" : [ ]
  }, {
    "apiKey" : [ ]
  } ],
  "paths" : {
    "/party/pe/partyRelationships/corporates" : {
      "post" : {
        "tags" : [ "RETAIL" ],
        "summary" : "Create corporate/entity which are not customers of the bank but are in some way related to an existing customer of the bank.",
        "description" : "Create details of a corporate which may be related to existing customers",
        "operationId" : "createRelatedEntity",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "in" : "body",
          "name" : "payload",
          "description" : "body Payload",
          "required" : true,
          "schema" : {
            "$ref" : "#/definitions/RelatedEntity"
          }
        }, {
          "name" : "validate_only",
          "in" : "query",
          "description" : "The identifier to indicate if it is set to only validate or not.",
          "required" : false,
          "type" : "boolean"
        }, {
          "name" : "credentials",
          "in" : "header",
          "description" : "Username and password to authenticate the API against core-banking.",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "companyId",
          "in" : "header",
          "description" : "Identifier of the lead company of the underlying Entity/Company/Branch for the respective contract for customer data protection purposes. Example US0010001.",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "deviceId",
          "in" : "header",
          "description" : "Identifies the device type",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "userRole",
          "in" : "header",
          "description" : "User who initiated the transaction",
          "required" : false,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "RelatedEntityResponse",
            "schema" : {
              "$ref" : "#/definitions/RelatedEntityResponse"
            }
          },
          "default" : {
            "description" : "ScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/ScreenErrorResponse"
            }
          },
          "400" : {
            "description" : "BusinessScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/BusinessScreenErrorResponse"
            }
          },
          "500" : {
            "description" : "SystemScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/SystemScreenErrorResponse"
            }
          }
        }
      }
    },
    "/party/pe/partyRelationshipApprovals/corporates/{corporateId}" : {
      "put" : {
        "tags" : [ "RETAIL" ],
        "summary" : "Approve the corporate/entity details which have been created.",
        "description" : "Approve the pending request to create details for a corporate",
        "operationId" : "approveRelatedEntity",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "name" : "corporateId",
          "in" : "path",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "credentials",
          "in" : "header",
          "description" : "Username and password to authenticate the API against core-banking.",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "companyId",
          "in" : "header",
          "description" : "Identifier of the lead company of the underlying Entity/Company/Branch for the respective contract for customer data protection purposes. Example US0010001.",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "deviceId",
          "in" : "header",
          "description" : "Identifies the device type",
          "required" : false,
          "type" : "string"
        }, {
          "name" : "userRole",
          "in" : "header",
          "description" : "User who initiated the transaction",
          "required" : false,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "RelatedEntityResponse",
            "schema" : {
              "$ref" : "#/definitions/RelatedEntityResponse"
            }
          },
          "default" : {
            "description" : "ScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/ScreenErrorResponse"
            }
          },
          "400" : {
            "description" : "BusinessScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/BusinessScreenErrorResponse"
            }
          },
          "500" : {
            "description" : "SystemScreenErrorResponse",
            "schema" : {
              "$ref" : "#/definitions/SystemScreenErrorResponse"
            }
          }
        }
      }
    }
  },
  "securityDefinitions" : {
    "basicAuth" : {
      "type" : "basic"
    },
    "apiKey" : {
      "type" : "apiKey",
      "name" : "Authorization",
      "in" : "header"
    }
  },
  "definitions" : {
    "PayloadHeader" : {
      "properties" : {
        "override" : {
          "type" : "object",
          "properties" : {
            "overrideDetails" : {
              "type" : "array",
              "items" : {
                "type" : "object",
                "properties" : {
                  "id" : {
                    "type" : "string",
                    "description" : "The identifier of the override."
                  },
                  "description" : {
                    "type" : "string",
                    "description" : "The actual override message."
                  },
                  "code" : {
                    "type" : "string",
                    "description" : "The code related to override message."
                  },
                  "responseCode" : {
                    "type" : "string",
                    "description" : "The user input to accept/reject the override."
                  }
                }
              }
            }
          }
        },
        "audit" : {
          "type" : "object",
          "properties" : {
            "versionNumber" : {
              "type" : "string",
              "description" : "The CURR.NO. of the record"
            }
          }
        }
      }
    },
    "RelatedEntity" : {
      "properties" : {
        "header" : {
          "$ref" : "#/definitions/PayloadHeader"
        },
        "body" : {
          "$ref" : "#/definitions/RelatedEntityBody"
        }
      },
      "description" : "RelatedEntity"
    },
    "RelatedEntityBody" : {
      "type" : "object",
      "required" : [ "birthIncorpDate", "legalDocumentName", "legalId", "phoneNumber" ],
      "properties" : {
        "personEntity" : {
          "type" : "string",
          "description" : "Identifies if the record is for a real person or a legal entity. Allowed Options: Person or Entity.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "firstName" : {
          "type" : "string",
          "description" : "Specifies customer's first name",
          "minLength" : 0,
          "maxLength" : 26
        },
        "legalDocumentName" : {
          "type" : "string",
          "description" : "Name of the legal documents such as passport, driving licence etc., provided as identification proof",
          "minLength" : 1,
          "maxLength" : 26
        },
        "legalId" : {
          "type" : "string",
          "description" : "Unique reference number of the legal documents submitted as identification proof",
          "minLength" : 1,
          "maxLength" : 26
        },
        "birthIncorpDate" : {
          "type" : "string",
          "description" : "Date on which the entity is incorporated",
          "minLength" : 1,
          "maxLength" : 26
        },
        "sharePercentage" : {
          "type" : "string",
          "description" : "Contains the mothers surname of the customer",
          "minLength" : 0,
          "maxLength" : 26
        },
        "manualRiskClass" : {
          "type" : "string",
          "description" : "Customer's risk class updated manually by the User overriding the risk class calculated by the KYC process",
          "minLength" : 0,
          "maxLength" : 26
        },
        "addressCountryId" : {
          "type" : "string",
          "description" : "Identifies the country of customer address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "addressLocation" : {
          "type" : "string",
          "description" : "Identifies the nature of the postal address, like primary, secondary or office address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "state" : {
          "type" : "string",
          "description" : "Represents a subdivision of a country such as state, region, country",
          "minLength" : 0,
          "maxLength" : 26
        },
        "locationName" : {
          "type" : "string",
          "description" : "Identifies specific location name with in the country or town",
          "minLength" : 0,
          "maxLength" : 26
        },
        "districtName" : {
          "type" : "string",
          "description" : "Stores the district name of the  Beneficiary Customer.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "postCode" : {
          "type" : "string",
          "description" : "Identifies the address postal code for the customer.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "direction" : {
          "type" : "string",
          "description" : "Indicates the direction of the Direct debit claim for which mandate is received. The claim can be 'Outward' i.e. Claim is sent to the other bank or 'Inward'  i.e. other bank submit their claim to debit our customer's account. ",
          "minLength" : 0,
          "maxLength" : 26
        },
        "street" : {
          "type" : "string",
          "description" : "Contains the first line of customer's base address, example building number, street number etc.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "buildingName" : {
          "type" : "string",
          "description" : "Identifies the name of the building where customer resides",
          "minLength" : 0,
          "maxLength" : 26
        },
        "buildingNumber" : {
          "type" : "string",
          "description" : "Identifies the building number where customer resides",
          "minLength" : 0,
          "maxLength" : 26
        },
        "floorNumber" : {
          "type" : "string",
          "description" : "Contains the floor number of the customer address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "reference" : {
          "type" : "string",
          "description" : "Indicates the transaction reference for which the history of transactions is requested. It is steered by the attribute 'booked' given the start date and end date or the entry from which the history is requested",
          "minLength" : 0,
          "maxLength" : 26
        },
        "phoneNumber" : {
          "type" : "string",
          "description" : "The phone number of the customer or prospect",
          "minLength" : 1,
          "maxLength" : 26
        },
        "email" : {
          "type" : "string",
          "description" : "Email Identifier of the Customer",
          "minLength" : 0,
          "maxLength" : 26
        },
        "contactType" : {
          "type" : "string",
          "description" : "Types of contacts available to users to communicate",
          "minLength" : 0,
          "maxLength" : 26
        },
        "contactData" : {
          "type" : "string",
          "description" : "Indicates the contact data of customer used for communication such as phone or mobile or e-mail address.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "iddPrefixPhone" : {
          "type" : "string",
          "description" : "Identifies the international calling prefix code of the phone or mobile number.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "socialNetworkId" : {
          "type" : "string",
          "description" : "Social Network Identification of the person/entity",
          "minLength" : 0,
          "maxLength" : 26
        }
      }
    },
    "ScreenHeader" : {
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "The Identifier of the record created"
        },
        "status" : {
          "type" : "string",
          "description" : "Status of the API(success/failed)"
        },
        "transactionStatus" : {
          "type" : "string",
          "description" : "The status of the transaction"
        },
        "uniqueIdentifier" : {
          "type" : "string",
          "description" : "The unique identifier/Message Reference of the record created."
        },
        "audit" : {
          "type" : "object",
          "properties" : {
            "T24_time" : {
              "type" : "integer",
              "format" : "int32",
              "description" : "Time taken to response by Transact"
            },
            "versionNumber" : {
              "type" : "string",
              "description" : "The CURR.NO. of the record"
            },
            "requestParse_time" : {
              "type" : "number",
              "description" : "Time taken to parse the request by IRIS"
            },
            "responseParse_time" : {
              "type" : "number",
              "description" : "Time taken to parse the response by IRIS"
            }
          }
        }
      }
    },
    "RelatedEntityResponse" : {
      "properties" : {
        "header" : {
          "$ref" : "#/definitions/ScreenHeader"
        },
        "body" : {
          "$ref" : "#/definitions/RelatedEntityResponseBody"
        }
      },
      "description" : "RelatedEntityResponse"
    },
    "RelatedEntityResponseBody" : {
      "type" : "object",
      "properties" : {
        "personEntity" : {
          "type" : "string",
          "description" : "Identifies if the record is for a real person or a legal entity. Allowed Options: Person or Entity.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "firstName" : {
          "type" : "string",
          "description" : "Specifies customer's first name",
          "minLength" : 0,
          "maxLength" : 26
        },
        "legalDocumentName" : {
          "type" : "string",
          "description" : "Name of the legal documents such as passport, driving licence etc., provided as identification proof",
          "minLength" : 1,
          "maxLength" : 26
        },
        "legalId" : {
          "type" : "string",
          "description" : "Unique reference number of the legal documents submitted as identification proof",
          "minLength" : 1,
          "maxLength" : 26
        },
        "birthIncorpDate" : {
          "type" : "string",
          "description" : "Date on which the entity is incorporated",
          "minLength" : 1,
          "maxLength" : 26
        },
        "sharePercentage" : {
          "type" : "string",
          "description" : "Contains the mothers surname of the customer",
          "minLength" : 0,
          "maxLength" : 26
        },
        "manualRiskClass" : {
          "type" : "string",
          "description" : "Customer's risk class updated manually by the User overriding the risk class calculated by the KYC process",
          "minLength" : 0,
          "maxLength" : 26
        },
        "addressCountryId" : {
          "type" : "string",
          "description" : "Identifies the country of customer address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "addressLocation" : {
          "type" : "string",
          "description" : "Identifies the nature of the postal address, like primary, secondary or office address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "state" : {
          "type" : "string",
          "description" : "Represents a subdivision of a country such as state, region, country",
          "minLength" : 0,
          "maxLength" : 26
        },
        "locationName" : {
          "type" : "string",
          "description" : "Identifies specific location name with in the country or town",
          "minLength" : 0,
          "maxLength" : 26
        },
        "districtName" : {
          "type" : "string",
          "description" : "Stores the district name of the  Beneficiary Customer.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "postCode" : {
          "type" : "string",
          "description" : "Identifies the address postal code for the customer.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "direction" : {
          "type" : "string",
          "description" : "Indicates the direction of the Direct debit claim for which mandate is received. The claim can be 'Outward' i.e. Claim is sent to the other bank or 'Inward'  i.e. other bank submit their claim to debit our customer's account. ",
          "minLength" : 0,
          "maxLength" : 26
        },
        "street" : {
          "type" : "string",
          "description" : "Contains the first line of customer's base address, example building number, street number etc.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "buildingName" : {
          "type" : "string",
          "description" : "Identifies the name of the building where customer resides",
          "minLength" : 0,
          "maxLength" : 26
        },
        "buildingNumber" : {
          "type" : "string",
          "description" : "Identifies the building number where customer resides",
          "minLength" : 0,
          "maxLength" : 26
        },
        "floorNumber" : {
          "type" : "string",
          "description" : "Contains the floor number of the customer address",
          "minLength" : 0,
          "maxLength" : 26
        },
        "reference" : {
          "type" : "string",
          "description" : "Indicates the transaction reference for which the history of transactions is requested. It is steered by the attribute 'booked' given the start date and end date or the entry from which the history is requested",
          "minLength" : 0,
          "maxLength" : 26
        },
        "phoneNumber" : {
          "type" : "string",
          "description" : "The phone number of the customer or prospect",
          "minLength" : 1,
          "maxLength" : 26
        },
        "email" : {
          "type" : "string",
          "description" : "Email Identifier of the Customer",
          "minLength" : 0,
          "maxLength" : 26
        },
        "contactType" : {
          "type" : "string",
          "description" : "Types of contacts available to users to communicate",
          "minLength" : 0,
          "maxLength" : 26
        },
        "contactData" : {
          "type" : "string",
          "description" : "Indicates the contact data of customer used for communication such as phone or mobile or e-mail address.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "iddPrefixPhone" : {
          "type" : "string",
          "description" : "Identifies the international calling prefix code of the phone or mobile number.",
          "minLength" : 0,
          "maxLength" : 26
        },
        "socialNetworkId" : {
          "type" : "string",
          "description" : "Social Network Identification of the person/entity",
          "minLength" : 0,
          "maxLength" : 26
        }
      }
    },
    "ErrorHeader" : {
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "The Identifier of the record created"
        },
        "status" : {
          "type" : "string",
          "description" : "Status of the API(success/failed)"
        },
        "transactionStatus" : {
          "type" : "string",
          "description" : "The status of the transaction"
        },
        "uniqueIdentifier" : {
          "type" : "string",
          "description" : "The unique identifier/Message Reference of the record created."
        },
        "audit" : {
          "type" : "object",
          "properties" : {
            "T24_time" : {
              "type" : "integer",
              "format" : "int32",
              "description" : "Time taken to response by Transact"
            },
            "versionNumber" : {
              "type" : "string",
              "description" : "The CURR.NO. of the record"
            },
            "requestParse_time" : {
              "type" : "number",
              "description" : "Time taken to parse the request by IRIS"
            },
            "responseParse_time" : {
              "type" : "number",
              "description" : "Time taken to parse the response by IRIS"
            }
          }
        }
      }
    },
    "overrideBody" : {
      "properties" : {
        "overrideDetails" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "properties" : {
              "id" : {
                "type" : "string",
                "description" : "The identifier of the override."
              },
              "description" : {
                "type" : "string",
                "description" : "The actual override message."
              },
              "code" : {
                "type" : "string",
                "description" : "The code related to override message."
              },
              "options" : {
                "type" : "array",
                "description" : "The usable options for the override.",
                "items" : {
                  "type" : "string"
                }
              },
              "type" : {
                "type" : "string",
                "description" : "The type of the override."
              }
            }
          }
        }
      }
    },
    "ScreenErrorResponse" : {
      "properties" : {
        "header" : {
          "$ref" : "#/definitions/ErrorHeader"
        },
        "error" : {
          "$ref" : "#/definitions/ScreenErrorResponseBody"
        },
        "override" : {
          "$ref" : "#/definitions/overrideBody"
        }
      },
      "description" : "ScreenErrorResponse"
    },
    "ScreenErrorResponseBody" : {
      "type" : "object",
      "properties" : {
        "errorDetails" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "properties" : {
              "fieldName" : {
                "type" : "string",
                "description" : "The name of the field"
              },
              "code" : {
                "type" : "string",
                "description" : "The identifier of the error message"
              },
              "message" : {
                "type" : "string",
                "description" : "The actual Transact error message "
              }
            }
          }
        },
        "type" : {
          "type" : "string",
          "description" : "The identifier of error type: "
        }
      }
    },
    "BusinessScreenErrorResponse" : {
      "properties" : {
        "header" : {
          "$ref" : "#/definitions/ErrorHeader"
        },
        "error" : {
          "$ref" : "#/definitions/BusinessScreenErrorResponseBody"
        },
        "override" : {
          "$ref" : "#/definitions/overrideBody"
        }
      },
      "description" : "BusinessScreenErrorResponse"
    },
    "BusinessScreenErrorResponseBody" : {
      "type" : "object",
      "properties" : {
        "errorDetails" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "properties" : {
              "fieldName" : {
                "type" : "string",
                "description" : "The name of the field"
              },
              "code" : {
                "type" : "string",
                "description" : "The identifier of the error message"
              },
              "message" : {
                "type" : "string",
                "description" : "The actual Transact error message for bad requests"
              }
            }
          }
        },
        "type" : {
          "type" : "string",
          "description" : "The identifier of error type: Business"
        }
      }
    },
    "SystemScreenErrorResponse" : {
      "properties" : {
        "header" : {
          "$ref" : "#/definitions/ErrorHeader"
        },
        "error" : {
          "$ref" : "#/definitions/SystemScreenErrorResponseBody"
        },
        "override" : {
          "$ref" : "#/definitions/overrideBody"
        }
      },
      "description" : "SystemScreenErrorResponse"
    },
    "SystemScreenErrorResponseBody" : {
      "type" : "object",
      "properties" : {
        "errorDetails" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "properties" : {
              "fieldName" : {
                "type" : "string",
                "description" : "The name of the field"
              },
              "code" : {
                "type" : "string",
                "description" : "The identifier of the error message"
              },
              "message" : {
                "type" : "string",
                "description" : "The actual Transact error message caused by server"
              }
            }
          }
        },
        "type" : {
          "type" : "string",
          "description" : "The identifier of error type: System"
        }
      }
    }
  }
}