openapi: 3.0.0
servers:
  - url: https://openbanking.org.uk
  - url: /open-banking/v3.1/cbpii
info:
  contact:
    email: ServiceDesk@openbanking.org.uk
    name: Service Desk
  description: Swagger for Confirmation of Funds API Specification
  license:
    name: open-licence
    url: https://www.openbanking.org.uk/open-licence
  termsOfService: https://www.openbanking.org.uk/terms
  title: Confirmation of Funds API Specification
  version: 3.1.7
  x-apisguru-categories:
    - financial
  x-logo:
    backgroundColor: "#FFFFFF"
    url: https://avatars0.githubusercontent.com/u/23359225?v=4&s=200
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/OpenBankingUK/read-write-api-specs/master/dist/openapi/confirmation-funds-openapi.yaml
      version: "3.0"
  x-providerName: openbanking.org.uk
  x-serviceName: confirmation-funds-openapi
paths:
  /funds-confirmation-consents:
    post:
      operationId: CreateFundsConfirmationConsents
      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-customer-user-agent"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBFundsConfirmationConsent1"
        description: Default
        required: true
      responses:
        "201":
          $ref: "#/components/responses/201FundsConfirmationConsentsCreated"
        "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:
            - fundsconfirmations
      summary: Create Funds Confirmation Consent
      tags:
        - Funds Confirmations
  "/funds-confirmation-consents/{ConsentId}":
    delete:
      operationId: DeleteFundsConfirmationConsentsConsentId
      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"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        "204":
          $ref: "#/components/responses/204FundsConfirmationConsentsConsentIdDeleted"
        "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:
            - fundsconfirmations
      summary: Delete Funds Confirmation Consent
      tags:
        - Funds Confirmations
    get:
      operationId: GetFundsConfirmationConsentsConsentId
      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"
        - $ref: "#/components/parameters/x-customer-user-agent"
      responses:
        "200":
          $ref: "#/components/responses/200FundsConfirmationConsentsConsentIdRead"
        "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:
            - fundsconfirmations
      summary: Get Funds Confirmation Consent
      tags:
        - Funds Confirmations
  /funds-confirmations:
    post:
      operationId: CreateFundsConfirmations
      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-customer-user-agent"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OBFundsConfirmation1"
        description: Default
        required: true
      responses:
        "201":
          $ref: "#/components/responses/201FundsConfirmationsCreated"
        "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:
            - fundsconfirmations
      summary: Create Funds Confirmation
      tags:
        - Funds Confirmations
components:
  parameters:
    Authorization:
      description: An Authorisation Token as per https://tools.ietf.org/html/rfc6750
      in: header
      name: Authorization
      required: true
      schema:
        type: string
    ConsentId:
      description: ConsentId
      in: path
      name: ConsentId
      required: true
      schema:
        type: string
    x-customer-user-agent:
      description: Indicates the user-agent that the PSU is using.
      in: header
      name: x-customer-user-agent
      required: false
      schema:
        type: string
    x-fapi-auth-date:
      description: >-
        The time when the PSU last logged in with the TPP. 

        All dates in the HTTP headers are represented as RFC 7231 Full Dates. An example is below: 

        Sun, 10 Sep 2017 19:43:31 UTC
      in: header
      name: x-fapi-auth-date
      required: false
      schema:
        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)$
        type: string
    x-fapi-customer-ip-address:
      description: The PSU's IP address if the PSU is currently logged in with the TPP.
      in: header
      name: x-fapi-customer-ip-address
      required: false
      schema:
        type: string
    x-fapi-interaction-id:
      description: An RFC4122 UID used as a correlation id.
      in: header
      name: x-fapi-interaction-id
      required: false
      schema:
        type: string
    x-idempotency-key:
      description: >
        Every request will be processed only once per x-idempotency-key.  The

        Idempotency Key will be valid for 24 hours.
      in: header
      name: x-idempotency-key
      required: true
      schema:
        maxLength: 40
        pattern: ^(?!\s)(.*)(\S)$
        type: string
    x-jws-signature:
      description: A detached JWS signature of the body of the payload.
      in: header
      name: x-jws-signature
      required: true
      schema:
        type: string
  responses:
    200FundsConfirmationConsentsConsentIdRead:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationConsentResponse1"
      description: Funds Confirmation Consent Read
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    201FundsConfirmationConsentsCreated:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationConsentResponse1"
      description: Funds Confirmation Consent Created
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    201FundsConfirmationsCreated:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBFundsConfirmationResponse1"
      description: Funds Confirmation Created
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    204FundsConfirmationConsentsConsentIdDeleted:
      description: Funds Confirmation Consent Deleted
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    400Error:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
      description: Bad request
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    401Error:
      description: Unauthorized
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    403Error:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
      description: Forbidden
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    404Error:
      description: Not found
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    405Error:
      description: Method Not Allowed
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    406Error:
      description: Not Acceptable
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    415Error:
      description: Unsupported Media Type
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          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.
          schema:
            type: string
    500Error:
      content:
        application/json; charset=utf-8:
          schema:
            $ref: "#/components/schemas/OBErrorResponse1"
      description: Internal Server Error
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
  schemas:
    ISODateTime:
      description: >-
        All dates in the JSON payloads are represented in ISO 8601 date-time format. 

        All date-time fields in responses must include the timezone. An example is below:

        2017-04-05T10:43:07+00:00
      format: date-time
      type: string
    Links:
      additionalProperties: false
      description: Links relevant to the payload
      properties:
        First:
          format: uri
          type: string
        Last:
          format: uri
          type: string
        Next:
          format: uri
          type: string
        Prev:
          format: uri
          type: string
        Self:
          format: uri
          type: string
      required:
        - Self
      type: object
    Meta:
      additionalProperties: false
      description: Meta Data relevant to the payload
      properties:
        FirstAvailableDateTime:
          $ref: "#/components/schemas/ISODateTime"
        LastAvailableDateTime:
          $ref: "#/components/schemas/ISODateTime"
        TotalPages:
          format: int32
          type: integer
      title: MetaData
      type: object
    OBError1:
      additionalProperties: false
      minProperties: 1
      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'

            OBIE doesn't standardise this field
          maxLength: 500
          minLength: 1
          type: string
        Path:
          description: Recommended but optional reference to the JSON Path of the field with error, e.g., Data.Initiation.InstructedAmount.Currency
          maxLength: 500
          minLength: 1
          type: string
        Url:
          description: URL to help remediate the problem, or provide more information, or to API Reference, or help etc
          type: string
      required:
        - ErrorCode
        - Message
      type: object
    OBErrorResponse1:
      additionalProperties: false
      description: An array of detail error codes, and messages, and URLs to documentation to help remediation.
      properties:
        Code:
          description: High level textual error code, to help categorize the errors.
          maxLength: 40
          minLength: 1
          type: string
        Errors:
          items:
            $ref: "#/components/schemas/OBError1"
          minItems: 1
          type: array
        Id:
          description: A unique reference for the error instance, for audit purposes, in case of unknown/unclassified errors.
          maxLength: 40
          minLength: 1
          type: string
        Message:
          description: Brief Error message, e.g., 'There is something wrong with the request parameters provided'
          maxLength: 500
          minLength: 1
          type: string
      required:
        - Code
        - Message
        - Errors
      type: object
    OBFundsConfirmation1:
      additionalProperties: false
      properties:
        Data:
          properties:
            ConsentId:
              description: Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource.
              maxLength: 128
              minLength: 1
              type: string
            InstructedAmount:
              description: Amount of money to be confirmed as available funds in the debtor account. Contains an Amount and a Currency.
              properties:
                Amount:
                  description: A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.
                  pattern: ^\d{1,13}$|^\d{1,13}\.\d{1,5}$
                  type: string
                Currency:
                  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".
                  pattern: ^[A-Z]{3,3}$
                  type: string
              required:
                - Amount
                - Currency
              type: object
            Reference:
              description: Unique reference, as assigned by the CBPII, to unambiguously refer to the request related to the payment transaction.
              maxLength: 35
              minLength: 1
              type: string
          required:
            - ConsentId
            - Reference
            - InstructedAmount
          type: object
      required:
        - Data
      type: object
    OBFundsConfirmationConsent1:
      additionalProperties: false
      properties:
        Data:
          properties:
            DebtorAccount:
              description: Unambiguous identification of the account of the debtor to which a confirmation of funds consent will be applied.
              properties:
                Identification:
                  description: Identification assigned by an institution to identify an account. This identification is known by the account owner.
                  maxLength: 256
                  minLength: 1
                  type: string
                Name:
                  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.
                  maxLength: 350
                  minLength: 1
                  type: string
                SchemeName:
                  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
                SecondaryIdentification:
                  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).
                  maxLength: 34
                  minLength: 1
                  type: string
              required:
                - SchemeName
                - Identification
              type: object
            ExpirationDateTime:
              description: >-
                Specified date and time the funds confirmation authorisation will expire.
                 If this is not populated, the authorisation will be open ended.All dates in the JSON payloads are represented in ISO 8601 date-time format. 
                All date-time fields in responses must include the timezone. An example is below:

                2017-04-05T10:43:07+00:00
              format: date-time
              type: string
          required:
            - DebtorAccount
          type: object
      required:
        - Data
      type: object
    OBFundsConfirmationConsentResponse1:
      additionalProperties: false
      properties:
        Data:
          properties:
            ConsentId:
              description: Unique identification as assigned to identify the funds confirmation consent resource.
              maxLength: 128
              minLength: 1
              type: string
            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. 

                All date-time fields in responses must include the timezone. An example is below:

                2017-04-05T10:43:07+00:00
              format: date-time
              type: string
            DebtorAccount:
              description: Unambiguous identification of the account of the debtor to which a confirmation of funds consent will be applied.
              properties:
                Identification:
                  description: Identification assigned by an institution to identify an account. This identification is known by the account owner.
                  maxLength: 256
                  minLength: 1
                  type: string
                Name:
                  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.
                  maxLength: 350
                  minLength: 1
                  type: string
                SchemeName:
                  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
                SecondaryIdentification:
                  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).
                  maxLength: 34
                  minLength: 1
                  type: string
              required:
                - SchemeName
                - Identification
              type: object
            ExpirationDateTime:
              description: >-
                Specified date and time the funds confirmation authorisation will expire.

                If this is not populated, the authorisation will be open ended.All dates in the JSON payloads are represented in ISO 8601 date-time format. 

                All date-time fields in responses must include the timezone. An example is below:

                2017-04-05T10:43:07+00:00
              format: date-time
              type: string
            Status:
              description: Specifies the status of consent resource in code form.
              enum:
                - Authorised
                - AwaitingAuthorisation
                - Rejected
                - Revoked
              type: string
            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. 

                All date-time fields in responses must include the timezone. An example is below:

                2017-04-05T10:43:07+00:00
              format: date-time
              type: string
          required:
            - ConsentId
            - CreationDateTime
            - Status
            - StatusUpdateDateTime
            - DebtorAccount
          type: object
        Links:
          $ref: "#/components/schemas/Links"
        Meta:
          $ref: "#/components/schemas/Meta"
      required:
        - Data
      type: object
    OBFundsConfirmationResponse1:
      additionalProperties: false
      properties:
        Data:
          properties:
            ConsentId:
              description: Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation consent resource.
              maxLength: 128
              minLength: 1
              type: string
            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. 

                All date-time fields in responses must include the timezone. An example is below:

                2017-04-05T10:43:07+00:00
              format: date-time
              type: string
            FundsAvailable:
              description: Flag to indicate the result of a confirmation of funds check.
              type: boolean
            FundsConfirmationId:
              description: Unique identification as assigned by the ASPSP to uniquely identify the funds confirmation resource.
              maxLength: 40
              minLength: 1
              type: string
            InstructedAmount:
              description: Amount of money to be confirmed as available funds in the debtor account. Contains an Amount and a Currency.
              properties:
                Amount:
                  description: A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.
                  pattern: ^\d{1,13}$|^\d{1,13}\.\d{1,5}$
                  type: string
                Currency:
                  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".
                  pattern: ^[A-Z]{3,3}$
                  type: string
              required:
                - Amount
                - Currency
              type: object
            Reference:
              description: Unique reference, as assigned by the CBPII, to unambiguously refer to the request related to the payment transaction.
              maxLength: 35
              minLength: 1
              type: string
          required:
            - FundsConfirmationId
            - ConsentId
            - CreationDateTime
            - FundsAvailable
            - Reference
            - InstructedAmount
          type: object
        Links:
          $ref: "#/components/schemas/Links"
        Meta:
          $ref: "#/components/schemas/Meta"
      required:
        - Data
      type: object
  securitySchemes:
    PSUOAuth2Security:
      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
          scopes:
            fundsconfirmations: Funds confirmation entitlement
          tokenUrl: https://authserver.example/token
      type: oauth2
    TPPOAuth2Security:
      description: TPP client credential authorisation flow with the ASPSP
      flows:
        clientCredentials:
          scopes:
            fundsconfirmations: Funds confirmation entitlement
          tokenUrl: https://authserver.example/token
      type: oauth2
