openapi: 3.0.1
info:
  title: Transfers
  version: 2.10.0
  description: API for Money Transfers
  contact:
    name: Tradevest GmbH
    email: hello@tradevest.ai
    url: https://tradevest.ai
servers:
  - url: https://tvda-api.platform-test.tradevest.ai
    description: Test
security:
  - Bearer: []
tags:
  - name: General
    description: General
  - name: Transfers
    description: Transfers
  - name: Test
    description: Test
paths:
  /transfers/iban-validate/{iban}:
    parameters:
      - schema:
          type: string
          pattern: ^[A-Z]{2}[0-9A-Z]{14,31}$
        name: iban
        in: path
        required: true
        description: IBAN
    get:
      summary: Validate IBAN
      operationId: iban-validate
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IbanValidateResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: IBAN validate
      x-operation-group: transfers-query
      x-required-permissions: rs/transfers/read
      tags:
        - General
  /transfers:
    parameters: []
    post:
      summary: Create Transfer
      parameters:
        - schema:
            type: string
            format: uuid
          name: Requestor-ID
          in: header
          required: true
          description: Unique requestor identification in UUID format
          x-requestor-id: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTransferResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      operationId: create-transfer
      x-operation-group: transfers-command
      x-required-permissions: rs/transfers/write
      description: Create Transfer
      tags:
        - Transfers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferData'
        description: Create transfer
  /products/{customerProductId}/transfers:
    parameters:
      - schema:
          type: string
          format: uuid
        name: customerProductId
        in: path
        required: true
        description: Unique customer product identification number in UUID format
    get:
      summary: Get Transfers
      operationId: get-transfers
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transfers'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      description: Get Transfers
      x-operation-group: transfers-query
      x-required-permissions: rs/transfers/read
      tags:
        - Transfers
      parameters:
        - schema:
            type: string
          in: query
          name: cursor
          description: String value used for pagination
        - schema:
            type: integer
            minimum: 1
            default: 20
          in: query
          name: limit
          description: Maximum number of items to return
          required: true
        - schema:
            type: string
          in: query
          name: externalId
          description: External Id in partner's system. This value has to be unique
        - schema:
            type: string
            format: date-time
          in: query
          name: startCreatedOn
          description: Display transfers created on or after this date
        - schema:
            type: string
            format: date-time
          in: query
          name: endCreatedOn
          description: Display transfers created on or before this date
        - schema:
            type: array
            items:
              $ref: '#/components/schemas/TransferStatusEnum'
          in: query
          name: status
          description: Transfer statuses
  /transfers/{transferId}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: transferId
        in: path
        required: true
        description: Unique transfer identification number in UUID format
    get:
      summary: Get Transfer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransferCompound'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      operationId: get-transfer
      description: Get Transfer
      x-operation-group: transfers-query
      x-required-permissions: rs/transfers/read
      tags:
        - Transfers
  /transfers-test/incoming-transfer:
    parameters: []
    post:
      summary: Create Test Incoming Transfer
      responses:
        '202':
          description: Accepted
          content: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      operationId: create-test-incoming-transfer
      x-operation-group: transfers-command
      x-required-permissions: rs/transfers/write
      description: |-
        Create Test Incoming Payment
        This endpoint works only in test environment. It is disabled in real environment.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTestIncomingPaymentData'
      tags:
        - Test
components:
  schemas:
    IbanValidateResult:
      title: IbanValidateResult
      type: object
      properties:
        iban:
          type: string
          description: IBAN
        valid:
          type: boolean
          description: Flag that specifies if IBAN is valid or not. IBAN is valid if all validations contain the validation success code, i.e. the code value that starts with double zero (example 001). More details can be found at https://www.iban.com/validation-api and https://www.iban.com/iban-checker.
        bank_data:
          $ref: '#/components/schemas/BankData'
        sepa_data:
          $ref: '#/components/schemas/SepaData'
        validations:
          $ref: '#/components/schemas/Validations'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Validation'
          description: List of errors, if any
      required:
        - iban
        - valid
    BankData:
      type: object
      properties:
        bic:
          type: string
          description: The BIC code of the issuing bank/branch or institution.
        bank:
          type: string
          description: The name of the bank/institution that issued the IBAN
        bank_code:
          type: string
          description: The code of the bank/institution that issued the IBAN
        country:
          type: string
          description: Full name of the country of origin e.g. “United States”
        country_iso:
          type: string
          description: Two letter abbreviation of the country code e.g. US, UK, AU, FR … etc.
    SepaData:
      type: object
      properties:
        SCT:
          type: string
          description: Whether this bank supports SEPA Credit Transfer (YES or NO).
        SDD:
          type: string
          description: Whether this bank supports SEPA Direct Debit (YES or NO).
        COR1:
          type: string
          description: Whether this bank supports SEPA COR1 (YES or NO).
        B2B:
          type: string
          description: Whether this bank supports SEPA Business to Business (YES or NO).
        SCC:
          type: string
          description: Whether this bank supports SEPA Card Clearing (YES or NO).
    Validations:
      type: object
      properties:
        chars:
          $ref: '#/components/schemas/Validation'
        account:
          $ref: '#/components/schemas/Validation'
        iban:
          $ref: '#/components/schemas/Validation'
        structure:
          $ref: '#/components/schemas/Validation'
        length:
          $ref: '#/components/schemas/Validation'
        country_support:
          $ref: '#/components/schemas/Validation'
    Validation:
      type: object
      properties:
        code:
          type: string
          description: Validation code as described at https://www.iban.com/validation-api
        message:
          type: string
          description: Validation message
      required:
        - code
        - message
    CreateTransferResult:
      title: CreateTransferResult
      type: object
      properties:
        transferId:
          type: string
          format: uuid
          description: Unique transfer identification number in UUID format
        createdOn:
          type: string
          format: date-time
          description: The date denoting when the transfer's record was initially created
      required:
        - transferId
        - createdOn
    TransferData:
      title: TransferData
      type: object
      properties:
        customerId:
          type: string
          format: uuid
          description: The identifier of the customer.
        customerProductId:
          type: string
          format: uuid
          description: Unique customer product identification number in UUID format
        reference:
          type: string
          minLength: 6
          maxLength: 140
          description: Transfer reference. If not provided, a text 'NOT PROVIDED' will be used. If provided, it must contain at least 6 alphanumeric characters that are not all the same and it can contain special characters include space, hyphen(-), full stop (.), ampersand(&), and forward slash (/).
          example: This is a test SEPA transfer
        receiverIban:
          type: string
          description: IBAN code
          pattern: ^[A-Z]{2}[0-9A-Z]{14,31}$
          maxLength: 33
          example: DE39500105172896993442
        amount:
          type: number
          description: transfer amount
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
          example: 750.55
        instant:
          type: boolean
          description: flag indicating if the transfer is an instant transfer
          default: false
        externalId:
          type: string
          pattern: '[a-zA-Z0-9]{32,32}'
          description: External Id in partner's system. This value has to be unique.
          example: a2281c82009017817759909450706418
        currency:
          $ref: '#/components/schemas/TransferCurrencyEnum'
      required:
        - customerId
        - customerProductId
        - receiverIban
        - amount
        - externalId
    Transfer:
      title: Transfer
      properties:
        transferId:
          type: string
          format: uuid
          description: Unique transfer identification number in UUID format
        transferStatus:
          $ref: '#/components/schemas/TransferStatusEnum'
        rejectReason:
          type: string
          description: The reason of the transfer rejection.
        createdOn:
          type: string
          format: date-time
          description: The date denoting when the transfer's record was initially created
        modifiedOn:
          type: string
          format: date-time
          description: The date indicating the most recent modification made to the transfer's data
        customerId:
          type: string
          format: uuid
          description: The identifier of the customer.
          example: 87d8e330-2878-4742-a86f-dbbb3bf522ac
        customerProductId:
          type: string
          format: uuid
          description: Unique customer product identification number in UUID format
          example: 3d07c219-0a88-45be-9cfc-91e9d095a1e9
        reference:
          type: string
          maxLength: 140
          description: transfer reference
          example: This is a test SEPA transfer
        name:
          type: string
          maxLength: 255
          description: Receiver name
          example: Erika Musterfrau
        iban:
          type: string
          description: IBAN code
          pattern: ^[A-Z]{2}[0-9A-Z]{14,31}$
          maxLength: 33
          example: DE39500105172896993442
        bic:
          type: string
          description: BIC (Business Identifier Code) of the receiver bank
          minLength: 8
          maxLength: 11
          pattern: ^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$
        amount:
          type: number
          description: transfer amount
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
          example: 750.55
        instant:
          type: boolean
          description: flag indicating if the transfer is an instant transfer
          default: false
        externalId:
          type: string
          pattern: '[a-zA-Z0-9]{32,32}'
          description: External Id in partner's system for outgoing transfers. This value has to be unique.
          example: a2281c82009017817759909450706418
        transactionType:
          $ref: '#/components/schemas/TransactionTypeEnum'
        currency:
          $ref: '#/components/schemas/TransferCurrencyEnum'
      required:
        - transferId
        - transferStatus
        - createdOn
        - modifiedOn
        - customerId
        - customerProductId
        - reference
        - name
        - iban
        - amount
        - transactionType
    TechnicalTransfer:
      title: TechnicalTransfer
      properties:
        transferId:
          type: string
          format: uuid
          description: Unique transfer identification number in UUID format
        transferStatus:
          $ref: '#/components/schemas/TransferStatusEnum'
        createdOn:
          type: string
          format: date-time
          description: The date denoting when the transfer's record was initially created
        modifiedOn:
          type: string
          format: date-time
          description: The date indicating the most recent modification made to the transfer's data
        customerId:
          type: string
          format: uuid
          description: The identifier of the customer.
          example: 87d8e330-2878-4742-a86f-dbbb3bf522ac
        customerProductId:
          type: string
          format: uuid
          description: Unique customer product identification number in UUID format
          example: 3d07c219-0a88-45be-9cfc-91e9d095a1e9
        reference:
          type: string
          maxLength: 140
          description: transfer reference
          example: This is a test SEPA transfer
        amount:
          type: number
          description: transfer amount
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
          example: 750.55
        transactionType:
          $ref: '#/components/schemas/TransactionTypeEnum'
        currency:
          $ref: '#/components/schemas/TransferCurrencyEnum'
      required:
        - transferId
        - transferStatus
        - createdOn
        - modifiedOn
        - customerId
        - customerProductId
        - reference
        - amount
        - transactionType
    TransferCompound:
      type: object
      properties:
        transfer:
          $ref: '#/components/schemas/Transfer'
        technicalTransfer:
          $ref: '#/components/schemas/TechnicalTransfer'
    Transfers:
      title: Transfers
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/TransferCompound'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    TransferStatusEnum:
      title: TransferStatusEnum
      enum:
        - RECEIVED
        - INVALID
        - PENDING
        - REJECTED
        - PROCESSED
        - RECONCILED
      description: Status of the transfer
    TransferMetadata:
      title: TransferMetadata
      type: object
      properties:
        transferId:
          type: string
          format: uuid
          description: Unique transfer identification number in UUID format
        transferStatus:
          $ref: '#/components/schemas/TransferStatusEnum'
        rejectReason:
          type: string
          description: The reason of the transfer rejection.
        customerId:
          type: string
          format: uuid
          description: The identifier of the customer.
        customerProductId:
          type: string
          format: uuid
          description: Unique customer product identification number in UUID format
        reference:
          type: string
          maxLength: 140
          description: transfer reference
          example: This is a test transfer
        amount:
          type: number
          description: transfer amount
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
          example: 750.55
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        externalId:
          type: string
          pattern: '[a-zA-Z0-9]{32,32}'
          description: External Id in partner's system. This value has to be unique.
          example: a2281c82009017817759909450706418
        createdOn:
          type: string
          format: date-time
          description: The date denoting when the transfer's record was initially created
        modifiedOn:
          type: string
          format: date-time
          description: The date indicating the most recent modification made to the transfer's data
      required:
        - transferId
        - transferStatus
        - customerId
        - customerProductId
        - reference
        - amount
        - currency
        - externalId
        - createdOn
        - modifiedOn
    TransferCurrencyEnum:
      title: SepaTransferCurrencyEnum
      enum:
        - EUR
      description: Sepa Transfer Currency
    TransactionTypeEnum:
      title: TransactionTypeEnum
      enum:
        - INCOMING_TRANSFER
        - OUTGOING_TRANSFER
      description: Transfer Transaction Type
    CreateTestIncomingPaymentData:
      title: CreateTestIncomingPaymentData
      properties:
        customerProductId:
          type: string
          format: uuid
          description: Unique customer product identification number in UUID format
          example: 3d07c219-0a88-45be-9cfc-91e9d095a1e9
        amount:
          type: number
          description: transfer amount
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
          example: 750.55
        reference:
          type: string
          maxLength: 140
          description: transfer reference
          example: This is a test SEPA transfer
      required:
        - customerProductId
        - amount
        - reference
    ErrorDetailsExplanation:
      title: ErrorDetailsExplanation
      type: object
      properties:
        code:
          type: string
          maxLength: 255
        parameter:
          type: string
        message:
          type: string
      required:
        - code
        - message
    ErrorDetails:
      title: ErrorDetails
      type: object
      properties:
        field:
          type: string
          maxLength: 255
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetailsExplanation'
      required:
        - field
    ErrorMessage:
      title: ErrorMessage
      type: object
      properties:
        message:
          type: string
        responseType:
          type: string
        validationString:
          minLength: 1
          type: string
        requestId:
          type: string
        errorCode:
          type: string
          maxLength: 255
        errorDetails:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetails'
      required:
        - message
        - responseType
        - requestId
    Pagination:
      title: Pagination
      type: object
      properties:
        cursor:
          type: string
          description: String value used for pagination, which should be set in next page request.
        limit:
          type: integer
          description: Maximum number of returned items
      required:
        - cursor
        - limit
    CurrencyEnum:
      title: CurrencyEnum
      type: string
      description: Currency of the product's balance. Currency code in ISO 4217
      enum:
        - EUR
  securitySchemes:
    Bearer:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes: {}
x-tagGroups:
  - name: Transfers
    tags:
      - General
      - Transfers
  - name: Test
    tags:
      - Test
