openapi: 3.0.1
info:
  title: PSD2 ASPSP services for PISP.
  version: "3.0.1"
  description: | 
    These endpoints provide the PISP possibilities for initiating payments, requesting a payment status and cancelling a payment.
servers:
  - url: psd2.b2b.belfius.be:8443
paths:

  #####################################################
  # Payment Details Service
  #####################################################
  
  /payments/{payment-product}/{payment-id}/details:
    get:
      summary: Payment details request.
      description: |
         The PISP checks the details of a payment initiation.
         Only the following **payment products** are allowed:
         - ***sepa-credit-transfers***
         - ***instant-sepa-credit-transfers***
         - ***cross-border-credit-transfers***
         
         Please note that the Authorization header is mandatory & must be provided with a bearer token. Caller receives the bearer token by standard OAuth2 authorization code grant flow, calling /token API with the authorization_code received at the end of payment initation request.
         
         Please refer to documentation in the "flow" section of the portal for details.

      tags:
        - Payment Initiation Service (PIS)
      
      parameters:

      #path
        - $ref: "#/components/parameters/paymentProduct"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID" 

      responses:
        '200':
          $ref: "#/components/responses/OK_200_PaymentDetails"
      
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '408':
          $ref: "#/components/responses/REQUEST_TIMEOUT_408"
          
        '409':
          $ref: "#/components/responses/CONFLICT_409"

        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"
  
  #####################################################
  # Payment Status Service
  #####################################################

  /payments/{payment-product}/{payment-id}/status:
    get:
      summary: Payment initiation status request.
      description: |
         The PISP checks the transaction status of a payment initiation.
         Only the following **payment products** are allowed:
         - ***sepa-credit-transfers***
         - ***instant-sepa-credit-transfers***
         - ***cross-border-credit-transfers***         
      tags:
        - Payment Initiation Service (PIS)
      
      parameters:

      #path
        - $ref: "#/components/parameters/paymentProduct"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization_optional"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID" 

      responses:
        '200':
          $ref: "#/components/responses/OK_200_PaymentInitiationStatus"
      
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '408':
          $ref: "#/components/responses/REQUEST_TIMEOUT_408"
          
        '409':
          $ref: "#/components/responses/CONFLICT_409"

        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Payment Initiation Service
  #####################################################

  /payments/{payment-product}:
    post:
      summary: Payment initiation request.
      description: |

        The PISP initiates a payment at the ASPSP.
         Only the following **payment products** are allowed:
         - ***sepa-credit-transfers***
         - ***instant-sepa-credit-transfers***
         - ***cross-border-credit-transfers***

         Please note that there's a conditional check between Authorization header and PKCE headers (Code-Challenge + Code-Challenge-Method). If Authorization header is provided, PKCE headers are not taken into account. If Authorization header is not provided, PKCE headers become mandatory. In this later case, the PKCE headers are used to prepare an OAuth2 authorization code which can then be used to request OAuth2 access token. This access token can then be passed as Bearer token in APIs which accept an Authorization header.
         
         Please note that Authorization header is mandatory for Payment details & Payment cancellation APIs. That means in order to call any of the Payment details or Payment cancellation APIs, you must obtain an access token as mentioned above.
         
         Please refer to documentation in the "flow" section of the portal for details.

      tags:
        - Payment Initiation Service (PIS)
      
      parameters:
      
      #path
        - $ref: "#/components/parameters/paymentProduct"

      #query # NO QUERY PARAMETER

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization_optional"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept_v3"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Content-Type"
        - $ref: "#/components/parameters/Client-ID"
        - $ref: "#/components/parameters/Redirect-URI"
        - $ref: "#/components/parameters/Signature"
        - $ref: "#/components/parameters/Digest"
        - $ref: "#/components/parameters/Date"
        - $ref: "#/components/parameters/Code-Challenge-Method"
        - $ref: "#/components/parameters/Code-Challenge"

      requestBody:
        $ref: "#/components/requestBodies/PaymentInitiation"
      
      responses:
        '201':
          $ref: "#/components/responses/OK_201_PaymentInitiation"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Payment Cancellation Service
  #####################################################

  /payments/{payment-product}/{payment-id}:
    delete:
      summary: Cancels a payment initiation.
      description: |
         The PISP sends a cancel payment message in order to delete a payment initiation.
         Only payment initiation in status RCVD, PATC and PNDG (only for sepa-credit-transfers) can be cancelled.
         Only the following **payment products** are allowed:
         - ***sepa-credit-transfers***
         - ***instant-sepa-credit-transfers***
         
         Please note that the Authorization header is mandatory & must be provided with a bearer token. Caller receives the bearer token by standard OAuth2 authorization code grant flow, calling /token API with the authorization_code received at the end of a payment initation request.
         
         Please refer to documentation in the "flow" section of the portal for details.
        
      tags:
        - Payment Initiation Service (PIS)
      parameters:

      #path
        - $ref: "#/components/parameters/paymentProduct_cancel"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept_v2"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID"        
  
      responses:
        '204':
          $ref: "#/components/responses/NO_CONTENT_204_PaymentCancel"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Periodic Payment Details Service
  #####################################################
  
  /periodic-payments/{payment-product}/{payment-id}/details:
    get:
      summary: Periodic payment details request.
      description: |
         The PISP checks the details of a periodic payment initiation.
         Only the following **payment products** are allowed:
         - ***sepa-credit-transfers***

         Please note that the Authorization header is mandatory & must be provided with a bearer token. Caller receives the bearer token by standard OAuth2 authorization code grant flow, calling /token API with the authorization_code received at the end of a periodic-payment initiation request.
        
      tags:
        - Payment Initiation Service (PIS)
      
      parameters:

      #path
        - $ref: "#/components/parameters/paymentProduct"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID" 

      responses:
        '200':
          $ref: "#/components/responses/OK_200_PeriodicPaymentDetails"
      
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '408':
          $ref: "#/components/responses/REQUEST_TIMEOUT_408"
          
        '409':
          $ref: "#/components/responses/CONFLICT_409"

        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"
  
  #####################################################
  # Periodic Payment Status Service
  #####################################################

  /periodic-payments/{payment-product}/{payment-id}/status:
    get:
      summary: Periodic Payment initiation status request.
      description: |
         The PISP checks the transaction status of a periodic payment initiation.
         Only the following **payment product** is allowed:
         - ***sepa-credit-transfers***
      tags:
        - Payment Initiation Service (PIS)
      
      parameters:

      #path
        - $ref: "#/components/parameters/periodicPaymentProduct"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization_optional"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID" 

      responses:
        '200':
          $ref: "#/components/responses/OK_200_PaymentInitiationStatus"
      
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '408':
          $ref: "#/components/responses/REQUEST_TIMEOUT_408"
          
        '409':
          $ref: "#/components/responses/CONFLICT_409"

        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Periodic Payment Initiation Service
  #####################################################

  /periodic-payments/{payment-product}:
    post:
      summary: Periodic Payment initiation request.
      description: |
         The PISP initiates a periodic payment at the ASPSP.
         Only the following **payment product** is allowed:
         - ***sepa-credit-transfers***
         
         Please note that there's a conditional check between Authorization header and PKCE headers (Code-Challenge + Code-Challenge-Method). If Authorization header is provided, PKCE headers are not taken into account. If Authorization header is not provided, PKCE headers become mandatory. In this later case, the PKCE headers are used to prepare an OAuth2 authorization code which can then be used to request OAuth2 access token. This access token can then be passed as Bearer token in APIs which accept an Authorization header.
         
         Please note that Authorization header is mandatory for Payment details & Payment cancellation APIs. That means in order to call any of the Payment details or Payment cancellation APIs, you must obtain an access token as mentioned above.
         
         Please refer to documentation in the "flow" section of the portal for details.

      tags:
        - Payment Initiation Service (PIS)
      
      parameters:
      
      #path
        - $ref: "#/components/parameters/periodicPaymentProduct"

      #query # NO QUERY PARAMETER

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization_optional"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept_v2"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Content-Type"
        - $ref: "#/components/parameters/Client-ID"
        - $ref: "#/components/parameters/Redirect-URI"
        - $ref: "#/components/parameters/Signature"
        - $ref: "#/components/parameters/Digest"
        - $ref: "#/components/parameters/Date"
        - $ref: "#/components/parameters/Code-Challenge-Method"
        - $ref: "#/components/parameters/Code-Challenge"

      requestBody:
        $ref: "#/components/requestBodies/PeriodicPaymentInitiation"
      
      responses:
        '201':
          $ref: "#/components/responses/OK_201_PaymentInitiation"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Periodic Payment Cancellation Service
  #####################################################

  /periodic-payments/{payment-product}/{payment-id}:
    delete:
      summary: Cancels a periodic payment initiation.
      description: |
         The PISP sends a cancel payment message in order to delete a periodic payment initiation.
         Periodic payment contracts in status RCVD, PATC, PNDG and ACWP can be cancelled.
         Note that ongoing payment execution will not be cancelled when cancelling the periodic payment contract.

         Please note that the Authorization header is mandatory & must be provided with a bearer token. Caller receives the bearer token by standard OAuth2 authorization code grant flow, calling /token API with the authorization_code received at the end of a periodic-payment initiation request.         
         
      tags:
        - Payment Initiation Service (PIS)
      parameters:

      #path
        - $ref: "#/components/parameters/periodicPaymentProduct_cancel"
        - $ref: "#/components/parameters/paymentId"

      #query
        - $ref: "#/components/parameters/paymentIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Authorization"
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID"        
  
      responses:
        '204':
          $ref: "#/components/responses/NO_CONTENT_204_PaymentCancel"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Bulk Payment Status Service
  #####################################################

  /bulk-payments/{bulk-payment-product}/{payment-file-id}/status:
    get:
      summary: Bulk Payment initiation status request.
      description: |
         The PISP checks transaction status of a bulk payment initiation.
         Only the following **bulk payment products** are allowed : 
         - ***pain.001***  
         - ***csv***  
         
      tags:
        - Payment Initiation Service (PIS)
      
      parameters:

      #path
        - $ref: "#/components/parameters/bulkPaymentProduct"
        - $ref: "#/components/parameters/paymentFileId"

      #query
        - $ref: "#/components/parameters/paymentFileIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID"
        - $ref: "#/components/parameters/Redirect-URI"

      responses:
        '200':
          $ref: "#/components/responses/OK_200_BulkPaymentInitiationStatus"
      
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '408':
          $ref: "#/components/responses/REQUEST_TIMEOUT_408"
          
        '409':
          $ref: "#/components/responses/CONFLICT_409"

        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Bulk Payment Initiation Service
  #####################################################

  /bulk-payments/{bulk-payment-product}:
    post:
      summary: Bulk Payment initiation request.
      description: |
         The PISP initiates a bulk payment at the ASPSP.
         Only the following **bulk payment products** are allowed : 
         - ***pain.001***
         - ***csv***

      tags:
        - Payment Initiation Service (PIS)
      
      parameters:
      
      #path
        - $ref: "#/components/parameters/bulkPaymentProduct"

      #query # NO QUERY PARAMETER

      #header
          #common header parameter
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Content-Type-XML-CSV"
        - $ref: "#/components/parameters/Client-ID"
        - $ref: "#/components/parameters/Redirect-URI"
        - $ref: "#/components/parameters/Signature"
        - $ref: "#/components/parameters/Digest"
        - $ref: "#/components/parameters/Date"
        - $ref: "#/components/parameters/PaymentInformationID"
        

      requestBody:
        $ref: "#/components/requestBodies/BulkPaymentInitiation"
      
      responses:
        '201':
          $ref: "#/components/responses/OK_201_BulkPaymentInitiation"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '415':
          $ref: "#/components/responses/UNSUPPORTED_MEDIA_TYPE_415"

        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"

  #####################################################
  # Bulk Payment Cancellation Service
  #####################################################

  /bulk-payments/{bulk-payment-product}/{payment-file-id}:
    delete:
      summary: Cancels a bulk payment initiation.
      description: |
         The PISP sends a cancel payment message in order to delete a bulk payment initiation.
         Only payment initiation in status RCVD, PATC and PNDG can be cancelled.
         Only the following **bulk payment products** are allowed : 
         - ***pain.001***
         - ***csv***

      tags:
        - Payment Initiation Service (PIS)
      parameters:

      #path
        - $ref: "#/components/parameters/bulkPaymentProduct"
        - $ref: "#/components/parameters/paymentFileId"

      #query
        - $ref: "#/components/parameters/paymentFileIdType"

      #header
          #common header parameter
        - $ref: "#/components/parameters/Request-ID"
        - $ref: "#/components/parameters/Accept"
        - $ref: "#/components/parameters/Accept-Language"
        - $ref: "#/components/parameters/Client-ID"        
  
      responses:
        '204':
          $ref: "#/components/responses/NO_CONTENT_204_PaymentCancel"
          
        '400':
          $ref: "#/components/responses/BAD_REQUEST_400"

        '401':
          $ref: "#/components/responses/UNAUTHORIZED_401"

        '403': 
          $ref: "#/components/responses/FORBIDDEN_403" 
          
        '404':
          $ref: "#/components/responses/NOT_FOUND_404"
 
        '405':
          $ref: "#/components/responses/METHOD_NOT_ALLOWED_405"
 
        '406':
          $ref: "#/components/responses/NOT_ACCEPTABLE_406"
          
        '429':
          $ref: "#/components/responses/TOO_MANY_REQUESTS_429"

        '495':
          $ref: "#/components/responses/SSL_CERTIFICATE_ERROR_495"

        '500':
          $ref: "#/components/responses/INTERNAL_SERVER_ERROR_500"

        '503':
          $ref: "#/components/responses/SERVICE_UNAVAILABLE_503"


components:
#####################################################
# Predefined Components
#####################################################

  headers:
  #####################################################
  # Reusable Response Header Elements
  #####################################################
  
    Response-ID:
      description: Same as Request-ID, received in request.
      required: true
      example: "99391c7e-ad88-49ec-a2ad-99ddcb1f7721"
      schema:
        type: string
        format: uuid
        
  schemas:
  #####################################################
  # Predefined Schemas
  #####################################################
    transactionStatus:
      description: | 
        The transaction status is filled with codes from the ISO 20022 data table. Belfius returns the following status
        - 'ACSP': 'AcceptedSettlementInProcess' - 
          Settlement in process.
        - 'RCVD': 'Received' - 
          Payment initiation has been received by Belfius.
        - 'RJCT': 'Rejected' - 
          Payment initiation has been rejected.
        - 'CANC': 'Cancelled' - 
          Payment initiation has been cancelled before execution
        - 'PATC': 'PartiallyAcceptedTechnical' - 
          Payment initiation waiting for signature.
        - 'PDNG': 'Pending' - 
          Payment initiation accepted after technical checks/signature, waiting to go to another status.
      type: string
      enum:
        - "ACSP"
        - "CANC"
        - "PATC"
        - "PDNG"
        - "RCVD"
        - "RJCT"
      example: "RCVD"
      
    transactionStatusPeriodicPayment:
      description: | 
        The transaction status is filled with codes from the ISO 20022 data table. Belfius returns the following status
        - 'ACWP': 'Active standing order' - 
          Payment transaction will be executed according to the standing order characteristics
        - 'CANC': 'Cancelled' - 
          Payment initiation has been cancelled before execution
        - 'PATC': 'PartiallyAcceptedTechnical' - 
          Payment initiation waiting for signature.
        - 'PDNG': 'Pending' - 
          Payment initiation accepted after technical checks/signature, waiting to go to another status.
      type: string
      enum:
        - "ACWP"
        - "CANC"
        - "PATC"
        - "PDNG"
      example: "PDNG"
      
    debtorAccountInformation:
      description: Debtor Account Information. This is no longer mandatory. If filled the given account will be used to initiate the payment. If not filled the PSU will receive an account list while redirected to Belfius environment.
      type: object
      required:
       - iban
      properties:
        iban:
         description: |
          IBAN of an account. 
          Note that the 2 letters identifying the IBAN's country should be upper case.
         type: string
         example: "BE54063301200997"
        currency:
          $ref: "#/components/schemas/accountCurrencyCode"
 
    debtorAccountInformationPeriodicPayment:
      description: Debtor Account Information for periodic payment initiation.
      type: object
      required:
       - iban
      properties:
        iban:
         description: |
          IBAN of an account. 
          Note that the 2 letters identifying the IBAN's country should be upper case.
         type: string
         example: "BE54063301200997"
        currency:
          $ref: "#/components/schemas/accountCurrencyCodePeriodicPayment"
        
    creditorAccountInformation:
     description: Creditor Account Information.
     type: object
     properties:
        iban:
         description: |
          IBAN of an account. Note that the 2 letters identifying the IBAN's country should be upper case.
          * sepa-credit-transfers : required.
          * instant-sepa-credit-transfers : required.
          * cross-border-credit-transfers : conditional.
          Please refer to documentation in the "flow" section of the portal for details.
         type: string
         example: "BE54063301200998"
        bban:
         description: |
          Basic Bank Account Number.
            * sepa-credit-transfers : n/a.
            * instant-sepa-credit-transfers : n/a.
            * cross-border-credit-transfers : conditional. Please refer to documentation in the "flow" section of the portal for details.
         type: string
         example: "123456789FW999999999"
        country:
          $ref: "#/components/schemas/countryCode"
        currency:
          $ref: "#/components/schemas/accountCurrencyCode"
        bic:
         description: |
          Bank Identifier Code.
          * sepa-credit-transfers : optional. 
          * instant-sepa-credit-transfers : optional. 
          * cross-border-credit-transfers : conditional.
          Please refer to documentation in the "flow" section of the portal for details.
         type: string
         example: "BBVAESMM"
        bank_national_id:
         description: |
          Bank National ID. 
          * sepa-credit-transfers : optional. 
          * instant-sepa-credit-transfers : optional. 
          * cross-border-credit-transfers : conditional.
          Please refer to documentation in the "flow" section of the portal for details.
         type: string
         example: "XXXXXXXXX"

    creditorAccountInformationPeriodicPayment:
     description: Creditor Account Information for periodic payment initiation. Variable standing orders are only possible in favour of Belfius saving accounts.
     type: object
     required:
       - iban
     properties:
        iban:
         description: |
          IBAN of an account. Note that the 2 letters identifying the IBAN's country should be upper case.
         type: string
         example: "BE54063301200998"

    periodicPaymentType:
      description: |
        Periodic Payment Type. Indicates whether the amount to be transferred will be the same each execution ("FIXED") or change depending on other variables ("VARIABLE").
      type: string
      enum:
        - "FIXED"
        - "VARIABLE"
      default: "FIXED"
      
    amount:
      type: object
      required:
        - currency
        - amount
      properties:
        currency:
          $ref: "#/components/schemas/currencyCode"
        amount:
          $ref: "#/components/schemas/amountValue"
      example: 
        {
          "currency": "EUR", 
          "amount": "123"
        }

    periodicPaymentAmount:
      type: object
      required:
        - currency
      properties:
        currency:
          $ref: "#/components/schemas/currencyCodePeriodicPayment"
        amount:
          $ref: "#/components/schemas/periodicPaymentAmountValue"
        minimal_amount:
          $ref: "#/components/schemas/periodicMinimalAmountValue"
        maximal_amount:
          $ref: "#/components/schemas/periodicMaximalAmountValue"
      example: 
        {
          "currency": "EUR", 
          "amount": "123",
          "minimal_amount": "10",
          "maximal_amount": "100"
        }        

    currencyCode:
      description: |
        Payment currency for payment initiation.
        * sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
        * instant-sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
        * cross-border-credit-transfers : required. Please refer to documentation in the "flow" section of the portal to find the currencies accepted by Belfius.
      type: string
      pattern: '[A-Z]{3}'
      example: "EUR"

    currencyCodePeriodicPayment:
      description: |
        Payment currency for periodic payment initiation.
        * sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
      type: string
      pattern: '[A-Z]{3}'
      example: "EUR"
     
    accountCurrencyCode:
      description: |
        The currency of the account compartment the PSU wants to use.
        * sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
        * instant-sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
        * cross-border-credit-transfers : The currency of the account compartment the PSU wants to use. EUR is default if not provided.
      type: string
      pattern: '[A-Z]{3}'
      example: "EUR"

    accountCurrencyCodePeriodicPayment:
      description: |
        The currency of the account compartment the PSU wants to use for periodic payment initiation.
        * sepa-credit-transfers : MUST be EUR. EUR is default if not provided.
      type: string
      pattern: '[A-Z]{3}'
      example: "EUR"
      
    amountValue:
      description: |
        The amount given with fractional digits, where fractions must be compliant to the currency definition.
          The decimal separator is a dot.
        **Example:**
        Valid representations with up to two decimals are:
          * 1056
          * 5768.2
          * 5877.78
      type: string
      pattern: "-?[0-9]{1,13}(\\.[0-9]{1,2})?"
      example: "5877.78"

    periodicPaymentAmountValue:
      description: |
        Amount to be transferred. It is mandatory when periodic_payment_type is FIXED.
        The amount given with fractional digits, where fractions must be compliant to the currency definition.  The decimal separator is a dot.
        **Example:**
        Valid representations with up to two decimals are:
          * 1056
          * 5768.2
          * 5877.78
      type: string
      pattern: "-?[0-9]{1,13}(\\.[0-9]{1,2})?"
      example: "5877.78"
      
    periodicMinimalAmountValue:
      description: |
        Minimum amount to keep on the orderer account. It is only applicable if periodic_payment_type is VARIABLE. If neither minimal nor maximal amount is filled in, the entire amount present on the account will be transferred in case of variable standing order.
        The amount given with fractional digits, where fractions must be compliant to the currency definition.  The decimal separator is a dot.
        **Example:**
        Valid representations with up to two decimals are:
          * 1056
          * 5768.2
          * 5877.78
      type: string
      pattern: "-?[0-9]{1,13}(\\.[0-9]{1,2})?"
      example: "5877.78"
      
    periodicMaximalAmountValue:
      description: |
        Maximum amount to transfer to beneficiary account. It is only applicable if periodic_payment_type is VARIABLE. If neither minimal nor maximal amount is filled in, the entire amount present on the account will be transferred in case of variable standing order.
        The amount given with fractional digits, where fractions must be compliant to the currency definition.  The decimal separator is a dot.
        **Example:**
        Valid representations with up to two decimals are:
          * 1056
          * 5768.2
          * 5877.78
      type: string
      pattern: "-?[0-9]{1,13}(\\.[0-9]{1,2})?"
      example: "5877.78"
      
    countryCode:
      description: ISO 3166 ALPHA2 country code.
      type: string
      pattern: "[A-Z]{2}"
      example: "SE"
      
    creditorName:
      description: Creditor name.
      type: string
      maxLength: 70
      example: "Creditor Name"
      
    creditorAddress:
      description: |
        Creditor address.
        * sepa-credit-transfers : n/a.
        * instant-sepa-credit-transfers : n/a.
        * cross-border-credit-transfers : required.
      type: object
      required:
        - country
      properties:
        street:
          type: string
          maxLength: 70
        building_number:
          type: string
        city:
          type: string
        postal_code:
          type: string
        country:
          $ref: "#/components/schemas/countryCode"
      example: 
        {
          street: "rue blue",
          building_nmber: "89",
          city: "Paris",
          postal_code: "75000",
          country: "FR"
        }  

    creditorAddressPeriodicPayment:
      description: |
        Creditor address for periodic payment initiation.
        * sepa-credit-transfers : n/a.
      type: object
      required:
        - country
      properties:
        street:
          type: string
          maxLength: 70
        building_number:
          type: string
        city:
          type: string
        postal_code:
          type: string
        country:
          $ref: "#/components/schemas/countryCode"
      example: 
        {
          street: "rue blue",
          building_nmber: "89",
          city: "Paris",
          postal_code: "75000",
          country: "FR"
        }      

    purposeCode:
      description: |
        Reason of Payment.
         * sepa-credit-transfers : n/a.
         * instant-sepa-credit-transfers : n/a.
         * cross-border-credit-transfers : conditional. Please refer to documentation in the "flow" section of the portal for accepted purpose code.
      type: string
      
    executionDate:
      description: |
        Payment execution date. Sender may choose a specific future date on which payment has to be executed in ISO_8601 UTC date format [YYYY-MM-DD]. Default will be today or the next open business day.
        * sepa-credit-transfers - optional.
        * instant-sepa-credit-transfers - n/a.
        * cross-border-credit-transfers - optional.
      type: string
      format: date
      example: "2020-09-18"
 
    periodicPaymentStartDate:
      description: |
        Start date of the standing order. Sender may choose a specific date on which the first payment of the standing order has to be executed in ISO_8601 UTC date format [YYYY-MM-DD]. This date should be in the future. Default will be the next open business day.
        This date will also determine the recurring execution date for all frequencies other than "WEEKLY", e.g. if "2020-09-18" if used as start date with frequency "MONTHLY" the order will be executed on the 18th of each month (if open business day).
      type: string
      format: date
      example: "2020-09-18"     

    periodicPaymentEndDate:
      description: |
        End date of the standing order. Sender may choose a specific date on which the last payment of the standing order has to be executed in ISO_8601 UTC date format [YYYY-MM-DD]. This date should be in the future. Please refer to documentation in the "flow" section of the portal for more information on how to correctly use the end date.
      type: string
      format: date
      example: "2020-09-18"

    periodicPaymentFrequency:
      description: |
        Periodicity of the standing order.
      type: string
      enum:
        - "YEARLY"
        - "BIANNUAL"
        - "MONTHLY"
        - "BIMONTHLY"
        - "TRIMONTHLY"
        - "QUATERLY"
        - "WEEKLY"
      default: "MONTHLY"

    periodicPaymentDayOfExecution:
      description: |
        Day of execution of standing order. It is mandatory if frequency is WEEKLY.
      type: string
      enum:
        - "MONDAY"
        - "TUESDAY"
        - "WEDNESDAY"
        - "THURSDAY"
        - "FRIDAY"
      default: "MONDAY"
      
    endToEndIdentification:
      description: |
        The reference provided by the PISP when initiating the payment. It has to be unique with maximum length of 35 chars. It will be returned back in the response.
      type: string
      maxLength: 35
      example: "1232424kw54u1iu12o4141"
        
    instructionPriority:
      description: |
        Priority of Payment. Some of these offered services are paying services for the PSU. You can consult our website to know the exact charges due.
        * sepa-credit-transfers - optional.
        * instant-sepa-credit-transfers - n/a.
        * cross-border-credit-transfers - optional.
      type: string
      enum:
        - "NORMAL"
        - "URGENT"
      default: "NORMAL"
      
    psuName:
      description: |
        Name of the PSU who signed the payment.
      type: string
      example: "Francois Dupont"


    remittanceInformationStructured: 
      description: |
        Structured remittance information. Only Belgian structured is accepted.
        * sepa-credit-transfers : optional.
        * instant-sepa-credit-transfers : optional.
        * cross-border-credit-transfers : n/a.
      type: object
      required:
        - reference
        - reference_type
        - reference_issuer
      properties:
        reference:
          type: string
          minLength: 12
          maxLength: 12
        reference_type:
          type: string
          minLength: 4
          maxLength: 4
          enum:
            - SCOR
        reference_issuer:
          type: string
          minLength: 3
          maxLength: 3
          enum:
            - BBA

    remittanceInformationStructuredPeriodicPayment: 
      description: |
        Structured remittance information for periodic payment initiation. Only Belgian structured is accepted.
        * sepa-credit-transfers : optional.
      type: object
      required:
        - reference
        - reference_type
        - reference_issuer
      properties:
        reference:
          type: string
          minLength: 12
          maxLength: 12
        reference_type:
          type: string
          minLength: 4
          maxLength: 4
          enum:
            - SCOR
        reference_issuer:
          type: string
          minLength: 3
          maxLength: 3
          enum:
            - BBA

    remittanceInformationUnstructured:
      description: |
        Unstructured remittance information.
        * sepa-credit-transfers : optional.
        * instant-sepa-credit-transfers : optional.
        * cross-border-credit-transfers : conditional. Please refer to the ""flow"" section of the portal for countries where remittance information is required.
      type: string
      maxLength: 140
      example: "Ref Number Merchant"
      
    remittanceInformationUnstructuredPeriodicPayment:
      description: |
        Unstructured remittance information for periodic payment initiation.
        * sepa-credit-transfers : optional.
      type: string
      maxLength: 140
      example: "Ref Number Merchant"
      
    hrefType:
      description: Link to a resource.
      type: object
      properties:
        href:
          $ref: "#/components/schemas/hrefEntry"

    chargeBearer:
      description: |
        Conditional: Charge Bearer. ChargeBearerType1Code from ISO20022.
        * sepa-credit-transfers : n/a.
        * instant-sepa-credit-transfers : n/a.
        * cross-border-credit-transfers : required.
      type: string
      enum:
        - "DEBT"
        - "CRED"
        - "SHAR"
        
    hrefEntry:
      description: Link to a resource.
      type: string
      example: "/payments/sepa-credit-transfers/1234-wertiq-983"

    _linksPaymentInitiation: 
      description: |     
        * 'scaRedirect': 
          The link to which to redirect the PSU browser.
        * 'status': 
          The link to retrieve the transaction status of the payment initiation.
        * 'cancel': 
          The link to cancel the payment, provided it has not been confirmed yet.
      type: object
      additionalProperties: 
        $ref: "#/components/schemas/hrefType"
      properties:
        sca_redirect:
          $ref: "#/components/schemas/hrefType"
        status:
          $ref: "#/components/schemas/hrefType"
        cancel:
          $ref: "#/components/schemas/hrefType"
      example: 
        {
        "sca_redirect": {"href": "https://www.belfius.be/93874244uoiekrhethd/1234-wertiq-983"},
        "status": {"href": "/payments/sepa-credit-transfers/1234-wertiq-983/status"},
        "cancel": {"href": "/payments/sepa-credit-transfers/1234-wertiq-983"}
        }

    _linksBulkPaymentStatus: 
      description: |
        * 'payment_file_sca': 
          The link to which to redirect the PSU browser. The link will be provided only if validation of the bulk is completed and the bulk unsigned.
        * 'payment_file_cancel': 
          The link to cancel the payment bulk, provided it has not been confirmed yet.
      type: object
      properties:
        payment_file_sca:
          $ref: "#/components/schemas/hrefType"
        payment_file_cancel:
          $ref: "#/components/schemas/hrefType"
      example: 
        {
        "payment_file_sca": {"href": "https://www.belfius.be/93874244uoiekrhethd/1234-wertiq-983"},
        "payment_file_cancel": {"href": "/bulk-payments/{payment-product}/1234-wertiq-983/cancel"}
        }
        
    paymentFileStatus:
      description:  |
        The bulk status is filled with codes from the ISO 20022 data table. Belfius returns the following status
        - 'ACSP': 'AcceptedSettlementInProcess' - 
          Settlement in process.
        - 'RCVD': 'Received' - 
          Bulk payment initiation has been received by Belfius.
        - 'RJCT': 'Rejected' - 
          Bulk payment initiation has been rejected.
        - 'CANC': 'Cancelled' - 
          Bulk payment initiation has been cancelled before execution.
        - 'PATC': 'PartiallyAcceptedTechnical' - 
          Bulk payment initiation waiting for signature.
        - 'PDNG': 'Pending' - 
          Bulk payment initiation accepted after technical checks/signature, waiting to go to another status.
      type: string
      enum:
        - "ACSP"
        - "CANC"
        - "PATC"
        - "PDNG"
        - "RCVD"
        - "RJCT"
      example: "RCVD"
    
    bulkPaymentId:
      description:  |
        The bulk payment id
      type: string
      example: "452390"
    
    _linksBulkPaymentInitiation: 
      description: |
        * 'payment_file_status': 
          The link to retrieve the status of the bulk initiation.
        * 'payment_file_cancel': 
          The link to cancel the payment bulk, provided it has not been confirmed yet.
      type: object
      properties:
        payment_file_status:
          $ref: "#/components/schemas/hrefType"
        payment_file_cancel:
          $ref: "#/components/schemas/hrefType"
      example: 
        {
        "payment_file_status": {"href": "/bulk-payments/{payment-product}/1234-wertiq-983/status"},
        "payment_file_cancel": {"href": "/bulk-payments/{payment-product}/1234-wertiq-983/cancel"}
        }

    bulkPaymentList:
      description: |
       A list of payment bulk.
      type: array
      minItems: 1
      items:
        $ref: "#/components/schemas/bulkPayment"
        
    bulkPayment: 
      description: |
        Information about a payment bulk.
      type: object
      required:
        - internal_bulk_payment_id
        - bulk_payment_status
      properties:
        internal_bulk_payment_id:
          type: string
          example: "4000155153"
        bulk_payment_status:
          type: string
          example: "ACSP"

#####################################################
# Content of Request Bodies
#####################################################

    #####################################################
    # Content of Request Bodies - JSON
    #####################################################
    PaymentInitiationRequestPayload:
      description: |
        The PaymentInitiationRequest message is sent by the PISP to Belfius. It is used to request movement of funds from the debtor account to a creditor account.
      type: object
      required:
        - creditor_account
        - instructed_amount
        - creditor_name
        - endtoend_identification
      properties:
        debtor_account:
          $ref: "#/components/schemas/debtorAccountInformation"
        creditor_account:
         $ref: "#/components/schemas/creditorAccountInformation"
        instructed_amount:
         $ref: "#/components/schemas/amount"
        creditor_name:
          $ref: "#/components/schemas/creditorName"
        creditor_address:
          $ref: "#/components/schemas/creditorAddress"
        purpose_code:
          $ref: "#/components/schemas/purposeCode"          
        remittance_information_unstructured:
          $ref: "#/components/schemas/remittanceInformationUnstructured"
        remittance_information_structured:
          $ref: "#/components/schemas/remittanceInformationStructured"
        charge_bearer:
          $ref: "#/components/schemas/chargeBearer"
        requested_execution_date:
          $ref: "#/components/schemas/executionDate"
        endtoend_identification:
          $ref: "#/components/schemas/endToEndIdentification"
        instruction_priority:
          $ref: "#/components/schemas/instructionPriority"

    PeriodicPaymentInitiationRequestPayload:
      description: |
        The PaymentInitiationRequest message is sent by the PISP to Belfius. It is used to request periodic movements of funds from the debtor account to a creditor account.
      type: object
      required:
        - creditor_account
        - instructed_amount
        - creditor_name
        - endtoend_identification
        - start_date
        - frequency
      properties:
        debtor_account:
          $ref: "#/components/schemas/debtorAccountInformationPeriodicPayment"
        creditor_account:
         $ref: "#/components/schemas/creditorAccountInformationPeriodicPayment"
        periodic_payment_type:
         $ref: "#/components/schemas/periodicPaymentType"
        instructed_amount:
          $ref: "#/components/schemas/periodicPaymentAmount"
        creditor_name:
          $ref: "#/components/schemas/creditorName"
        creditor_address:
          $ref: "#/components/schemas/creditorAddressPeriodicPayment"
        remittance_information_unstructured:
          $ref: "#/components/schemas/remittanceInformationUnstructuredPeriodicPayment"
        remittance_information_structured:
          $ref: "#/components/schemas/remittanceInformationStructuredPeriodicPayment"
        endtoend_identification:
          $ref: "#/components/schemas/endToEndIdentification"
        start_date:
          $ref: "#/components/schemas/periodicPaymentStartDate"
        end_date:
          $ref: "#/components/schemas/periodicPaymentEndDate"
        frequency:
          $ref: "#/components/schemas/periodicPaymentFrequency"
        day_of_execution:
          $ref: "#/components/schemas/periodicPaymentDayOfExecution"

    #####################################################
    # Content of Request Bodies - XML
    #####################################################

      #####################################################
      # Content of Request Bodies - Single Part
      #####################################################

    paymentInitiationSct_pain.001: #The same schemas are used for single or bulk payment in case of a pain.001
      description: |
        A pain.001 structure corresponding to the SCT schema.
        urn:iso:std:iso:20022:tech:xsd:pain.001.001.03
      type: string
      example:
        <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
          <CstmrCdtTrfInitn>
            <GrpHdr>
              <MsgId>MIPI-123456789RI-123456789</MsgId>
              <CreDtTm>2017-02-14T20:23:34.000Z</CreDtTm>
              <NbOfTxs>1</NbOfTxs>
              <CtrlSum>123</CtrlSum>
              <InitgPty>
                <Nm>PaymentInitiator</Nm>
                <Id><OrgId><Othr><Id>DE10000000012</Id>
                  <SchmeNm><Prptry>PISP</Prptry></SchmeNm></Othr></OrgId></Id>
              </InitgPty>
            </GrpHdr> 
            <PmtInf> 
              <PmtInfId>BIPI-123456789RI-123456789</PmtInfId>
              <PmtMtd>TRF</PmtMtd> 
              <NbOfTxs>1</NbOfTxs>
              <CtrlSum>123</CtrlSum>
              <PmtTpInf><SvcLvl><Cd>SEPA</Cd></SvcLvl></PmtTpInf>
              <ReqdExctnDt>2017-02-15</ReqdExctnDt>
              <Dbtr><Nm>PSU Name</Nm></Dbtr>
              <DbtrAcct><Id><IBAN>DE87200500001234567890</IBAN></Id></DbtrAcct>
              <ChrgBr>SLEV</ChrgBr>
              <CdtTrfTxInf>
                <PmtId><EndToEndId>RI-123456789</EndToEndId></PmtId> 
                <Amt><InstdAmt Ccy="EUR">123</InstdAmt></Amt>
                <Cdtr><Nm>Merchant123</Nm></Cdtr>
                <CdtrAcct><Id><IBAN> DE23100120020123456789</IBAN></Id></CdtrAcct>
                <RmtInf><Ustrd>Ref Number Merchant-123456</Ustrd></RmtInf>
              </CdtTrfTxInf>
            </PmtInf>
          </CstmrCdtTrfInitn>
        </Document>


#####################################################
# Content of Response Bodies
#####################################################
      
    PaymentDetailsResponse:
      description: |
        Body of the response for a successful payment detail request.
      type: object
      required:
        - debtor_account
        - creditor_account
        - instructed_amount
        - creditor_name
        - endtoend_identification
      properties:
        debtor_account:
          $ref: "#/components/schemas/debtorAccountInformation"
        creditor_account:
         $ref: "#/components/schemas/creditorAccountInformation"
        instructed_amount:
         $ref: "#/components/schemas/amount"
        creditor_name:
          $ref: "#/components/schemas/creditorName"
        creditor_address:
          $ref: "#/components/schemas/creditorAddress"
        purpose_code:
          $ref: "#/components/schemas/purposeCode"          
        remittance_information_unstructured:
          $ref: "#/components/schemas/remittanceInformationUnstructured"
        remittance_information_structured:
          $ref: "#/components/schemas/remittanceInformationStructured"
        charge_bearer:
          $ref: "#/components/schemas/chargeBearer"
        requested_execution_date:
          $ref: "#/components/schemas/executionDate"
        endtoend_identification:
          $ref: "#/components/schemas/endToEndIdentification"
        instruction_priority:
          $ref: "#/components/schemas/instructionPriority"
        psu_name:
          $ref: "#/components/schemas/psuName"
          
    PeriodicPaymentDetailsResponse:
      description: |
        The PaymentInitiationRequest message is sent by the PISP to Belfius. It is used to request periodic movements of funds from the debtor account to a creditor account.
      type: object
      required:
        - creditor_account
        - instructed_amount
        - creditor_name
        - endtoend_identification
        - start_date
        - frequency
      properties:
        debtor_account:
          $ref: "#/components/schemas/debtorAccountInformationPeriodicPayment"
        creditor_account:
         $ref: "#/components/schemas/creditorAccountInformationPeriodicPayment"
        periodic_payment_type:
         $ref: "#/components/schemas/periodicPaymentType"
        instructed_amount:
          $ref: "#/components/schemas/periodicPaymentAmount"
        creditor_name:
          $ref: "#/components/schemas/creditorName"
        creditor_address:
          $ref: "#/components/schemas/creditorAddressPeriodicPayment"
        remittance_information_unstructured:
          $ref: "#/components/schemas/remittanceInformationUnstructuredPeriodicPayment"
        remittance_information_structured:
          $ref: "#/components/schemas/remittanceInformationStructuredPeriodicPayment"
        endtoend_identification:
          $ref: "#/components/schemas/endToEndIdentification"
        start_date:
          $ref: "#/components/schemas/periodicPaymentStartDate"
        end_date:
          $ref: "#/components/schemas/periodicPaymentEndDate"
        frequency:
          $ref: "#/components/schemas/periodicPaymentFrequency"
        day_of_execution:
          $ref: "#/components/schemas/periodicPaymentDayOfExecution"
    
    PaymentInitiationStatusResponse:
      description: Body of the response for a successful payment initiation status request.
      type: object
      required:
        - transaction_status
      properties:
        transaction_status:
          $ref: "#/components/schemas/transactionStatus"

    PeriodicPaymentInitiationStatusResponse:
      description: Body of the response for a successful periodic payment initiation status request.
      type: object
      required:
        - transaction_status
      properties:
        transaction_status:
          $ref: "#/components/schemas/transactionStatusPeriodicPayment"

    BulkPaymentInitiationStatusResponse:
      description: Body of the response for a successful bulk payment initiation status request. If the file is validated and unsigned, a redirection url will be present in the response. Please check in the url links 'payment_file_sca'.
      type: object
      required:
        - payment_file_status
      properties:
        payment_file_status:
          $ref: "#/components/schemas/paymentFileStatus"
        bulk_payment_id:
          $ref: "#/components/schemas/bulkPaymentId"
        bulk_payment_list:
          $ref: "#/components/schemas/bulkPaymentList"
        _links:
          $ref: "#/components/schemas/_linksBulkPaymentStatus"

    PaymentInitiationResponse:
      description: Body of the response for a successful payment initiation request.
      type: object
      required:
        - transaction_status
        - payment-id
        - _links
      properties:
        transaction_status:
          $ref: "#/components/schemas/transactionStatus"
        payment-id:
           description: The reference provided by Belfius in the response of the post payment API.
           type: string
           example: "1234-wertiq-983"
        endtoend_identification:
           description: The reference provided by the PISP when initiating the payment (if provided during initiation).
           type: string
           example: "1234-wertiq-983"
        _links:
          $ref: "#/components/schemas/_linksPaymentInitiation"

    BulkPaymentInitiationResponse:
      description: Body of the response for a successful bulk payment initiation request.
      type: object
      required:
        - payment_file_status
        - payment_file_id
        - _links
      properties:
        payment_file_status:
          $ref: "#/components/schemas/paymentFileStatus"
        payment_file_id:
           description: The reference provided by Belfius in the response of the post payment API.
           type: string
           example: "1234-wertiq-983"
        endtoend_identification:
           description: The reference provided by the PISP when initiating the payment (if provided during initiation).
           type: string
           example: "1234-wertiq-983"
        _links:
          $ref: "#/components/schemas/_linksBulkPaymentInitiation"


#####################################################
# _links
#####################################################


#####################################################
# Messages to Communicate Error Information
#####################################################

    ErrorModel:
      properties:
        error:
          type: string
          description: Fixed-form error tokens mapping to specific errors.
        error_code:
          type: string
          description: Error specific code, could be used directly by consumer's software.
        error_description:
          type: string
          description: Full description of the error.


  #####################################################
  # Generic Elements
  #####################################################


  parameters:
  #####################################################
  # Predefined Parameters
  #####################################################

    Authorization:
      name: Authorization
      in: header
      description: |
        The access token. Note that access-token is limited to a given type of request [here PIS]. The token itself should be passed as bearer token in Authorization header, like: "Bearer 987tghjkiu6trfghjuytrghj".
      required: true
      example: "Bearer 987tghjkiu6trfghjuytrghj"
      schema:
        type: string

    Authorization_optional:
      name: Authorization
      in: header
      description: |
        The access token. Scope of this access-token is limited to a given type of request [here PIS]. The token itself should be passed as bearer token in Authorization header, like: "Bearer 987tghjkiu6trfghjuytrghj".
      example: "Bearer 987tghjkiu6trfghjuytrghj"
      schema:
        type: string

    Request-ID:
      name: Request-ID
      in: header
      description: |
        ID of the request. Must be unique. It has to be a valid UUID in V04 format.
      required: true
      example: "99391c7e-ad88-49ec-a2ad-99ddcb1f7721"
      schema:
        type: string
        format: uuid
            
    Accept:
      name: Accept
      in: header
      description: |
        It must be of type application/json including the API version number. [Accept:application/vnd.belfius.api+json; version=1].
      required: true
      example: "application/vnd.belfius.api+json; version=1"
      schema:
        type: string

    Accept_v2:
      name: Accept
      in: header
      description: |
        It must be of type application/json including the API version number. [Accept:application/vnd.belfius.api+json; version=2].
      required: true
      example: "application/vnd.belfius.api+json; version=2"
      schema:
        type: string
        
    Accept_v3:
      name: Accept
      in: header
      description: |
        It must be of type application/json including the API version number. [Accept:application/vnd.belfius.api+json; version=3].
      required: true
      example: "application/vnd.belfius.api+json; version=3"
      schema:
        type: string

    Accept-Language:
      name: Accept-Language
      in: header
      description: |
        Language. It can include language in ISO 639-1 format [example: fr]. Note that during redirection, Belfius screens are only available in French (fr) and Dutch (nl).
      required: true
      example: "fr"
      schema:
        type: string

    Content-Type:
      name: Content-Type
      in: header
      description: |
        It should be application/json.
      required: true
      example: "application/json"
      schema:
        type: string

    Content-Type-XML:
      name: Content-Type
      in: header
      description: |
        It should be application/xml.
      required: true
      example: "application/xml"
      schema:
        type: string

    Content-Type-XML-CSV:
      name: Content-Type
      in: header
      description: |
        It should be application/xml (for XML based payload) or text/csv (for CSV based payload).
      required: true
      example: "application/xml"
      schema:
        type: string
        
    Signature:
      name: Signature
      in: header
      description: |
        Signature of the request created by the PISP using its QSeal certificate (draft-cavage-http-signatures-10). Please see the docs for more details.
      required: true
      schema:
        type: string

    Digest:
      name: Digest
      in: header
      description: |
        SHA256 of the body (draft-cavage-http-signatures-10). Please see the docs for more details.
      required: true
      schema:
        type: string

    Date:
      name: Date
      in: header
      description: |
        Current date in HTTP Date RFC format (https://tools.ietf.org/html/rfc7231#section-7.1.1.2). We will tolerate a drift of +-1 minutes. Please note that drift is the allowed difference between the exact time when the call was received at Belfiusâ€™ side, and the content of DATE header. If the DATE headers' time value differs by more than +-1 minute, request will be considered as Invalid.
      required: true
      example: "Tue, 15 Nov 1994 08:12:31 GMT"
      schema:
        type: string

    Client-ID:
      name: Client-ID
      in: header
      description: |
        Client ID of registered PISP received after the onboarding.
      required: true
      example: "l7957ffbdbcbf4496a8a406702aacbf539"
      schema:
        type: string

    Redirect-URI:
      name: Redirect-URI
      in: header
      description: |
        Redirect-URI from the PISP. URI to which Belfius will redirect the PSU after redirection in Belfius environment. 
      required: true
      example: "https://www.clientapp.com/someurrl"
      schema:
        type: string
        
    Code-Challenge-Method:
      name: Code-Challenge-Method
      in: header
      description: |
        PKCE code-challenge-method as per RFC https://tools.ietf.org/html/rfc7636.
      required: true
      schema:
        type: string

    Code-Challenge:
      name: Code-Challenge
      in: header
      description: |
        PKCE code-challenge as per RFC https://tools.ietf.org/html/rfc7636.
      required: true
      schema:
        type: string

    paymentIdType:
      name: payment-id-type
      in: query
      description: |
        Type of Payment ID. 
        Following Types are supported:
           - INTERNAL: Usage of the reference provided by Belfius in the response of the post payment API.
           - EXTERNAL: Usage of the reference provided by the PISP when initiating the payment.
      required: false
      example: 
      schema:
        type: string
        enum:
          - "INTERNAL"
          - "EXTERNAL"
        default: "INTERNAL"  
        
    paymentService:
      name: payment-service
      in: path
      description: |
        Payment service:
        Possible values are:
        * payments
      required: true
      schema:
        type: string
        enum:
          - "payments"
 
    paymentProduct:
      name: payment-product
      in: path
      description: |
        The single payment products. 
        The following **payment products** are supported:
          - sepa-credit-transfers
          - instant-sepa-credit-transfers
          - cross-border-credit-transfers
      required: true
      schema:
        type: string 
        enum:
          - "sepa-credit-transfers"
          - "instant-sepa-credit-transfers"
          - "cross-border-credit-transfers"

    periodicPaymentProduct:
      name: payment-product
      in: path
      description: |
        The periodic payment products.
        The following payment products are supported:
          - sepa-credit-transfers
      required: true
      schema:
        type: string 
        enum:
          - "sepa-credit-transfers"

    bulkPaymentProduct:
      name: bulk-payment-product
      in: path
      description: |
        The bulk payment products
        The following payment products are supported:
          - "pain.001"
          - "csv"
      required: true
      schema:
        type: string 
        enum:
          - "pain.001"
          - "csv"
              
    paymentProduct_cancel:
      name: payment-product
      in: path
      description: |
        The single payment products.
        The following payment products are supported:
          - sepa-credit-transfers
          - instant-sepa-credit-transfers
      required: true
      schema:
        type: string 
        enum:
          - "sepa-credit-transfers"
          - "instant-sepa-credit-transfers"

    periodicPaymentProduct_cancel:
      name: payment-product
      in: path
      description: |
        The periodic payment products.
        The following payment products are supported:
          - sepa-credit-transfers
      required: true
      schema:
        type: string 
        enum:
          - "sepa-credit-transfers"
              
    paymentId:
      name: payment-id
      in: path
      description: Payment reference.
      required: true
      schema:
        type: string
      example: "1234-wertiq-983"

    endToEndIdentification:
      name: payment-id
      in: path
      description: The reference provided by the PISP when initiating the payment.
      required: true
      schema:
        type: string
      example: "1234-wertiq-983"

    PaymentInformationID:
      name: Payment-Information-ID
      in: header
      description: |
        The reference provided by the PISP when initiating the bulk payment. 
        It has to be unique with maximum length of 35 chars. It will be returned back in the response.
      required: true
      schema:
        type: string
        maxLength: 35
      example: "12345-id"

    paymentFileId:
      name: payment-file-id
      in: path
      description: Payment file reference provided by Belfius.
      required: true
      schema:
            type: string
      example: "1234-wertiq-983"

    paymentFileIdType:
      name: payment-file-id-type
      in: query
      description: |
        Type of Payment file reference. 
        Following Types are supported:
          - INTERNAL: Usage of the reference provided by Belfius in the response of the post bulk payment API.
          - EXTERNAL: Usage of the external transaction reference provided by the PISP when initiating the bulk payment.
      required: false
      example: 
      schema:
        type: string
        enum:
          - "INTERNAL"
          - "EXTERNAL"
        default: "INTERNAL"  
      
  requestBodies:
  #####################################################
  # Reusable Request Bodies
  #####################################################

    PaymentInitiation:
      description: Request body for a payment initiation request message.
      required: true
      content:
       application/json:
        schema:
          $ref: "#/components/schemas/PaymentInitiationRequestPayload"

    PeriodicPaymentInitiation:
      description: Request body for a periodic payment initiation request message.
      required: true
      content:
       application/json:
        schema:
          $ref: "#/components/schemas/PeriodicPaymentInitiationRequestPayload"

    BulkPaymentInitiation:
      description: Request body for a bulk payment initiation request message.
      required: true
      content:
       application/xml:
        schema:
          $ref: "#/components/schemas/paymentInitiationSct_pain.001"
       text/csv: 
          {} #### Must follow the template as provided by Belfius.

  responses:
  #####################################################
  # Reusabale Responses
  #####################################################
    #####################################################
    # Positive Responses
    #####################################################

    OK_200_PaymentDetails:
      description: OK
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/PaymentDetailsResponse"
            
    OK_200_PeriodicPaymentDetails:
      description: OK
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/PeriodicPaymentDetailsResponse"

    
    OK_200_PaymentInitiationStatus:
      description: OK
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/PaymentInitiationStatusResponse"
          examples:
            simple:
              $ref: "#/components/examples/paymentInitiationStatusResponse_Simple"
            extended:
              $ref: "#/components/examples/paymentInitiationStatusResponse_Extended"

 
    OK_200_PeriodicPaymentInitiationStatus:
      description: OK
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/PeriodicPaymentInitiationStatusResponse"
          examples:
            simple:
              $ref: "#/components/examples/periodicPaymentInitiationStatusResponse_Simple"
            extended:
              $ref: "#/components/examples/periodicPaymentInitiationStatusResponse_Extended"

 
    OK_200_BulkPaymentInitiationStatus:
      description: OK
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/BulkPaymentInitiationStatusResponse"


    OK_201_PaymentInitiation:        
      description: |
        RECEIVED Payment request has been successfully received. PSU has to sign the payment initiation (via redirection) for the payment to be executed. Please check the url links.
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/PaymentInitiationResponse"
          examples:
            signing_required:
              $ref: "#/components/examples/paymentInitiationResponse_SigningRequired"
            no_signing_required:
              $ref: "#/components/examples/paymentInitiationResponse_NoSigningRequired"

    NO_CONTENT_204_PaymentCancel:
      description:  |
        Payment cancellation request has been successfully received and will be executed in future. No action required from the Sender.
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      #NO RESPONSE BODY

    OK_201_BulkPaymentInitiation:        
      description: |
        RECEIVED Payment request has been successfully received. Belfius is currently validating the bulk. PSU will have to sign the payment initiation (via redirection) for the bulk payment to be executed after validation. Please call the get status API and check the status url links.
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
       application/json:
          schema:
            $ref: "#/components/schemas/BulkPaymentInitiationResponse"


    #####################################################
    # Negative Responses
    #####################################################

    BAD_REQUEST_400:
      description: Bad Request
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    UNAUTHORIZED_401:
      description: Unauthorized / authentification failure
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    FORBIDDEN_403:
      description: Forbidden
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    NOT_FOUND_404:
      description: Not found
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    METHOD_NOT_ALLOWED_405:
      description: Method Not Allowed
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    NOT_ACCEPTABLE_406:
      description: Not Acceptable
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    REQUEST_TIMEOUT_408: 
      description: Request Timeout
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    UNSUPPORTED_MEDIA_TYPE_415:
      description: Unsupported Media Type
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    TOO_MANY_REQUESTS_429:
      description: Too Many Requests
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"
      
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    CONFLICT_409:
      description: Conflict
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 
              
    SSL_CERTIFICATE_ERROR_495:
      description: SSL certificate error. Mutual TLS cannot be established. It may occur when an unregistered TPP or a PISP with an invalid/expired certificate is trying to access the APIs.
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 

    INTERNAL_SERVER_ERROR_500:
      description: Internal Server Error
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 
 
    SERVICE_UNAVAILABLE_503:
      description: Service Unavailable
      
      headers:
        Response-ID:
          $ref: "#/components/headers/Response-ID"

      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorModel" 



  examples:
  #####################################################
  # Predefined Examples
  #####################################################
    
    paymentInitiationStatusResponse_Simple:
      value:
        { 
        "transaction_status": "RCVD"
        }
        
    paymentInitiationStatusResponse_Extended:
      value: 
        { 
          "transaction_status": "RCVD",
          "sca-status": "received"
        }

    periodicPaymentInitiationStatusResponse_Simple:
      value:
        { 
        "transaction_status": "RCVD"
        }
        
    periodicPaymentInitiationStatusResponse_Extended:
      value: 
        { 
          "transaction_status": "RCVD",
          "sca-status": "received"
        }
        
    paymentInitiationResponse_SigningRequired:
      value: 
        { 
          "transaction_status": "PATC",
          "paymentId": "1234-wertiq-983",
          "_links": {"sca_redirect": {"href": "https://belfius.be/7hgiey6574/1234-wertiq-983"}}
        }
     
    paymentInitiationResponse_NoSigningRequired:
      value: 
        { 
          "transaction_status": "RCVD",
          "paymentId": "1234-wertiq-983",
          "_links": {
            "status": {"href": "/payments/sepa-credit-transfers/1234-wertiq-983/status"}, 
            "cancel": {"href": "/payments/sepa-credit-transfers/1234-wertiq-983/cancel"}
          }  
        }