openapi: "3.0.0"
info:
  title: "PaymentInitiationAPI"
  description: "Swagger for Payment Initiation API Specification"
  version: "v3.1"

servers:
- url: "/open-banking/{version}/pisp"
paths:
  /payment-consents:
    post:
      tags:
        - "Payments"
      summary: "Create Payment Consents"
      operationId: "CreatePaymentConsents"
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/authorization"
        - $ref: "#/components/parameters/x-idempotency-key"
      requestBody:
        content:
          application/json; charset=utf-8:
            schema:
              $ref: "#/components/schemas/obWriteConsent4"
          application/json:
            schema:
              $ref: "#/components/schemas/obWriteConsent4"
          application/jose+jwe:
            schema:
              $ref: "#/components/schemas/obWriteConsent4"
        description: "Default"
        required: true
      responses:
        201:
          $ref: "#/components/responses/201PaymentConsentsCreated"
        400:
          $ref: "#/components/responses/400Error"
        401:
          $ref: "#/components/responses/401Error"
        403:
          $ref: "#/components/responses/403Error"
        405:
          $ref: "#/components/responses/405Error"
        406:
          $ref: "#/components/responses/406Error"
        415:
          $ref: "#/components/responses/415Error"
        429:
          $ref: "#/components/responses/429Error"
        500:
          $ref: "#/components/responses/500Error"
      security:
        - TPPOAuth2Security:
            - "payments"
        - default:
            - "payments"
      x-auth-type: "Application"
      x-throttling-tier: "Unlimited"
      x-scope: "payments"
  
  /payment-consents/{consentId}:
    get:
      tags:
        - "Payments"
      summary: "Get Payment Consents"
      operationId: "GetPaymentConsentsConsentId"
      parameters:
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/authorization"
      responses:
        200:
          $ref: "#/components/responses/200PaymentConsentsConsentIdRead"
        400:
          $ref: "#/components/responses/400Error"
        401:
          $ref: "#/components/responses/401Error"
        403:
          $ref: "#/components/responses/403Error"
        405:
          $ref: "#/components/responses/405Error"
        406:
          $ref: "#/components/responses/406Error"
        429:
          $ref: "#/components/responses/429Error"
        500:
          $ref: "#/components/responses/500Error"
      security:
        - TPPOAuth2Security:
            - "payments"
        - default:
            - "payments"
      x-auth-type: "Application"
      x-throttling-tier: "Unlimited"
      x-scope: "payments"   
      
  /payment-consents/{consentId}/funds-confirmation:
    get:
      tags:
        - "Payments"
      summary: "Get Payment Consents Funds Confirmation"
      operationId: "GetPaymentConsentsConsentIdFundsConfirmation"
      parameters:
        - $ref: "#/components/parameters/consentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/authorization"
      responses:
        200:
          $ref: "#/components/responses/200PaymentConsentsConsentIdFundsConfirmationRead"
        400:
          $ref: "#/components/responses/400Error"
        401:
          $ref: "#/components/responses/401Error"
        403:
          $ref: "#/components/responses/403Error"
        405:
          $ref: "#/components/responses/405Error"
        406:
          $ref: "#/components/responses/406Error"
        429:
          $ref: "#/components/responses/429Error"
        500:
          $ref: "#/components/responses/500Error"
      security:
        - PSUOAuth2Security:
            - "payments"
        - default:
            - "payments"
      x-auth-type: "Application User"
      x-throttling-tier: "Unlimited"
      x-scope: "payments"    
      
  /payments:
    post:
      tags:
        - "Payments"
      summary: "Create Payments"
      operationId: "CreatePayments"
      parameters:
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/authorization"
        - $ref: "#/components/parameters/x-idempotency-key"
      requestBody:
        content:
          application/json; charset=utf-8:
            schema:
              $ref: "#/components/schemas/obWritePayment2"
          application/json:
            schema:
              $ref: "#/components/schemas/obWritePayment2"
          application/jose+jwe:
            schema:
              $ref: "#/components/schemas/obWritePayment2"
        description: "Default"
        required: true
      responses:
        201:
          $ref: "#/components/responses/201PaymentsCreated"
        400:
          $ref: "#/components/responses/400Error"
        401:
          $ref: "#/components/responses/401Error"
        403:
          $ref: "#/components/responses/403Error"
        405:
          $ref: "#/components/responses/405Error"
        406:
          $ref: "#/components/responses/406Error"
        415:
          $ref: "#/components/responses/415Error"
        429:
          $ref: "#/components/responses/429Error"
        500:
          $ref: "#/components/responses/500Error"
      security:
        - PSUOAuth2Security:
            - "payments"
        - default:
            - "payments"
      x-auth-type: "Application User"
      x-throttling-tier: "Unlimited"
      x-scope: "payments"  
      
  /payments/{paymentId}:
    get:
      tags:
        - "Payments"
      summary: "Get Payments"
      operationId: "GetPaymentsPaymentId"
      parameters:
        - $ref: "#/components/parameters/paymentId"
        - $ref: "#/components/parameters/x-fapi-auth-date"
        - $ref: "#/components/parameters/x-fapi-customer-ip-address"
        - $ref: "#/components/parameters/x-fapi-interaction-id"
        - $ref: "#/components/parameters/authorization"
      responses:
        200:
          $ref: "#/components/responses/200PaymentsPaymentIdRead"
        400:
          $ref: "#/components/responses/400Error"
        401:
          $ref: "#/components/responses/401Error"
        403:
          $ref: "#/components/responses/403Error"
        405:
          $ref: "#/components/responses/405Error"
        406:
          $ref: "#/components/responses/406Error"
        429:
          $ref: "#/components/responses/429Error"
        500:
          $ref: "#/components/responses/500Error"
      security:
        - TPPOAuth2Security:
            - "payments"
        - default:
            - "payments"
      x-auth-type: "Application"
      x-throttling-tier: "Unlimited"
      x-scope: "payments"    
      
components:
  parameters:
  
    consentId:
      name: "consentId"
      in: "path"
      description: "ConsentId"
      required: true
      schema:
        type: "string"
        
    paymentId:
      name: "paymentId"
      in: "path"
      description: "PaymentId"
      required: true
      schema:
        type: "string"    
        
    x-fapi-auth-date:
      in: "header"
      name: "x-fapi-auth-date"
      required: false
      description: "The time when the PSU last logged in with the TPP. \nAll dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below: \nSun, 10 Sep 2017 19:43:31 UTC"
      schema:
        type: "string"
        pattern: "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} (GMT|UTC)$"
        
    x-fapi-customer-ip-address:
      in: "header"
      name: "x-fapi-customer-ip-address"
      required: false
      description: "The PSU's IP address if the PSU is currently logged in with the TPP."
      schema:
        type: "string"    
        
    x-fapi-interaction-id:
      in: "header"
      name: "x-fapi-interaction-id"
      required: false
      description: "An RFC4122 UID used as a correlation id."
      schema:
        type: "string"   
        
    authorization:
      in: "header"
      name: "authorization"
      required: true
      description: "An Authorisation Token as per https://tools.ietf.org/html/rfc6750"
      schema:
        type: "string"    
        
    x-idempotency-key:
      name: "x-idempotency-key"
      in: "header"
      description: "Every request will be processed only once per x-idempotency-key.  The\nIdempotency Key will be valid for 24 hours.\n"
      required: true
      schema:
        type: "string"
        maxLength: 40
        pattern: "^(?!\\s)(.*)(\\S)$"    

  responses:
  
    201PaymentsCreated:
      description: "Payments Created"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"
        application/json:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"
            
    200PaymentsPaymentIdRead:
      description: "Payments Read"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"
        application/json:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obWritePaymentResponse5"        
            
    200PaymentConsentsConsentIdRead:
      description: "Payment Consents Read"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"
        application/json:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"
    
    200PaymentConsentsConsentIdFundsConfirmationRead:
      description: "Payment Consents Read"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obWriteFundsConfirmationResponse1"
        application/json:
          schema:
            $ref: "#/components/schemas/obWriteFundsConfirmationResponse1"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obWriteFundsConfirmationResponse1"
            
    201PaymentConsentsCreated:
      description: "Payment Consents Created"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"
        application/json:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obWritePaymentConsentResponse5"    
            
    400Error:
      description: "Bad request"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/json:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
    401Error:
      description: "Unauthorized"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    403Error:
      description: "Forbidden"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/json:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
    404Error:
      description: "Not found"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    405Error:
      description: "Method Not Allowed"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    406Error:
      description: "Not Acceptable"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    415Error:
      description: "Unsupported Media Type"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    429Error:
      description: "Too Many Requests"
      headers:
        Retry-After:
          description: "Number in seconds to wait"
          schema:
            type: "integer"
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
    500Error:
      description: "Internal Server Error"
      headers:
        x-fapi-interaction-id:
          description: "An RFC4122 UID used as a correlation id."
          required: true
          schema:
            type: "string"
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/json:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"
        application/jose+jwe:
          schema:
            $ref: "#/components/schemas/obErrorResponse1"    
            
  securitySchemes:
    TPPOAuth2Security:
      type: "oauth2"
      description: "TPP client credential authorisation flow with the ASPSP"
      flows:
        clientCredentials:
          tokenUrl: "https://authserver.example/token"
          scopes:
            payments: "Generic payment scope"
            
    PSUOAuth2Security:
      type: "oauth2"
      description: "OAuth flow, it is required when the PSU needs to perform SCA with the ASPSP when a TPP wants to access an ASPSP resource owned by the PSU"
      flows:
        authorizationCode:
          authorizationUrl: "https://authserver.example/authorization"
          tokenUrl: "https://authserver.example/token"
          scopes:
            payments: "Generic payment scope"        
  
    default:
      type: "oauth2"
      flows:
        implicit:
          authorizationUrl: "https://test.com"
          scopes:
            payments: "Ge neric payment scope"
          x-scopes-bindings:
            payments: "Internal/subscriber"          
        
  schemas:      
  
    secondaryIdentification:
      description: "This is secondary identification of the account, as assigned by the account servicing institution. \nThis can be used by building societies to additionally identify accounts with a roll number (in addition to a sort code and account number combination)."
      type: "string"
      minLength: 1
      maxLength: 34
  
    activeOrHistoricCurrencyCode:
      description: "A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 \"Codes for the representation of currencies and funds\"."
      type: "string"
      pattern: "^[A-Z]{3,3}$"
 
    isoDateTime:
      description: "All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
      type: "string"
      format: "date-time"  
      
    meta:
      title: "MetaData"
      type: "object"
      additionalProperties: false
      description: "Meta Data relevant to the payload"
      properties:
        TotalPages:
          type: "integer"
          format: "int32"
        FirstAvailableDateTime:
          $ref: "#/components/schemas/isoDateTime"
        LastAvailableDateTime:
          $ref: "#/components/schemas/isoDateTime"  
      
    obActiveCurrencyAndAmount_SimpleType:
      description: "A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217."
      type: "string"
      pattern: "^\\d{1,13}$|^\\d{1,13}\\.\\d{1,5}$"   
      
    obError1:
      type: "object"
      additionalProperties: false
      properties:
        ErrorCode:
          description: "Low level textual error code, e.g., UK.OBIE.Field.Missing"
          type: "string"
          x-namespaced-enum:
            - "UK.OBIE.Field.Expected"
            - "UK.OBIE.Field.Invalid"
            - "UK.OBIE.Field.InvalidDate"
            - "UK.OBIE.Field.Missing"
            - "UK.OBIE.Field.Unexpected"
            - "UK.OBIE.Header.Invalid"
            - "UK.OBIE.Header.Missing"
            - "UK.OBIE.Reauthenticate"
            - "UK.OBIE.Resource.ConsentMismatch"
            - "UK.OBIE.Resource.InvalidConsentStatus"
            - "UK.OBIE.Resource.InvalidFormat"
            - "UK.OBIE.Resource.NotFound"
            - "UK.OBIE.Rules.AfterCutOffDateTime"
            - "UK.OBIE.Rules.DuplicateReference"
            - "UK.OBIE.Signature.Invalid"
            - "UK.OBIE.Signature.InvalidClaim"
            - "UK.OBIE.Signature.Malformed"
            - "UK.OBIE.Signature.Missing"
            - "UK.OBIE.Signature.MissingClaim"
            - "UK.OBIE.Signature.Unexpected"
            - "UK.OBIE.UnexpectedError"
            - "UK.OBIE.Unsupported.AccountIdentifier"
            - "UK.OBIE.Unsupported.AccountSecondaryIdentifier"
            - "UK.OBIE.Unsupported.Currency"
            - "UK.OBIE.Unsupported.Frequency"
            - "UK.OBIE.Unsupported.LocalInstrument"
            - "UK.OBIE.Unsupported.Scheme"
        Message:
          description: "A description of the error that occurred. e.g., 'A mandatory field isn't supplied' or 'RequestedExecutionDateTime must be in future'\nOBIE doesn't standardise this field"
          type: "string"
          minLength: 1
          maxLength: 500
        Path:
          description: "Recommended but optional reference to the JSON Path of the field with error, e.g., Data.Initiation.InstructedAmount.Currency"
          type: "string"
          minLength: 1
          maxLength: 500
        Url:
          description: "URL to help remediate the problem, or provide more information, or to API Reference, or help etc"
          type: "string"
      required:
        - "ErrorCode"
        - "Message"
      minProperties: 1  
      
    obErrorResponse1:
      description: "An array of detail error codes, and messages, and URLs to documentation to help remediation."
      type: "object"
      additionalProperties: false
      properties:
        Code:
          description: "High level textual error code, to help categorize the errors."
          type: "string"
          minLength: 1
          maxLength: 40
        Id:
          description: "A unique reference for the error instance, for audit purposes, in case of unknown/unclassified errors."
          type: "string"
          minLength: 1
          maxLength: 40
        Message:
          description: "Brief Error message, e.g., 'There is something wrong with the request parameters provided'"
          type: "string"
          minLength: 1
          maxLength: 500
        Errors:
          items:
            $ref: "#/components/schemas/obError1"
          type: "array"
          minItems: 1
      required:
        - "Code"
        - "Message"
        - "Errors"  
        
    obWriteFundsConfirmationResponse1:
      type: "object"
      additionalProperties: false
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          additionalProperties: false
          properties:
            FundsAvailableResult:
              type: "object"
              additionalProperties: false
              required:
                - "FundsAvailableDateTime"
                - "FundsAvailable"
              description: "Result of a funds availability check."
              properties:
                FundsAvailableDateTime:
                  description: "Date and time at which the funds availability check was generated.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
                  type: "string"
                  format: "date-time"
                FundsAvailable:
                  description: "Flag to indicate the availability of funds given the Amount in the consent request."
                  type: "boolean"
            SupplementaryData:
              $ref: "#/components/schemas/obSupplementaryData1"
        Links:
          $ref: "#/components/schemas/links"
        Meta:
          $ref: "#/components/schemas/meta"    
        
    obExternalLocalInstrument1Code:
      description: "User community specific instrument.\nUsage: This element is used to specify a local instrument, local clearing option and/or further qualify the service or service level."
      type: "string"
      x-namespaced-enum:
        - "UK.OBIE.BACS"
        - "UK.OBIE.BalanceTransfer"
        - "UK.OBIE.CHAPS"
        - "UK.OBIE.Euro1"
        - "UK.OBIE.FPS"
        - "UK.OBIE.Link"
        - "UK.OBIE.MoneyTransfer"
        - "UK.OBIE.Paym"
        - "UK.OBIE.SEPACreditTransfer"
        - "UK.OBIE.SEPAInstantCreditTransfer"
        - "UK.OBIE.SWIFT"
        - "UK.OBIE.Target2"    
        
    obExternalAccountIdentification4Code:
      description: "Name of the identification scheme, in a coded form as published in an external list."
      type: "string"
      x-namespaced-enum:
        - "UK.OBIE.BBAN"
        - "UK.OBIE.IBAN"
        - "UK.OBIE.PAN"
        - "UK.OBIE.Paym"
        - "UK.OBIE.SortCodeAccountNumber" 
        
    identification_0:
      description: "Identification assigned by an institution to identify an account. This identification is known by the account owner."
      type: "string"
      minLength: 1
      maxLength: 256
   
    links:
      type: "object"
      additionalProperties: false
      description: "Links relevant to the payload"
      properties:
        Self:
          type: "string"
          format: "uri"
      required:
        - "Self"    
        
    obExternalPaymentChargeType1Code:
      description: "Charge type, in a coded form."
      type: "string"
      x-namespaced-enum:
        - "UK.OBIE.CHAPSOut"    

    obActiveOrHistoricCurrencyAndAmount:
      type: "object"
      additionalProperties: false
      required:
        - "Amount"
        - "Currency"
      description: "Amount of money associated with the charge type."
      properties:
        Amount:
          $ref: "#/components/schemas/obActiveCurrencyAndAmount_SimpleType"
        Currency:
          $ref: "#/components/schemas/activeOrHistoricCurrencyCode"      

    obSupplementaryData1:
      type: "object"
      properties: { }
      additionalProperties: true
      description: "Additional information that can not be captured in the structured fields and/or any other specific block."
 
    obChargeBearerType1Code:
      description: "Specifies which party/parties will bear the charges associated with the processing of the payment transaction."
      type: "string"
      enum:
        - "BorneByCreditor"
        - "BorneByDebtor"
        - "FollowingServiceLevel"
        - "Shared"  
        
    obCashAccountDebtor4:
      type: "object"
      description: "^ Only incuded in the response if `Data. ReadRefundAccount` is set to `Yes` in the consent."
      properties:
        SchemeName:
          type: "string"
          description: "^ Name of the identification scheme, in a coded form as published in an external list. | Namespaced Enumeration OBExternalAccountIdentification4Code"
        Identification:
          type: "string"
          description: "^ Identification assigned by an institution to identify an account. This identification is known by the account owner. | Max256Text"
        Name:
          type: "string"
          description: "^ Name of the account, as assigned by the account servicing institution.  Usage The account name is the name or names of the account owner(s) represented at an account level. The account name is not the product name or the nickname of the account."
        SecondaryIdentification:
          type: "string"
          description: "^ This is secondary identification of the account, as assigned by the account servicing institution.  This can be used by building societies to additionally identify accounts with a roll number (in addition to a sort code and account number combination) | Max34Text"    
        
    obRisk1:
      type: object
      additionalProperties: false
      properties: {}
      description: |-
        The Risk section is sent by the initiating party to the ASPSP.
        It is used to specify additional details for risk scoring for Payments.    
 
    obWriteConsent4:
      type: "object"
      additionalProperties: false
      required:
        - "Data"
        - "Risk"
      properties:
        Data:
          type: "object"
          additionalProperties: false
          required:
            - "Initiation"
          properties:
            Initiation:
              type: "object"
              additionalProperties: false
              required:
                - "InstructionIdentification"
                - "EndToEndIdentification"
                - "InstructedAmount"
                - "CreditorAccount"
              description: "The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds from the debtor account to a creditor for a single payment."
              properties:
                InstructionIdentification:
                  description: "Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.\nUsage: the  instruction identification is a point to point reference that can be used between the instructing party and the instructed party to refer to the individual instruction. It can be included in several messages related to the instruction."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                EndToEndIdentification:
                  description: "Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain.\nUsage: The end-to-end identification can be used for reconciliation or to link tasks relating to the transaction. It can be included in several messages related to the transaction.\nOB: The Faster Payments Scheme can only access 31 characters for the EndToEndIdentification field."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                LocalInstrument:
                  $ref: "#/components/schemas/obExternalLocalInstrument1Code"
                InstructedAmount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "Amount"
                    - "Currency"
                  description: "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.\nUsage: This amount has to be transported unchanged through the transaction chain."
                  properties:
                    Amount:
                      $ref: "#/components/schemas/obActiveCurrencyAndAmount_SimpleType"
                    Currency:
                      $ref: "#/components/schemas/activeOrHistoricCurrencyCode"
                DebtorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                  description: "Unambiguous identification of the account of the debtor to which a debit entry will be made as a result of the transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                CreditorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                    - "Name"
                  description: "Unambiguous identification of the account of the creditor to which a credit entry will be posted as a result of the payment transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level.\nNote, the account name is not the product name or the nickname of the account.\nOB: ASPSPs may carry out name validation for Confirmation of Payee, but it is not mandatory."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                SupplementaryData:
                  $ref: "#/components/schemas/obSupplementaryData1"
        Risk:
          $ref: "#/components/schemas/obRisk1"   
    
    obWritePayment2:
      type: "object"
      additionalProperties: false
      required:
        - "Data"
        - "Risk"
      properties:
        Data:
          type: "object"
          additionalProperties: false
          required:
            - "consentId"
            - "Initiation"
          properties:
            consentId:
              description: "OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
            Initiation:
              type: "object"
              additionalProperties: false
              required:
                - "InstructionIdentification"
                - "EndToEndIdentification"
                - "InstructedAmount"
                - "CreditorAccount"
              description: "The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds from the debtor account to a creditor for a single payment."
              properties:
                InstructionIdentification:
                  description: "Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.\nUsage: the  instruction identification is a point to point reference that can be used between the instructing party and the instructed party to refer to the individual instruction. It can be included in several messages related to the instruction."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                EndToEndIdentification:
                  description: "Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain.\nUsage: The end-to-end identification can be used for reconciliation or to link tasks relating to the transaction. It can be included in several messages related to the transaction.\nOB: The Faster Payments Scheme can only access 31 characters for the EndToEndIdentification field."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                LocalInstrument:
                  $ref: "#/components/schemas/obExternalLocalInstrument1Code"
                InstructedAmount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "Amount"
                    - "Currency"
                  description: "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.\nUsage: This amount has to be transported unchanged through the transaction chain."
                  properties:
                    Amount:
                      $ref: "#/components/schemas/obActiveCurrencyAndAmount_SimpleType"
                    Currency:
                      $ref: "#/components/schemas/activeOrHistoricCurrencyCode"
                DebtorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                  description: "Unambiguous identification of the account of the debtor to which a debit entry will be made as a result of the transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                CreditorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                    - "Name"
                  description: "Unambiguous identification of the account of the creditor to which a credit entry will be posted as a result of the payment transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level.\nNote, the account name is not the product name or the nickname of the account.\nOB: ASPSPs may carry out name validation for Confirmation of Payee, but it is not mandatory."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                SupplementaryData:
                  $ref: "#/components/schemas/obSupplementaryData1"
        Risk:
          $ref: "#/components/schemas/obRisk1"
          
    obWritePaymentResponse5:
      type: "object"
      additionalProperties: false
      required:
        - "Data"
      properties:
        Data:
          type: "object"
          additionalProperties: false
          required:
            - "paymentId"
            - "consentId"
            - "CreationDateTime"
            - "Status"
            - "StatusUpdateDateTime"
            - "Initiation"
          properties:
            paymentId:
              description: "OB: Unique identification as assigned by the ASPSP to uniquely identify the payment resource."
              type: "string"
              minLength: 1
              maxLength: 40
            consentId:
              description: "OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
            CreationDateTime:
              description: "Date and time at which the message was created.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            Status:
              description: "Specifies the status of the payment information group."
              type: "string"
              enum:
                - "AcceptedCreditSettlementCompleted"
                - "AcceptedSettlementCompleted"
                - "AcceptedSettlementInProcess"
                - "AcceptedWithoutPosting"
                - "Pending"
                - "Rejected"
            StatusUpdateDateTime:
              description: "Date and time at which the resource status was updated.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            ExpectedExecutionDateTime:
              description: "Expected execution date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            ExpectedSettlementDateTime:
              description: "Expected settlement date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            Refund:
              type: "object"
              additionalProperties: false
              required:
                - "Account"
              description: "Unambiguous identification of the refund account to which a refund will be made as a result of the transaction."
              properties:
                Account:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                    - "Name"
                  description: "Provides the details to identify an account."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "Name of the account, as assigned by the account servicing institution.\nUsage: The account name is the name or names of the account owner(s) represented at an account level. The account name is not the product name or the nickname of the account.\nOB: ASPSPs may carry out name validation for Confirmation of Payee, but it is not mandatory."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
            Charges:
              type: "array"
              items:
                type: "object"
                additionalProperties: false
                description: "Set of elements used to provide details of a charge for the payment initiation."
                required:
                  - "ChargeBearer"
                  - "Type"
                  - "Amount"
                properties:
                  ChargeBearer:
                    $ref: "#/components/schemas/obChargeBearerType1Code"
                  Type:
                    $ref: "#/components/schemas/obExternalPaymentChargeType1Code"
                  Amount:
                    $ref: "#/components/schemas/obActiveOrHistoricCurrencyAndAmount"
            Initiation:
              type: "object"
              additionalProperties: false
              required:
                - "InstructionIdentification"
                - "EndToEndIdentification"
                - "InstructedAmount"
                - "CreditorAccount"
              description: "The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds from the debtor account to a creditor for a single payment."
              properties:
                InstructionIdentification:
                  description: "Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.\nUsage: the  instruction identification is a point to point reference that can be used between the instructing party and the instructed party to refer to the individual instruction. It can be included in several messages related to the instruction."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                EndToEndIdentification:
                  description: "Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain.\nUsage: The end-to-end identification can be used for reconciliation or to link tasks relating to the transaction. It can be included in several messages related to the transaction.\nOB: The Faster Payments Scheme can only access 31 characters for the EndToEndIdentification field."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                LocalInstrument:
                  $ref: "#/components/schemas/obExternalLocalInstrument1Code"
                InstructedAmount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "Amount"
                    - "Currency"
                  description: "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.\nUsage: This amount has to be transported unchanged through the transaction chain."
                  properties:
                    Amount:
                      $ref: "#/components/schemas/obActiveCurrencyAndAmount_SimpleType"
                    Currency:
                      $ref: "#/components/schemas/activeOrHistoricCurrencyCode"
                DebtorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                  description: "Unambiguous identification of the account of the debtor to which a debit entry will be made as a result of the transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                CreditorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                    - "Name"
                  description: "Unambiguous identification of the account of the creditor to which a credit entry will be posted as a result of the payment transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level.\nNote, the account name is not the product name or the nickname of the account.\nOB: ASPSPs may carry out name validation for Confirmation of Payee, but it is not mandatory."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                SupplementaryData:
                  $ref: "#/components/schemas/obSupplementaryData1"
            MultiAuthorisation:
              type: "object"
              additionalProperties: false
              required:
                - "Status"
              description: "The multiple authorisation flow response from the ASPSP."
              properties:
                Status:
                  description: "Specifies the status of the authorisation flow in code form."
                  type: "string"
                  enum:
                    - "Authorised"
                    - "AwaitingFurtherAuthorisation"
                    - "Rejected"
                NumberRequired:
                  description: "Number of authorisations required for payment order (total required at the start of the multi authorisation journey)."
                  type: "integer"
                NumberReceived:
                  description: "Number of authorisations received."
                  type: "integer"
                LastUpdateDateTime:
                  description: "Last date and time at the authorisation flow was updated.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
                  type: "string"
                  format: "date-time"
                ExpirationDateTime:
                  description: "Date and time at which the requested authorisation flow must be completed.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
                  type: "string"
                  format: "date-time"
            Debtor:
              $ref: "#/components/schemas/obCashAccountDebtor4"
        Links:
          $ref: "#/components/schemas/links"
        Meta:
          $ref: "#/components/schemas/meta"      
          
    obWritePaymentConsentResponse5:
      type: "object"
      additionalProperties: false
      required:
        - "Data"
        - "Risk"
      properties:
        Data:
          type: "object"
          additionalProperties: false
          required:
            - "consentId"
            - "CreationDateTime"
            - "Status"
            - "StatusUpdateDateTime"
            - "Initiation"
          properties:
            consentId:
              description: "OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource."
              type: "string"
              minLength: 1
              maxLength: 128
            CreationDateTime:
              description: "Date and time at which the resource was created.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            Status:
              description: "Specifies the status of consent resource in code form."
              type: "string"
              enum:
                - "Authorised"
                - "AwaitingAuthorisation"
                - "Consumed"
                - "Rejected"
            StatusUpdateDateTime:
              description: "Date and time at which the resource status was updated.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            CutOffDateTime:
              description: "Specified cut-off date and time for the payment consent.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            ExpectedExecutionDateTime:
              description: "Expected execution date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            ExpectedSettlementDateTime:
              description: "Expected settlement date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format. \nAll date-time fields in responses must include the timezone. An example is below:\n2017-04-05T10:43:07+00:00"
              type: "string"
              format: "date-time"
            Charges:
              type: "array"
              items:
                type: "object"
                additionalProperties: false
                description: "Set of elements used to provide details of a charge for the payment initiation."
                required:
                  - "ChargeBearer"
                  - "Type"
                  - "Amount"
                properties:
                  ChargeBearer:
                    $ref: "#/components/schemas/obChargeBearerType1Code"
                  Type:
                    $ref: "#/components/schemas/obExternalPaymentChargeType1Code"
                  Amount:
                    $ref: "#/components/schemas/obActiveOrHistoricCurrencyAndAmount"
            Initiation:
              type: "object"
              additionalProperties: false
              required:
                - "InstructionIdentification"
                - "EndToEndIdentification"
                - "InstructedAmount"
                - "CreditorAccount"
              description: "The Initiation payload is sent by the initiating party to the ASPSP. It is used to request movement of funds from the debtor account to a creditor for a single payment."
              properties:
                InstructionIdentification:
                  description: "Unique identification as assigned by an instructing party for an instructed party to unambiguously identify the instruction.\nUsage: the  instruction identification is a point to point reference that can be used between the instructing party and the instructed party to refer to the individual instruction. It can be included in several messages related to the instruction."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                EndToEndIdentification:
                  description: "Unique identification assigned by the initiating party to unambiguously identify the transaction. This identification is passed on, unchanged, throughout the entire end-to-end chain.\nUsage: The end-to-end identification can be used for reconciliation or to link tasks relating to the transaction. It can be included in several messages related to the transaction.\nOB: The Faster Payments Scheme can only access 31 characters for the EndToEndIdentification field."
                  type: "string"
                  minLength: 1
                  maxLength: 35
                LocalInstrument:
                  $ref: "#/components/schemas/obExternalLocalInstrument1Code"
                InstructedAmount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "Amount"
                    - "Currency"
                  description: "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.\nUsage: This amount has to be transported unchanged through the transaction chain."
                  properties:
                    Amount:
                      $ref: "#/components/schemas/obActiveCurrencyAndAmount_SimpleType"
                    Currency:
                      $ref: "#/components/schemas/activeOrHistoricCurrencyCode"
                DebtorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                  description: "Unambiguous identification of the account of the debtor to which a debit entry will be made as a result of the transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level, as displayed by the ASPSP's online channels.\nNote, the account name is not the product name or the nickname of the account."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                CreditorAccount:
                  type: "object"
                  additionalProperties: false
                  required:
                    - "SchemeName"
                    - "Identification"
                    - "Name"
                  description: "Unambiguous identification of the account of the creditor to which a credit entry will be posted as a result of the payment transaction."
                  properties:
                    SchemeName:
                      $ref: "#/components/schemas/obExternalAccountIdentification4Code"
                    Identification:
                      $ref: "#/components/schemas/identification_0"
                    Name:
                      description: "The account name is the name or names of the account owner(s) represented at an account level.\nNote, the account name is not the product name or the nickname of the account.\nOB: ASPSPs may carry out name validation for Confirmation of Payee, but it is not mandatory."
                      type: "string"
                      minLength: 1
                      maxLength: 350
                    SecondaryIdentification:
                      $ref: "#/components/schemas/secondaryIdentification"
                SupplementaryData:
                  $ref: "#/components/schemas/obSupplementaryData1"
            Debtor:
              $ref: "#/components/schemas/obCashAccountDebtor4"
        Risk:
          $ref: "#/components/schemas/obRisk1"
        Links:
          $ref: "#/components/schemas/links"
        Meta:
          $ref: "#/components/schemas/meta"      
          
    
