openapi: 3.0.2
info:
  title: Payment Pre-validation Data Provider API 
  description: | 
        Enable your application to validate cross-border payment information you receive from other banks.
        
        BAV for Providers includes features to better support domestic systems and future support of ISO20022 addresses. Additionally, depending on the jurisdiction where the creditor account is held and the market practices in use, BAV for Providers brings in the validation of the creditor account type and if the creditor name partially matches the account holder name.
        
        **v2.1.3 Release Notes**
          * There are no schema level changes with this version update. 
          * Some Changes made to the example values and descriptions to make it in-line with the functional specifications for Data Providers.
          
        **Note**: When implementing the Data Provider API specifications, please make sure to follow the relevant onboarding guide and functional specification documents available here: https://www2.swift.com/knowledgecentre/products/Payment%20Pre-validation/publications
  contact:
    name: Developer Hub
    url: https://developer.swift.com
    email: developer-support@swift.com
  license:
    name: API Restricted License
    url: https://developer.swift.com/api-license
  version: 2.1.3
servers:
- url: "https://<your-preval-url>/v2"
  description: |
    This URL should be the endpoint that you, as prevalidation provider, expose to the world.
tags:
- name: "Beneficiary Account Verification"
paths:
  /accounts/verification:
    post:
      tags:
      - VerifyAccount
      summary: Verify that a beneficiary account could be able to receive incoming funds.
      description: |-
                The service verifies that an account exists at the beneficiary bank and is capable of receiving incoming funds. This usually implies that the account is open, properly identified by the given number and, depending on the jurisdiction and market practices in use where the account is held, that the creditor name matches the name of the account holder. The service provider does not take liability for the response and does not provide any guarantee on the outcome of an actual transaction being sent to this account.
                
                The information provided is meant to be as accurate as possible at the time that the request was processed. The requester must pass the creditor name and the service provider can use this information as part of the verification or not.
      operationId: VerifyAccount
      parameters:
      - name: "x-bic"
        in: "header"
        description: |
          Describe the BIC for SWIFT to route the request to. Providers get the value from the Gateway and consumers are not required to fill it in.
        required: true
        schema:
          pattern: "^[a-z]{6,6}[a-z2-9][a-np-z0-9]$"
          type: "string"
          example: "cclabebb"
      - name: "SubjectDN"
        in: "header"
        description: |
          Describe the Distinguished Name (DN) of the consumer. Providers get the value from the Gateway and consumers are not required to fill it in. Required for Providers.
        required: false
        schema:
          type: "string"
          example: "o=cclausbb,o=swift"
      - name: "Institution"
        in: "header"
        description: |
          Describe the BIC of the consumer. Providers get the value and consumers are not required to fill it in.
        required: true
        schema:
          type: "string"
          example: "cclausbb"            
      requestBody:
        description: "Verify account details request."  
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountVerificationRequest'
            examples:
              UseCase-1:
                $ref: '#/components/examples/BeneAccountVerificationRequest'
      responses:
        '200':
          description: |
            OK
            
            Get Account Details Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountVerificationResponse1'
              examples:
                DP_1.1_Account_Number_Matches:
                  $ref: '#/components/examples/DP_1.1_Account_Number_Matches'
                DP_1.2_Account_Number_Matches_INCO:
                  $ref: '#/components/examples/DP_1.2_Account_Number_Matches_INCO'
                DP_1.3_Account_Number_Matches_But_Is_Blocked:
                  $ref: '#/components/examples/DP_1.3_Account_Number_Matches_But_Is_Blocked'
                DP_1.4_Account_Number_Matches_But_Is_Blocked_For_Compliance_Reasons:
                  $ref: '#/components/examples/DP_1.4_Account_Number_Matches_But_Is_Blocked_For_Compliance_Reasons'
                DP_1.5_Account_Number_Matches_But_Incorrect_Account_Type_FAIL:
                  $ref: '#/components/examples/DP_1.5_Account_Number_Matches_But_Incorrect_Account_Type_FAIL'
                DP_1.6_Account_Number_Matches_But_Incorrect_Account_Type_WARN:
                  $ref: '#/components/examples/DP_1.6_Account_Number_Matches_But_Incorrect_Account_Type_WARN'
                DP_1.7_Account_Number_Matches_But_Incorrect_Account_Type_WARN_NOTC:
                  $ref: '#/components/examples/DP_1.7_Account_Number_Matches_But_Incorrect_Account_Type_WARN_NOTC'
                DP_1.8_Account_Number_Matches_But_Closed_FAIL:
                  $ref: '#/components/examples/DP_1.8_Account_Number_Matches_But_Closed_FAIL'
                DP_1.9_Account_Number_Matches_But_Closed_WARN:
                  $ref: '#/components/examples/DP_1.9_Account_Number_Matches_But_Closed_WARN'
                DP_1.10_Account_Number_Matches_But_Closed_WARN_NOTC:
                  $ref: '#/components/examples/DP_1.10_Account_Number_Matches_But_Closed_WARN_NOTC'
                DP_1.11_Account_Number_Matches_But_Closed_Blocked_Or_Incorrect_Account_Type_NOTC:
                  $ref: '#/components/examples/DP_1.11_Account_Number_Matches_But_Closed_Blocked_Or_Incorrect_Account_Type_NOTC'
                DP_1.12_Account_Number_Does_Not_Match:
                  $ref: '#/components/examples/DP_1.12_Account_Number_Does_Not_Match'
                DP_2.1_Account_Number_Matches_And_The_Name_Matches:
                  $ref: '#/components/examples/DP_2.1_Account_Number_Matches_And_The_Name_Matches'
                DP_2.2.1_Account_Number_Matches_And_The_Name_Partially_Matches_PASS:
                  $ref: '#/components/examples/DP_2.2.1_Account_Number_Matches_And_The_Name_Partially_Matches_PASS'
                DP_2.2.2_Account_Number_Matches_And_The_Name_Partially_Matches_INCO:
                  $ref: '#/components/examples/DP_2.2.2_Account_Number_Matches_And_The_Name_Partially_Matches_INCO'
                DP_2.2.3_Account_Number_Matches_And_The_Name_Partially_Matches_FAIL:
                  $ref: '#/components/examples/DP_2.2.3_Account_Number_Matches_And_The_Name_Partially_Matches_FAIL'
                DP_2.3.1_Account_Number_Matches_And_The_Name_Does_Not_Match_PASS:
                  $ref: '#/components/examples/DP_2.3.1_Account_Number_Matches_And_The_Name_Does_Not_Match_PASS'
                DP_2.3.2_Account_Number_Matches_And_The_Name_Does_Not_Match_FAIL:
                  $ref: '#/components/examples/DP_2.3.2_Account_Number_Matches_And_The_Name_Does_Not_Match_FAIL'
                DP_2.3.3_Account_Number_Matches_And_The_Name_Does_Not_Match_INCO:
                  $ref: '#/components/examples/DP_2.3.3_Account_Number_Matches_And_The_Name_Does_Not_Match_INCO'
                DP_2.4_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_FAIL:
                  $ref: '#/components/examples/DP_2.4_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_FAIL'
                DP_2.5_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Matches:
                  $ref: '#/components/examples/DP_2.5_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Matches'
                DP_2.6_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Partially_Matches:
                  $ref: '#/components/examples/DP_2.6_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Partially_Matches'
                DP_2.7_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Does_Not_Match:
                  $ref: '#/components/examples/DP_2.7_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Does_Not_Match'
                DP_2.8_Account_Number_Does_Not_Match:
                  $ref: '#/components/examples/DP_2.8_Account_Number_Does_Not_Match'
                DP_3.1_Account_Type_Is_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced:
                  $ref: '#/components/examples/DP_3.1_Account_Type_Is_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced'
                DP_4.1_Account_Matches_With_Correlation_Id:
                  $ref: '#/components/examples/DP_4.1_Account_Matches_With_Correlation_Id'
                DP_5.1_Account_Matches_And_Disclose_Creditor_Name:
                  $ref: '#/components/examples/DP_5.1_Account_Matches_And_Disclose_Creditor_Name'
                DP_5.2_Account_Matches_And_Disclose_Creditor_Account:
                  $ref: '#/components/examples/DP_5.2_Account_Matches_And_Disclose_Creditor_Account'
                DP_5.3_Account_Matches_And_Disclose_Creditor_Account_Type:
                  $ref: '#/components/examples/DP_5.3_Account_Matches_And_Disclose_Creditor_Account_Type'
                DP_5.4_Account_Matches_And_Disclose_Creditor_Account_Address:
                  $ref: '#/components/examples/DP_5.4_Account_Matches_And_Disclose_Creditor_Account_Address'
        '400':
          $ref: '#/components/responses/400-BadRequest'
        '401':
          $ref: '#/components/responses/401-Unauthorized'
        '404':
          $ref: '#/components/responses/404-NotFound'
        '429':
          $ref: '#/components/responses/429-TooManyRequests'
        '500':
          $ref: '#/components/responses/500-InternalServerError'
        '503':
          $ref: '#/components/responses/503-ServerUnavailable'
        '504':
          $ref: '#/components/responses/504-GatewayTimeout'
        default:
          $ref: '#/components/responses/500-InternalServerError'
components:
  schemas:
    ErrorMessage:
      type: object
      required: 
        - code
        - severity
        - text
      properties:
        severity:
          type: string
          enum:
             - Fatal
             - Transient
             - Logic
        code:
          type: string
        text:
          type: string
        user_message:
          type: string
        more_info:
          type: string
          format: uri    
    AccountType2Code:
      type: string
      description: |
        `PRIV`-This account is registered for private usage
        
        `BUSI`-This account is registered for business usage.
      enum:
      - PRIV
      - BUSI
    AccountValidationCheckContext1Code:
      type: string
      description: |-
        `BENR`-Request is in the scope of a beneficiary registration validation.
        
        `PAYM`-Request is in the scope of the payment initiation.
        
        `RFPP`-Request is in the scope of a request for a payment initiation.
      enum:
      - BENR
      - PAYM
      - RFPP
    AccountValidationResponse1Code:
      type: string
      description: |-
        `MTCH`-Matched validation check.
        
        `NMTC`-Unmatched validation check.
        
        `NOAP`-Validation check is not applicable.
        
        `NOTC`-Validation check has not been carried out.
      enum:
      - MTCH
      - NMTC
      - NOAP
      - NOTC
    AccountValidationResponse2Code:
      type: string
      description: |
        `MTCH`-Matched creditor account.
        
        `NMTC`-No match for creditor account.
      enum:
      - MTCH
      - NMTC
    AccountValidationResponse3Code:
      type: string
      description: |
        `FAIL`-The account identification provided was not successfully validated to an account that can receive funds.
        
        `INCO`-The account identification provided was successfully validated to an account that can receive funds, however, some additional account checks will be performed at transaction time.
        
        `PASS`-The account identification was successfully validated to an account that can receive funds.
        
        `WARN`-The account identification was not successfully validated to an account that can receive funds, however, the responder lacks some information to provide a definite answer.
      enum:
      - FAIL
      - INCO
      - PASS
      - WARN
    AccountValidationResponse4Code:
      type: string
      description: |
        `MTCH`-Matched validation check.
        
        `MBAM`-The beneficiary bank has determined that the provided creditor name closely resembles the account holder name. However, it is not an exact match. The beneficiary bank can choose to disclose the actual account holder name for the payment sender to verify or update its records.
        
        `NMTC`-Unmatched validation check.
        
        `NOAP`-Validation check is not applicable.
        
        `NOTC`-Validation check has not been carried out.
      enum:
      - MTCH
      - MBAM
      - NMTC
      - NOAP
      - NOTC
    AccountValidationSource1Code:
      type: string
      description: |
        `ACSV`-The responder is the financial institution servicing this account, basing its decision on its account holding system.
        
        `HIST`-The responder is SWIFT, basing its decision on SWIFT past transations (successful or failed) made to this account.
        
        `OBSP`-The responder is a third-party system to which the account servicer delegated implementation of the API, basing its decision on data fed by the account servicer. The data feed frequency can vary from one implementation to another.
      enum:
      - ACSV
      - HIST
      - OBSP
    AccountVerificationRequest:
      type: object
      description: Beneficiary account verification request.
      additionalProperties: false
      properties:
        correlation_identifier:
          # Identifier of the request, assigned by the sender of the request. It will allow the requestor to correlate the request and the response.
          # If the request contains the Correlation ID, ensure your institution is capable of returning a response including the same Correlation ID. 
          # However, if the request does not contain the Correlation ID, ensure your institution does not include any Correlation ID in the response. 
          $ref: '#/components/schemas/Max50Text'
        context:
          #  Context in which this transaction is performed.
          $ref: '#/components/schemas/AccountValidationCheckContext1Code'
        uetr:
          #  UETR of the transaction that is going to be sent to this account.
          $ref: '#/components/schemas/UUIDv4Identifier'
        creditor_account:
          #  Identifies the account targeted by the transaction.
          $ref: '#/components/schemas/Max34Text'
        creditor_name:
          #  Name by which the creditor is known.
          $ref: '#/components/schemas/Max140Text'
        creditor_address:
          #  Information that locates and identifies the address of the creditor, as defined by postal services.
          $ref: '#/components/schemas/PostalAddress24'
        creditor_organisation_identification:
          #  Unique and unambiguous way to identify a creditor.
          $ref: '#/components/schemas/OrganisationIdentification8'
        creditor_agent:
          #  Financial institution servicing an account for the creditor.
          $ref: '#/components/schemas/FinancialInstitutionIdentification20'
        creditor_agent_branch_identification:
          #  Identifies a specific branch of the creditor.
          $ref: '#/components/schemas/Max35Text'
      required:
      - context
      - creditor_account
      - creditor_name
    AccountVerificationResponse1:
      type: object
      description: Get Account Details Response
      additionalProperties: false
      properties:
        correlation_identifier:
          # Identifier of the request, assigned by the sender of the request. It will allow the requestor to correlate the request and the response.
          # If the request contains the Correlation ID, ensure your institution is capable of returning a response including the same Correlation ID. 
          # However, if the request does not contain the Correlation ID, ensure your institution does not include any Correlation ID in the response. 
          $ref: '#/components/schemas/Max50Text'
        response:
          #  Provides the response to the account verification request.
          $ref: '#/components/schemas/ValidationCheckResponse2'
      required:
      - response
    AddressType2Code:
      type: string
      description: |-
        Specifies the type of address.
        `ADDR`-Address is the complete postal address.
        
        `PBOX`-Address is a postal office (PO) box.
        
        `HOME`-Address is the home address.
        
        `BIZZ`-Address is the business address.
        
        `MLTO`-Address is the address to which mail is sent.
        
        `DLVY`-Address is the address to which delivery is to take place.
      enum:
      - ADDR
      - PBOX
      - HOME
      - BIZZ
      - MLTO
      - DLVY
    AddressType3Choice:
      type: object
      description: |
        Choice of formats for the type of address.
      additionalProperties: false
      properties:
        code:
          #  Type of address expressed as a code.
          $ref: '#/components/schemas/AddressType2Code'
        proprietary:
          #  Type of address expressed as a proprietary code.
          $ref: '#/components/schemas/GenericIdentification30'
      oneOf:
      - required:
        - code
      - required:
        - proprietary
    AnyBICIdentifier:
      type: string
      description: |
        Code allocated to a financial or non-financial institution by the ISO 9362 Registration Authority, as described in ISO 9362 "Banking - Banking telecommunication messages - Business identifier code (BIC)".
      pattern: ^[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}$
    BICFIIdentifier:
      type: string
      description: |
        Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362 "Banking - Banking telecommunication messages - Business identifier code (BIC)".
      pattern: ^[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}$
    ClearingSystemIdentification2Choice:
      type: object
      description: Choice of a clearing system identifier.
      additionalProperties: false
      properties:
        code:
          #  Identification of a clearing system, in a coded form as published in an external list.
          $ref: '#/components/schemas/ExternalClearingSystemIdentification1Code'
        proprietary:
          #  Identification code for a clearing system, that has not yet been identified in the list of clearing systems.
          $ref: '#/components/schemas/Max35Text'
      oneOf:
      - required:
        - code
      - required:
        - proprietary
    ClearingSystemMemberIdentification2:
      type: object
      description: |
        Unique identification, as assigned by a clearing system, to unambiguously identify a member of the clearing system.
      additionalProperties: false
      properties:
        clearing_system_identification:
          #  Specification of a pre-agreed offering between clearing agents or the channel through which the payment instruction is processed.
          $ref: '#/components/schemas/ClearingSystemIdentification2Choice'
        member_identification:
          #  Identification of a member of a clearing system.
          $ref: '#/components/schemas/Max35Text'
      required:
      - member_identification
    CountryCode:
      type: string
      pattern: ^[A-Z]{2,2}$
      description: |
        Code to identify a country, a dependency, or another area of particular geopolitical interest, on the basis of country names obtained from the United Nations (ISO 3166, Alpha-2 code).
    Exact4AlphaNumericText:
      type: string
      description: Specifies an alphanumeric string with a length of 4 characters.
      pattern: ^[a-zA-Z0-9]{4}$
    ExternalClearingSystemIdentification1Code:
      type: string
      minLength: 1
      maxLength: 5
      description: |
        Specifies the clearing system identification code, as published in an external clearing system identification code list.
        
        External code sets can be downloaded from www.iso20022.org.
    ExternalOrganisationIdentification1Code:
      type: string
      minLength: 1
      maxLength: 4
      description: |
        Specifies the external organisation identification scheme name code in the format of character string with a maximum length of 4 characters.
        
        The list of valid codes is an external code list published separately.
        
        External code sets can be downloaded from www.iso20022.org.
    FinancialInstitutionIdentification20:
      type: object
      description: Set of elements used to identify a financial institution.
      additionalProperties: false
      properties:
        bicfi:
          #  Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362 "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          $ref: '#/components/schemas/BICFIIdentifier'
        clearing_system_member_identification:
          #  Information used to identify a member within a clearing system.
          $ref: '#/components/schemas/ClearingSystemMemberIdentification2'
    GenericIdentification30:
      type: object
      description: Information related to an identification, for example, party identification or account identification.
      additionalProperties: false
      properties:
        identification:
          #  Proprietary information, often a code, issued by the data source scheme issuer.
          $ref: '#/components/schemas/Exact4AlphaNumericText'
        issuer:
          #  Entity that assigns the identification.
          $ref: '#/components/schemas/Max35Text'
        scheme_name:
          #  Short textual description of the scheme.
          $ref: '#/components/schemas/Max35Text'
      required:
      - identification
      - issuer
    GenericOrganisationIdentification1:
      type: object
      description: Information related to an identification of an organisation.
      additionalProperties: false
      properties:
        identification:
          #  Identification assigned by an institution.
          $ref: '#/components/schemas/Max35Text'
        scheme_name:
          #  Name of the identification scheme.
          $ref: '#/components/schemas/OrganisationIdentificationSchemeName1Choice'
        issuer:
          #  Entity that assigns the identification.
          $ref: '#/components/schemas/Max35Text'
      required:
      - identification
    Max140Text:
      type: string
      description: Specifies a character string with a maximum length of 140 characters.
      minLength: 1
      maxLength: 140
    Max16Text:
      type: string
      description: Specifies a character string with a maximum length of 16 characters.
      minLength: 1
      maxLength: 16
    Max34Text:
      type: string
      description: Specifies a character string with a maximum length of 34 characters.
      minLength: 1
      maxLength: 34
    Max35Text:
      type: string
      description: Specifies a character string with a maximum length of 35 characters.
      minLength: 1
      maxLength: 35
    Max50Text:
      type: string
      description: Specifies a character string with a maximum length of 50 characters.
      minLength: 1
      maxLength: 50
    Max70Text:
      type: string
      description: Specifies a character string with a maximum length of 70characters.
      minLength: 1
      maxLength: 70
    OrganisationIdentification8:
      type: object
      description: Unique and unambiguous way to identify an organisation.
      additionalProperties: false
      properties:
        any_bic:
          #  Code allocated to a financial institution or non financial institution by the ISO 9362 Registration Authority as described in ISO 9362 "Banking - Banking telecommunication messages - Business identifier code (BIC)".
          $ref: '#/components/schemas/AnyBICIdentifier'
        other:
          type: array
          #  Unique identification of an organisation, as assigned by an institution, using an identification scheme.
          items:
            $ref: '#/components/schemas/GenericOrganisationIdentification1'
    OrganisationIdentificationSchemeName1Choice:
      type: object
      description: Sets of elements to identify a name of the organisation identification scheme.
      additionalProperties: false
      properties:
        code:
          #  Name of the identification scheme, in a coded form as published in an external list.
          $ref: '#/components/schemas/ExternalOrganisationIdentification1Code'
        proprietary:
          #  Name of the identification scheme, in a free text form.
          $ref: '#/components/schemas/Max35Text'
      oneOf:
      - required:
        - code
      - required:
        - proprietary
    PostalAddress24:
      type: object
      description: Information that locates and identifies a specific address, as defined by postal services.
      additionalProperties: false
      properties:
        address_type:
          #  Identifies the nature of the postal address.
          $ref: '#/components/schemas/AddressType3Choice'
        department:
          #  Identification of a division of a large organisation or building.
          $ref: '#/components/schemas/Max70Text'
        sub_department:
          #  Identification of a sub-division of a large organisation or building.
          $ref: '#/components/schemas/Max70Text'
        street_name:
          #  Name of a street or thoroughfare.
          $ref: '#/components/schemas/Max70Text'
        building_number:
          #  Number that identifies the position of a building on a street.
          $ref: '#/components/schemas/Max16Text'
        building_name:
          #  Name of the building or house.
          $ref: '#/components/schemas/Max35Text'
        floor:
          #  Floor or storey within a building.
          $ref: '#/components/schemas/Max70Text'
        post_box:
          #  Numbered box in a post office, assigned to a person or organisation, where letters are kept until called for.
          $ref: '#/components/schemas/Max16Text'
        room:
          #  Building room number.
          $ref: '#/components/schemas/Max70Text'
        post_code:
          #  Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail.
          $ref: '#/components/schemas/Max16Text'
        town_name:
          #  Name of a built-up area, with defined boundaries, and a local government.
          $ref: '#/components/schemas/Max35Text'
        town_location_name:
          #  Specific location name within the town.
          $ref: '#/components/schemas/Max35Text'
        district_name:
          #  Identifies a subdivision within a country sub-division.
          $ref: '#/components/schemas/Max35Text'
        country_sub_division:
          #  Identifies a subdivision of a country such as state, region, county.
          $ref: '#/components/schemas/Max35Text'
        country:
          #  Nation with its own government.
          $ref: '#/components/schemas/CountryCode'
        address_line:
          type: array
          maxItems: 7
          #  Information that locates and identifies a specific address, as defined by postal services, presented in free format text.
          items:
            $ref: '#/components/schemas/Max70Text'
    UUIDv4Identifier:
      type: string
      description: |
        Universally Unique IDentifier (UUID) version 4, as described in IETC RFC 4122 "Universally Unique IDentifier (UUID) URN Namespace".
      pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$
    ValidationCheckResponse2:
      type: object
      description: |
        This represents the response details that the Creditor Account validation service will provide to the service consumer with regards to the creditor account validation performed by the creditor account.
      additionalProperties: false
      properties:
        account_validation_status:
          #  'Overall status of the creditor account validation done by the creditor agent. '
          $ref: '#/components/schemas/AccountValidationResponse3Code'
        creditor_account_match:
          #  Outcome of the creditor account number validation done by the creditor agent.  The validation logic used must follow the same rules as the ones that would be apply when the transaction will be processed.
          $ref: '#/components/schemas/AccountValidationResponse2Code'
        creditor_name_match:
          #  Result of matching the provided creditor name with the account holder name. The matching logic used must follow the same rules as the ones that would be apply when the transaction will be processed.
          $ref: '#/components/schemas/AccountValidationResponse4Code'
        creditor_address_match:
          #  Result of matching the provided creditor address with the account holder address. The matching logic used must follow the same rules as the ones that would be apply when the transaction will be processed.
          $ref: '#/components/schemas/AccountValidationResponse1Code'
        creditor_organisation_identification_match:
          $ref: '#/components/schemas/AccountValidationResponse1Code'
        creditor_account:
          $ref: '#/components/schemas/Max34Text'
        creditor_account_type:
          $ref: '#/components/schemas/AccountType2Code'
        creditor_name:
          $ref: '#/components/schemas/Max140Text'
        creditor_address:
          $ref: '#/components/schemas/PostalAddress24'
        validation_source:
          #  Indicates the party in the validation process that has performed the validation and how it was performed.
          $ref: '#/components/schemas/AccountValidationSource1Code'
      required:
      - account_validation_status
      - creditor_account_match
      - creditor_name_match
      - creditor_address_match
      - creditor_organisation_identification_match
  responses:
    '400-BadRequest':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          examples:
            Account_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced:
              $ref: '#/components/examples/Account_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced'
            Account_Error_Unsupported_Format:
              $ref: '#/components/examples/Account_Error_Unsupported_Format'
    '401-Unauthorized':
      description: 'Unauthorized'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    '404-NotFound':
      description: 'Not Found'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    '429-TooManyRequests':
      description: 'Too Many Requests'
      content:
        application/json:
          schema: 
            $ref: '#/components/schemas/ErrorMessage'
          example:
            severity: Transient
            code: SwAP507
            text: 'Request cannot be processed at this time. Please try later. (header Retry-After indicates how long to wait before making a follow-up request).'
    '500-InternalServerError':
      description: 'Internal Server Error'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
          example:
            severity: Transient
            code: Sw.gpi.InternalError
            text: Internal error
    '503-ServerUnavailable':
      description: 'ServerUnavailable'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    '504-GatewayTimeout':
      description: 'GatewayTimeout'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'
    'default':
      description: 'Internal Server Error'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorMessage'  
  examples:
    BeneAccountVerificationRequest:
      summary: Beneficiary Account Verification request
      value:
        correlation_identifier: '112211221122'
        context: BENR
        uetr: 97ed4827-7b6f-4491-a06f-b548d5a7512d
        creditor_account: '7892368367'
        creditor_name: DEF Electronics
        creditor_address:
          address_type: 
            code: ADDR
          department: Head Office
          sub_department: Retail Department
          street_name: 1 Park Avenue
          building_name: Empire State Building
          floor: '1'
          post_code: '11232'
          town_name: New York City
          country_sub_division: New York
          country: US
        creditor_organisation_identification:
          any_bic: BBBBUS2L
          other:
          - identification: '887766'
            scheme_name: 
              code: TIN
            issuer: US IRS    
        creditor_agent:
          bicfi: AAAAUS2L
          clearing_system_member_identification:
            clearing_system_identification:
              code: USABA
            member_identification: '122000002'
        creditor_agent_branch_identification: NY8877888
    DP_1.1_Account_Number_Matches:
      description: | 
        The account is open and capable of receiving funds.  
      value:
        correlation_identifier: DP-1.1
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.2_Account_Number_Matches_INCO:
      description: | 
        The account is open and capable of receiving funds, or the account is blocked for a reason that cannot be disclosed to the data consumer. 
        In both cases, name validation will apply to a payment transaction sent to this account number (see NOTC).
      value:
        correlation_identifier: DP-1.2
        response:
          account_validation_status: INCO
          creditor_account_match: MTCH
          creditor_name_match: NOTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.3_Account_Number_Matches_But_Is_Blocked:
      description: | 
        The account is blocked for a reason that can be disclosed to the data consumer.
      value:
        correlation_identifier: DP-1.3
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.4_Account_Number_Matches_But_Is_Blocked_For_Compliance_Reasons:
      description: |
        The account is blocked for a reason that cannot be disclosed to the data consumer. 
      value:
        correlation_identifier: DP-1.4
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.5_Account_Number_Matches_But_Incorrect_Account_Type_FAIL:
      description: |
        This type of account does not accept incoming funds (for example, mortgage account). A payment transaction to this account number will fail.
      value:
        correlation_identifier: DP-1.5
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.6_Account_Number_Matches_But_Incorrect_Account_Type_WARN:
      description: |
        This type of account does not accept incoming funds (for example, a mortgage account). A payment transaction to this account number may not fail, as there is a high probability that the payment can be re-allocated to an alternative appropriate account from the same account holder.
      value:
        correlation_identifier: DP-1.6
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.7_Account_Number_Matches_But_Incorrect_Account_Type_WARN_NOTC:
      description: |
        This type of account does not accept incoming funds (for example, a mortgage account). A payment transaction to this account number may not fail, as there is a high probability that the payment can be re-allocated to an alternative appropriate account from the same account holder. Name validation will apply to a payment transaction sent to this account number (see NOTC).
      value:
        correlation_identifier: DP-1.7
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: NOTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.8_Account_Number_Matches_But_Closed_FAIL:
      description: |
        The account is closed and thus cannot receive incoming funds. A payment transaction to this account number will fail.
      value:
        correlation_identifier: DP-1.8
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.9_Account_Number_Matches_But_Closed_WARN:
      description: |
       The account is closed and thus cannot receive incoming funds. A payment transaction to this account number may not fail, as there is a high probability that the payment can be re-allocated to an alternative appropriate account from the same account holder.
      value:
        correlation_identifier: DP-1.9
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.10_Account_Number_Matches_But_Closed_WARN_NOTC:
      description: |
        The account is closed and thus cannot receive incoming funds. A payment transaction to this account number may not fail, as there is a high probability that the payment can be  re-allocated to an alternative appropriate account from the same account holder. Name validation will apply to a payment transaction sent to this account number.
      value:
        correlation_identifier: DP-1.10
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: NOTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.11_Account_Number_Matches_But_Closed_Blocked_Or_Incorrect_Account_Type_NOTC:
      description: |
        A payment transaction to this account number may succeed. Either the account does not exist, or it is not of the right type, or it is blocked or closed. However, there is a high probability that the payment can be reallocated by creditor agent to an alternative appropriate account from the same account holder. The name provided matches the account holder name. 
        For more business context, see DP_1.3, DP_1.5, and DP_1.8. However, name validation will apply to a payment transaction sent to this account number (see NOTC).
      value:
        correlation_identifier: DP-1.11
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_1.12_Account_Number_Does_Not_Match:
      description: |
        A payment transaction to this account number will fail.
      value:
        correlation_identifier: DP-1.12
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.1_Account_Number_Matches_And_The_Name_Matches:
      description: |
        The account holder matches the name received.
      value:
        correlation_identifier: DP-2.1
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: MTCH
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.2.1_Account_Number_Matches_And_The_Name_Partially_Matches_PASS:
      description: |
        The account holder closely matches to the name received. The data provider can decide to disclose the correct account holder name back in the response (in the field 'creditor_name') to the data consumer. 
        Prevalidation time name matching only. OR 
        A payment transaction to this account number with a partial name match will not fail.
      value:
        correlation_identifier: DP-2.2.1
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: MBAM
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.2.2_Account_Number_Matches_And_The_Name_Partially_Matches_INCO:
      description: |
        The account holder closely matches to the name received. The data provider can decide to disclose the correct account holder name back in the response (in the field 'creditor_name') to the data consumer. 
        A payment transaction to this account number with a partial name match may fail, but transaction processing time name repair logic is applicable.
      value:
        correlation_identifier: DP-2.2.2
        response:
          account_validation_status: INCO
          creditor_account_match: MTCH
          creditor_name_match: MBAM
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.2.3_Account_Number_Matches_And_The_Name_Partially_Matches_FAIL:
      description: |
        The account holder closely matches to the name received. The data provider can decide to disclose the correct account holder name back in the response (in the field 'creditor_name') to the data consumer. 
        A payment transaction to this account number with a partial match will fail.
      value:
        correlation_identifier: DP-2.2.3
        response:
          account_validation_status: FAIL
          creditor_account_match: MTCH
          creditor_name_match: MBAM
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.3.1_Account_Number_Matches_And_The_Name_Does_Not_Match_PASS:
      description: |
        The account holder does not match the name received. 
        Prevalidation time name matching only.
      value: 
        correlation_identifier: DP-2.3.1
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NMTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.3.2_Account_Number_Matches_And_The_Name_Does_Not_Match_FAIL:
      description: |
        The account holder does not match the name received. 
        The name matching logic is the same at prevalidation time and at payment processing time.
      value:
        correlation_identifier: DP-2.3.2
        response:
          account_validation_status: FAIL
          creditor_account_match: MTCH
          creditor_name_match: NMTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.3.3_Account_Number_Matches_And_The_Name_Does_Not_Match_INCO:
      description: |
        The account holder does not match the name received. 
        The name matching logic at prevalidation time and at payment processing time is not identical. Transaction processing time name repair logic is applicable.
      value:
        correlation_identifier: DP-2.3.3
        response:
          account_validation_status: INCO
          creditor_account_match: MTCH
          creditor_name_match: NMTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.4_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_FAIL:
      description: |
        The payment cannot be re-allocated, so the name validation is not applicable as the payment will fail due to the account number. As a result, name matching is not applicable.
      value:
        correlation_identifier: DP-2.4
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.5_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Matches:
      description: |
        The payment may be re-allocated and the account holder matches the name received.
      value:
        correlation_identifier: DP-2.5
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: MTCH
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.6_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Partially_Matches:
      description: |
        The payment may be re-allocated and the account holder closely matches to the name received. The data provider can decide to disclose the correct account holder name back in the response (in the field 'creditor_name') to the data consumer.
      value:
        correlation_identifier: DP-2.6
        response:
          account_validation_status: INCO
          creditor_account_match: MTCH
          creditor_name_match: MBAM
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.7_Account_Number_Matches_But_Closed_Blocked_Incorrect_Account_Type_And_The_Name_Does_Not_Match:
      description: |
        The payment may be re-allocated, however, payment may fail because the account holder does not match the name received.
      value:
        correlation_identifier: DP-2.7
        response:
          account_validation_status: WARN
          creditor_account_match: NMTC
          creditor_name_match: NMTC
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_2.8_Account_Number_Does_Not_Match:
      description: |
        A payment transaction to this account number will fail. As a result, name matching is not applicable.
      value: 
        correlation_identifier: DP-2.3.1
        response:
          account_validation_status: FAIL
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_3.1_Account_Type_Is_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced:
      description: |
        The request  is not supported because the type of account is not supported (for example, a retail account) or because the data provider chose not to respond to the consumer (for example, the request is coming from an out of scope country).
      value:
        correlation_identifier: DP-3.1
        response:
          account_validation_status: INCO
          creditor_account_match: NMTC
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_4.1_Account_Matches_With_Correlation_Id:
      description: |
        Data Providers should make sure to correctly set up the correlation ID in the response. If the API request contains the correlation ID, the same correlation ID must be returned in the API response. However, if the API request does not contain the correlation ID, the same should not be included in the API response.    
      value:
        correlation_identifier: 2bcb053d-3c8b-43f0-8c76-e676407378c4
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: MTCH
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          validation_source: ACSV
    DP_5.1_Account_Matches_And_Disclose_Creditor_Name:
      description: |
        As described in use case 2.2.x, Account Matches and Name Partially Matches, data providers can provide the account holder name in the API response to the data consumer. Some data providers might provide the account holder name in case of a partial match, but they can provide in any case if they choose to do so. Data providers can send initials, full name, or a combination of initial and full name (for example, J D, or Jane D, or J Doe, or Jane Doe).
      value:
        correlation_identifier: DP-5.1
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: MBAM
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          creditor_name: DEF Electronics
          validation_source: ACSV
    DP_5.2_Account_Matches_And_Disclose_Creditor_Account:
      description: |
        Data providers can provide an account in the API response to the data consumer. Some data providers can identify that the account is not in the expected account format and choose to return the account in the correct account format. For example, a data consumer sending a BBAN account (00240240 C012 9986 5) to a Switzerland data provider could receive in the API response the same account in the IBAN format (CH250024 0240 C012 9986 5).
      value:
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          creditor_account: CH2500240240C01299865
          validation_source: ACSV
    DP_5.3_Account_Matches_And_Disclose_Creditor_Account_Type:
      description: |
        Data providers can provide the account type in the API response to the data consumer. The account type has 2 values: PRIV when the account is registered for private usage and BUSI when account is registered for business usage. Some data providers can identify the type and choose to return it in the API response.
      value:
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          creditor_account_type: BUSI
          validation_source: ACSV
    DP_5.4_Account_Matches_And_Disclose_Creditor_Account_Address:
      description: |
        Data providers can provide the account holder address in the API response to the data consumer. They can choose to provide the address either as unstructured (address_line) or structured (the rest of the creditor_address elements). Swift recommends data providers to not disclose the address at this stage as the address matching is not in scope.
      value:
        response:
          account_validation_status: PASS
          creditor_account_match: MTCH
          creditor_name_match: NOAP
          creditor_address_match: NOAP
          creditor_organisation_identification_match: NOAP
          creditor_address:
            address_type: 
              code: ADDR
            department: Head Office
            sub_department: Retail Department
            street_name: 1 Park Avenue
            building_name: Empire State Building
            floor: '1'
            post_code: '11232'
            town_name: New York City
            country_sub_division: New York
            country: US
          validation_source: ACSV
    Account_Out_Of_Scope_Of_The_Implementation_OR_Cannot_Be_Serviced:
      summary: Account Out Of Scope Of The Implmentation OR Cannot Be Serviced
      value:
        severity: Fatal
        code: CANT
        text: Account requested cannot be verified because of non-existence of integration with the book system where this account is maintained.
    Account_Error_Unsupported_Format:
      summary: Account Error Unsupported Format
      value:
        severity: Fatal
        code: CANT
        text: Account number format is not supported.