openapi: 3.0.1
info:
  title: Mojaloop SDK Backend API
  description: |
    API specification for the SDK Backend API.

    To be implemented by the Digital Financial Service Provider (DFSP) to work in tandem with the Mojaloop SDK (`mojaloop/sdk-scheme-adapter`).

    This API is not to be confused with the Mojaloop SDK's Inbound or Outbound API.

    TODO: More explanation and links about the SDK adapter's Inbound and Outbound API.

    **Note on terminology:** The term "Switch" is equal to the term "Hub", and the term "FSP" is equal to the term "DFSP".
  license:
    name: Apache License Version 2.0, January 2004
    url: http://www.apache.org/licenses/
  version: 2.1.0

paths:
  /:
    get:
      operationId: BackendHealthCheck
      responses:
        '200':
          description: Returns empty body if the service is running.
      summary: Health check endpoint.
  /bulkQuotes:
    post:
      operationId: BackendBulkQuotesPost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bulkQuoteRequest'
        description: Incoming request for a bulk quotation.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkQuoteResponse'
          description: A response to the bulk quote request.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests a bulk quote.
      tags:
        - BulkQuotes
  /bulkQuotes/{idValue}:
    get:
      operationId: BackendBulkQuotesGet
      parameters:
        - $ref: '#/components/parameters/idValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkQuoteResponse'
          description: Response containing details of the requested bulk quote.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests information relating to a bulk quote identified by the specified identifier value.
      tags:
        - BulkQuotes
  /bulkTransactions/{bulkTransactionId}:
    put:
      description: The HTTP request `PUT /bulkTransactions/{bulkTransactionId}` is used to amend information regarding a bulk transaction, i.e. when autoAcceptParty or autoAcceptQuote  is false then the payer need to provide confirmation to proceed with further processing of the request. The `{bulkTransactionId}` in the URI should contain the `bulkTransactionId` that was used for the creation of the bulk transfer.
      operationId: BackendBulkTransactionsPut
      parameters:
        - $ref: '../components/parameters/bulkTransactionId.yaml'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '../components/schemas/bulkTransactionResponse.yaml'
      responses:
        '202':
          description: Bulk transaction information successfully amended.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Callbacks for the bulk transaction request.
      tags:
        - BulkTransactionsPut
  /requestToPay/{transactionRequestId}:
    put:
      description: It is used to notify the DFSP backend about the status of the requestToPayTransfer.
      operationId: RequestToPayPut
      parameters:
        - $ref: '#/components/parameters/transactionRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestToPayCallback'
      responses:
        '200':
          description: OK
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Callback for the requestToPay request.
      tags:
        - RequestToPayPut
  /bulkTransfers:
    post:
      operationId: BackendBulkTransfersPost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bulkTransferRequest'
        description: An incoming bulk transfer request.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkTransferResponse'
          description: The bulk transfer was accepted.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Execute bulk transfer of funds from an external account to internal accounts.
      tags:
        - BulkTransfers
  /bulkTransfers/{idValue}:
    get:
      operationId: BackendBulkTransfersGet
      parameters:
        - $ref: '#/components/parameters/idValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkTransferResponse'
          description: Response containing details of the requested bulk transfer.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests information relating to a bulk transfer identified by the specified identifier value.
      tags:
        - BulkTransfers
  /otp/{transactionRequestId}:
    get:
      operationId: BackendOtpGet
      parameters:
        - $ref: '#/components/parameters/transactionRequestId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/otpDetails'
          description: Response containing details of the OTP.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests OTP.
      tags:
        - OTP
  /participants/{idType}/{idValue}:
    get:
      description: The HTTP request `GET /participants/{idType}/{idValue}` is used to find out in which FSP the requested party, defined by `{idType}` and `{idValue}`, is located.
      operationId: BackendParticipantsGetByTypeAndID
      parameters:
        - $ref: '#/components/parameters/idType'
        - $ref: '#/components/parameters/idValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/participantsResponse'
          description: Response containing details of the requested party.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value.
      tags:
        - Participants
  /participants/{idType}/{idValue}/{idSubValue}:
    get:
      description: The HTTP request `GET /participants/{idType}/{idValue}/{idSubValue}` is used to find out in which FSP the requested party, defined by `{idType}`, `{idValue}` and `{idSubValue}` is located.
      operationId: BackendParticipantsGetByTypeIDAndSubId
      parameters:
        - $ref: '#/components/parameters/idType'
        - $ref: '#/components/parameters/idValue'
        - $ref: '#/components/parameters/idSubValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/participantsResponse'
          description: Response containing details of the requested party.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Asks for the identifier (fspId) of the scheme participant (FSP) that can handle transfers for the specified identifier type and value.
      tags:
        - Participants
  /parties/{idType}/{idValue}:
    get:
      description: The HTTP request `GET /parties/{idType}/{idValue}` is used to look up information regarding the requested transfer party, identified by `{idType}` and `{idValue}`.
      operationId: BackendPartiesGetByTypeAndID
      parameters:
        - $ref: '#/components/parameters/idType'
        - $ref: '#/components/parameters/idValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferParty'
          description: Response containing details of the requested party.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests information relating to a transfer party identified by the specified identifier type and value.
      tags:
        - Parties
  /parties/{idType}/{idValue}/{idSubValue}:
    get:
      description: The HTTP request `GET /parties/{idType}/{idValue}/{idSubValue}` is used to look up information regarding the requested transfer party, identified by `{idType}`, `{idValue}` and `{idSubValue}`.
      operationId: BackendPartiesGetByTypeIdAndSubId
      parameters:
        - $ref: '#/components/parameters/idType'
        - $ref: '#/components/parameters/idValue'
        - $ref: '#/components/parameters/idSubValue'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferParty'
          description: Response containing details of the requested party.
        '400':
          $ref: ../components/responses/400.yaml
        '404':
          $ref: ../components/responses/404.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests information relating to a transfer party identified by the specified identifier type, value and subId value.
      tags:
        - Parties
  /quoterequests:
    post:
      description: The HTTP request `POST /quoterequests` is used to request the creation of a quote for the provided financial transaction.
      operationId: BackendQuoteRequest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/quoteRequest'
        description: Request for a transfer quotation.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/quoteResponse'
          description: A response to the transfer quotation request.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Requests a quote for the specified transfer.
      tags:
        - Quotes
  /transactionrequests:
    post:
      operationId: BackendTransactionRequest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/transactionRequest'
        description: Request for Transaction Request.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionRequestResponse'
          description: A response to the transfer transaction request.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Transaction request that supports pull based transfers.
      tags:
        - TransactionRequest
  /transfers:
    post:
      description: The HTTP request `POST /transfers` is used to request the creation of a transfer for the transfer party.
      operationId: BackendTransfersPost
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/transferRequest'
        description: An incoming transfer request.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferResponse'
          description: The transfer was accepted.
        '400':
          $ref: ../components/responses/400.yaml
        '500':
          $ref: ../components/responses/500.yaml
      summary: Transfers funds from an external account to an internal account.
      tags:
        - Transfers
  /transfers/{transferId}:
    get:
      description: The HTTP request `GET /transfers/{transferId}` is used to get information regarding a transfer created or requested earlier. The `{transferId}` in the URI should contain the `transferId` that was used for the creation of the transfer.
      operationId: BackendTransfersGet
      parameters:
        - $ref: '#/components/parameters/transferId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transferDetailsResponse'
          description: The transfer was accepted.
        '500':
          $ref: ../components/responses/500.yaml
      summary: Retrieves information for a specific transfer.
      tags:
        - Transfers
    put:
      description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee.
      operationId: BackendTransfersPut
      parameters:
        - $ref: '#/components/parameters/transferId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/fulfilNotification'
        description: An incoming notification for fulfiled transfer.
      responses:
        '200':
          description: The notification was accepted.
        '500':
          $ref: ../components/responses/500.yaml
      summary: Receive notification for a specific transfer.
      tags:
        - Transfers
  /fxQuotes:
    $ref: 'paths/fxQuotes.yaml'
  /fxTransfers:
    $ref: 'paths/fxTransfers.yaml'
  /fxTransfers/{commitRequestId}:
    $ref: 'paths/fxTransfersById.yaml'
components:
  parameters:
    idSubValue:
      description: A sub-identifier of the party identifier, or a sub-type of the party identifier's type. For example, `PASSPORT`, `DRIVING_LICENSE`.
      in: path
      name: idSubValue
      required: true
      schema:
        type: string
    idType:
      description: The type of the party identifier. For example, `MSISDN`, `PERSONAL_ID`.
      in: path
      name: idType
      required: true
      schema:
        type: string
    idValue:
      description: The identifier value.
      in: path
      name: idValue
      required: true
      schema:
        type: string
    transactionRequestId:
      in: path
      name: transactionRequestId
      required: true
      schema:
        $ref: '#/components/schemas/transactionRequestId'
    transferId:
      in: path
      name: transferId
      required: true
      schema:
        type: string

  schemas:
    DateOfBirth:
      description: Date of Birth of the Party.
      example: '1966-06-16'
      pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$
      title: DateofBirth (type Date)
      type: string
    FirstName:
      description: First name of the Party (Name Type).
      example: Henrik
      maxLength: 128
      minLength: 1
      pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$
      title: FirstName
      type: string
    FspId:
      description: FSP identifier.
      maxLength: 32
      minLength: 1
      title: FspId
      type: string
    IndividualQuote:
      description: Data model for individual quote in a bulk quote request.
      properties:
        amount:
          $ref: '#/components/schemas/money'
        amountType:
          $ref: '#/components/schemas/amountType'
        currency:
          $ref: '#/components/schemas/currency'
        feesAmount:
          $ref: '#/components/schemas/money'
        feesCurrency:
          $ref: '#/components/schemas/currency'
        initiator:
          $ref: '#/components/schemas/initiator'
        initiatorType:
          $ref: '#/components/schemas/initiatorType'
        note:
          description: An optional note associated with the quote.
          maxLength: 128
          minLength: 1
          type: string
        quoteId:
          $ref: '#/components/schemas/quoteId'
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        to:
          $ref: '#/components/schemas/transferParty'
        transactionId:
          $ref: '#/components/schemas/transactionId'
        transactionType:
          $ref: '#/components/schemas/transactionType'
      required:
        - quoteId
        - transactionId
        - to
        - amountType
        - amount
        - currency
        - transactionType
        - initiator
        - initiatorType
      type: object
    IndividualQuoteResultFailed:
      description: Data model for failed individual quote in a bulk quote response.
      properties:
        errorResponse:
          $ref: ../components/schemas/errorResponse.yaml
        quoteId:
          $ref: '#/components/schemas/quoteId'
      required:
        - quoteId
        - errorResponse
      type: object
    IndividualQuoteResultSuccess:
      description: Data model for successful individual quote in a bulk quote response.
      properties:
        payeeFspCommissionAmount:
          $ref: '#/components/schemas/money'
        payeeFspCommissionAmountCurrency:
          $ref: '#/components/schemas/currency'
        payeeFspFeeAmount:
          $ref: '#/components/schemas/money'
        payeeFspFeeAmountCurrency:
          $ref: '#/components/schemas/currency'
        payeeReceiveAmount:
          $ref: '#/components/schemas/money'
        payeeReceiveAmountCurrency:
          $ref: '#/components/schemas/currency'
        quoteId:
          $ref: '#/components/schemas/quoteId'
        transferAmount:
          $ref: '#/components/schemas/money'
        transferAmountCurrency:
          $ref: '#/components/schemas/currency'
      required:
        - quoteId
      type: object
    IndividualTransfer:
      description: Data model for individual transfer in a bulk transfer request.
      properties:
        amount:
          $ref: '#/components/schemas/money'
        amountType:
          $ref: '#/components/schemas/amountType'
        currency:
          $ref: '#/components/schemas/currency'
        feesAmount:
          $ref: '#/components/schemas/money'
        feesCurrency:
          $ref: '#/components/schemas/currency'
        initiator:
          $ref: '#/components/schemas/initiator'
        initiatorType:
          $ref: '#/components/schemas/initiatorType'
        note:
          description: An optional note associated with the quote.
          maxLength: 128
          minLength: 1
          type: string
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        to:
          $ref: '#/components/schemas/transferParty'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        transferId:
          $ref: '#/components/schemas/transferId'
      required:
        - transferId
        - amount
        - currency
      type: object
    IndividualTransferResult:
      description: Data model for individual transfer in a bulk transfer response.
      properties:
        errorResponse:
          $ref: ../components/schemas/errorResponse.yaml
        extensionList:
          $ref: '#/components/schemas/extensionList'
        transferId:
          $ref: '#/components/schemas/transferId'
      required:
        - transferId
      type: object
    LastName:
      description: Last name of the Party (Name Type).
      example: Karlsson
      maxLength: 128
      minLength: 1
      pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$
      title: LastName
      type: string
    MerchantClassificationCode:
      description: A limited set of pre-defined numbers. This list would be a limited set of numbers identifying a set of popular merchant types like School Fees, Pubs and Restaurants, Groceries, etc.
      pattern: ^[\d]{1,4}$
      title: MerchantClassificationCode
      type: string
    MiddleName:
      description: Middle name of the Party (Name Type).
      example: Johannes
      maxLength: 128
      minLength: 1
      pattern: ^(?!\s*$)[\p{L}\p{gc=Mark}\p{digit}\p{gc=Connector_Punctuation}\p{Join_Control} .,''-]{1,128}$
      title: MiddleName
      type: string
    amountCurrency:
      description: Object containing Amount and Currency of the transfer.
      properties:
        amount:
          $ref: '#/components/schemas/money'
        currency:
          $ref: '#/components/schemas/currency'
      required:
        - amount
        - currency
      type: object
    amountType:
      enum:
        - SEND
        - RECEIVE
      type: string
    bulkQuoteId:
      description: A Mojaloop API bulk quote identifier (UUID/ULID).
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    bulkQuoteRequest:
      description: A request for a bulk quote.
      properties:
        bulkQuoteId:
          $ref: '#/components/schemas/bulkQuoteId'
        expiration:
          $ref: '#/components/schemas/timestamp'
        from:
          $ref: '#/components/schemas/transferParty'
        geoCode:
          $ref: '#/components/schemas/geoCode'
        individualQuotes:
          items:
            $ref: '#/components/schemas/IndividualQuote'
          maxItems: 1000
          minItems: 1
          type: array
      required:
        - bulkQuoteId
        - from
        - individualQuotes
      type: object
    bulkQuoteResponse:
      description: A response to a request for a bulk quote.
      properties:
        bulkQuoteId:
          $ref: '#/components/schemas/bulkQuoteId'
        expiration:
          $ref: '#/components/schemas/timestamp'
        individualQuoteResults:
          description: Fees for each individual transaction, if any of them are charged per transaction.
          items:
            oneOf:
              - $ref: '#/components/schemas/IndividualQuoteResultSuccess'
              - $ref: '#/components/schemas/IndividualQuoteResultFailed'
          maxItems: 1000
          minItems: 1
          type: array
      required:
        - bulkQuoteId
        - individualQuoteResults
      type: object
    bulkTransferId:
      description: A Mojaloop API transfer identifier (UUID/ULID).
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    bulkTransferRequest:
      properties:
        bulkQuote:
          $ref: '#/components/schemas/bulkQuoteResponse'
        bulkTransferId:
          $ref: '#/components/schemas/bulkTransferId'
        from:
          $ref: '#/components/schemas/transferParty'
        individualTransfers:
          items:
            $ref: '#/components/schemas/IndividualTransfer'
          maxItems: 1000
          minItems: 1
          type: array
      required:
        - bulkTransferId
        - individualTransfers
      type: object
    bulkTransferResponse:
      properties:
        bulkTransferId:
          $ref: '#/components/schemas/bulkTransferId'
        homeTransactionId:
          description: Transaction ID from the DFSP backend, used to reconcile transactions between the switch and DFSP backend systems.
          type: string
        individualTransferResults:
          items:
            $ref: '#/components/schemas/IndividualTransferResult'
          maxItems: 1000
          minItems: 1
          type: array
      required:
        - homeTransactionId
      type: object
    currency:
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GGP
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - IMP
        - INR
        - IQD
        - IRR
        - ISK
        - JEP
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRO
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SPL
        - SRD
        - STD
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TVD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VEF
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XDR
        - XOF
        - XPF
        - XTS
        - XXX
        - YER
        - ZAR
        - ZMW
        - ZWD
      maxLength: 3
      minLength: 3
      type: string
    dateOfBirth:
      description: Date of birth in the form YYYY-MM-DD.
      pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$
      type: string
    errorCode:
      description: |
        The API data type errorCode is a JSON String of four characters, consisting of digits only. Negative numbers are not allowed. A leading zero is not allowed. Each error code in the API is a four-digit number, for example, 1234, where the first number (1 in the example) represents the high-level error category, the second number (2 in the example) represents the low-level error category, and the last two numbers (34 in the example) represents the specific error.
      pattern: ^[1-9]\d{3}$
      title: ErrorCode
      type: string
    errorDescription:
      description: Error description string.
      maxLength: 128
      minLength: 1
      title: ErrorDescription
      type: string
    errorInformation:
      description: A Mojaloop API error information construct.
      properties:
        errorCode:
          $ref: '#/components/schemas/errorCode'
        errorDescription:
          $ref: '#/components/schemas/errorDescription'
        extensionList:
          $ref: '#/components/schemas/extensionListComplex'
      required:
        - errorCode
        - errorDescription
      title: ErrorInformation
      type: object
    extensionItem:
      properties:
        key:
          minLength: 1
          type: string
        value:
          maxLength: 128
          minLength: 1
          type: string
      type: object
    extensionList:
      items:
        $ref: '#/components/schemas/extensionItem'
      maxItems: 16
      minItems: 0
      type: array
    extensionListComplex:
      description: Data model for the complex type ExtensionList.
      properties:
        extension:
          description: Number of Extension elements.
          items:
            $ref: '#/components/schemas/extensionItem'
          maxItems: 16
          minItems: 1
          type: array
      required:
        - extension
      type: object
    fspId:
      description: FSP identifier.
      maxLength: 32
      minLength: 1
      type: string
    fulfilNotification:
      description: PUT /transfers/{transferId} object.
      properties:
        currentState:
          $ref: '#/components/schemas/transferStatus'
        direction:
          enum:
            - INBOUND
          type: string
        finalNotification:
          properties:
            completedTimestamp:
              $ref: '#/components/schemas/timestamp'
            extensionList:
              $ref: '#/components/schemas/extensionList'
            transferState:
              $ref: '#/components/schemas/transferState'
          required:
            - completedTimestamp
            - transferState
          type: object
        fulfil:
          properties:
            body:
              $ref: ../components/schemas/TransfersIDPutResponse.yaml
            headers:
              type: object
          type: object
        initiatedTimestamp:
          $ref: '#/components/schemas/timestamp'
        lastError:
          $ref: '../components/schemas/transferError.yaml'
        prepare:
          properties:
            body:
              $ref: '../components/schemas/TransfersPostRequest.yaml'
            headers:
              type: object
          type: object
        quote:
          properties:
            fulfilment:
              $ref: '../components/schemas/IlpFulfilment.yaml'
            internalRequest:
              $ref: '#/components/schemas/quoteRequest'
            mojaloopResponse:
              $ref: '../components/schemas/QuotesIDPutResponse.yaml'
            request:
              $ref: '../components/schemas/QuotesPostRequest.yaml'
            response:
              $ref: '#/components/schemas/quoteResponse'
          type: object
        quoteRequest:
          properties:
            body:
              $ref: '../components/schemas/QuotesPostRequest.yaml'
            headers:
              type: object
          type: object
        quoteResponse:
          properties:
            body:
              $ref: '../components/schemas/QuotesIDPutResponse.yaml'
            headers:
              type: object
          type: object
        transferId:
          $ref: '#/components/schemas/transferId'
      title: TransfersIDPatchResponse
      type: object
    generalError:
      description: This object may represent a number of different error object types and so its properties may vary significantly.
      type: object
    geoCode:
      description: Indicates the geographic location from where the transaction was initiated.
      properties:
        latitude:
          $ref: '#/components/schemas/latitude'
        longitude:
          $ref: '#/components/schemas/longitude'
      required:
        - latitude
        - longitude
      type: object
    idSubValue:
      maxLength: 128
      minLength: 1
      type: string
    idType:
      enum:
        - MSISDN
        - ACCOUNT_NO
        - EMAIL
        - PERSONAL_ID
        - BUSINESS
        - DEVICE
        - ACCOUNT_ID
        - IBAN
        - ALIAS
      type: string
    idValue:
      description: Identifier of the party.
      maxLength: 128
      minLength: 1
      type: string
    ilpPacketData:
      description: Object containing transfer object.
      properties:
        amount:
          $ref: '#/components/schemas/amountCurrency'
        payee:
          $ref: '../components/schemas/Party.yaml'
        payer:
          $ref: '../components/schemas/Party.yaml'
        quoteId:
          $ref: '#/components/schemas/quoteId'
        transactionId:
          $ref: '#/components/schemas/transactionId'
        transactionType:
          $ref: '#/components/schemas/transactionTypeObject'
      required:
        - quoteId
        - transactionId
        - payer
        - payee
        - amount
        - transactionType
      type: object
    initiator:
      enum:
        - PAYER
        - PAYEE
      type: string
    initiatorType:
      enum:
        - CONSUMER
        - AGENT
        - BUSINESS
        - DEVICE
      type: string
    latitude:
      description: The API data type Latitude is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons.
      pattern: ^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$
      type: string
    longitude:
      description: The API data type Longitude is a JSON String in a lexical format that is restricted by a regular expression for interoperability reasons.
      pattern: ^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$
      type: string
    money:
      pattern: ^([0]|([1-9][0-9]{0,17}))([.][0-9]{0,3}[1-9])?$
      type: string
    otpDetails:
      properties:
        otpValue:
          description: OTP value.
          type: string
      required:
        - otpValue
      type: object
    participantsResponse:
      properties:
        fspId:
          $ref: '#/components/schemas/fspId'
      type: object
    payerType:
      enum:
        - CONSUMER
        - AGENT
        - BUSINESS
        - DEVICE
      type: string
    quoteId:
      description: A Mojaloop API quote identifier (UUID/ULID).
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    quoteRequest:
      description: A request for a quote for transfer from the DFSP backend.
      properties:
        homeR2PTransactionId:
          type: string
          description: >-
            Linked homeR2PTransactionId which was generated as part of POST /requestToPay to SDK incase of requestToPay transfer.
        amount:
          $ref: '#/components/schemas/money'
        amountType:
          $ref: '#/components/schemas/amountType'
        currency:
          $ref: '#/components/schemas/currency'
        expiration:
          $ref: '#/components/schemas/timestamp'
        extensionList:
          $ref: '#/components/schemas/extensionList'
        feesAmount:
          $ref: '#/components/schemas/money'
        feesCurrency:
          $ref: '#/components/schemas/currency'
        from:
          $ref: '#/components/schemas/transferParty'
        geoCode:
          $ref: '#/components/schemas/geoCode'
        initiator:
          $ref: '#/components/schemas/initiator'
        initiatorType:
          $ref: '#/components/schemas/initiatorType'
        note:
          description: An optional note associated with the requested transfer.
          maxLength: 128
          minLength: 1
          type: string
        quoteId:
          $ref: '#/components/schemas/quoteId'
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        to:
          $ref: '#/components/schemas/transferParty'
        transactionId:
          $ref: '#/components/schemas/transactionId'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        transactionRequestId:
          $ref: '#/components/schemas/transactionRequestId'
        converter:
            allOf:
              - $ref: ../../../fspiop/v2_0/openapi3/components/schemas/CurrencyConverter.yaml
              - description: >-
                  An optional field which will allow the payer DFSP to specify which DFSP it wants to undertake currency conversion.
                  This is useful incase of if the sender wants the recipient to receive a specified amount of the target currency,
                  but the payer DFSP does not want to undertake the currency conversion. In this case, the amount of the transfer
                  would be expressed in the target currency and the amountType would be set to RECEIVE.
        currencyConversion:
          allOf:
            - $ref: ../../../fspiop/v2_0/openapi3/components/schemas/FxRate.yaml
            - description: >-
                Used by the debtor party if it wants to share information about the currency conversion it proposes to make; or
                if it is required by scheme rules to share this information. This object contains the amount of the transfer in
                the source and target currencies, but does not identify the FXP being used.
      required:
        - quoteId
        - transactionId
        - to
        - from
        - amountType
        - amount
        - currency
        - transactionType
        - initiator
        - initiatorType
      type: object
    quoteResponse:
      description: A response to a request for a quote.
      properties:
        expiration:
          $ref: '#/components/schemas/timestamp'
        extensionList:
          $ref: '#/components/schemas/extensionList'
        geoCode:
          $ref: '#/components/schemas/geoCode'
        payeeFspCommissionAmount:
          $ref: '#/components/schemas/money'
        payeeFspCommissionAmountCurrency:
          $ref: '#/components/schemas/currency'
        payeeFspFeeAmount:
          $ref: '#/components/schemas/money'
        payeeFspFeeAmountCurrency:
          $ref: '#/components/schemas/currency'
        payeeReceiveAmount:
          $ref: '#/components/schemas/money'
        payeeReceiveAmountCurrency:
          $ref: '#/components/schemas/currency'
        quoteId:
          $ref: '#/components/schemas/quoteId'
        transactionId:
          $ref: '#/components/schemas/transactionId'
        transferAmount:
          $ref: '#/components/schemas/money'
        transferAmountCurrency:
          $ref: '#/components/schemas/currency'
      required:
        - quoteId
        - transactionId
        - transferAmount
        - transferAmountCurrency
      type: object
    scenario:
      enum:
        - TRANSFER
      type: string
    timestamp:
      description: An ISO-8601 formatted timestamp.
      pattern: ^(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:(\.\d{3}))(?:Z|[+-][01]\d:[0-5]\d)$
      type: string
    transactionId:
      description: ID of the transaction, the ID is decided by the Payer FSP during the creation of the quote.
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    transactionRequest:
      description: A request for a pull based transfer.
      properties:
        amount:
          $ref: '#/components/schemas/money'
        currency:
          $ref: '#/components/schemas/currency'
        expiration:
          $ref: '#/components/schemas/timestamp'
        from:
          $ref: '#/components/schemas/transferParty'
        geoCode:
          $ref: '#/components/schemas/geoCode'
        initiator:
          $ref: '#/components/schemas/initiator'
        initiatorType:
          $ref: '#/components/schemas/initiatorType'
        note:
          description: An optional note associated with the requested transfer.
          maxLength: 128
          minLength: 1
          type: string
        to:
          $ref: '#/components/schemas/transferParty'
        transactionRequestId:
          $ref: '#/components/schemas/transactionRequestId'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        authenticationType:
          $ref: '../components/schemas/AuthenticationType.yaml'
      required:
        - transactionRequestId
        - to
        - from
        - amount
        - currency
        - transactionType
        - initiator
        - initiatorType
      type: object
    transactionRequestId:
      description: A Mojaloop API transaction request identifier (UUID/ULID).
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    transactionRequestResponse:
      description: A response to a request for a quote.
      properties:
        homeR2PTransactionId:
          type: string
          description: >-
            Transaction ID from the DFSP backend, used to reconcile transactions
            between the Switch and DFSP backend systems.
        transactionId:
          $ref: '#/components/schemas/transactionId'
        transactionRequestState:
          $ref: '#/components/schemas/transactionRequestState'
      required:
        - transactionId
        - transactionRequestState
      type: object
    transactionRequestState:
      enum:
        - RECEIVED
        - PENDING
        - ACCEPTED
        - REJECTED
      type: string
    transactionSubScenario:
      description: Possible sub-scenario, defined locally within the scheme (UndefinedEnum Type). Based on FSPIOP TransactionSubScenario.
      example: LOCALLY_DEFINED_SUBSCENARIO
      pattern: ^[A-Z_]{1,32}$
      title: transactionSubScenario
      type: string
    transactionType:
      enum:
        - TRANSFER
        - DEPOSIT
        - PAYMENT
      type: string
    transactionTypeObject:
      description: Object containing transfer object.
      properties:
        initiator:
          $ref: '#/components/schemas/initiator'
        initiatorType:
          $ref: '#/components/schemas/initiatorType'
        scenario:
          $ref: '#/components/schemas/scenario'
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
      required:
        - scenario
        - initiator
        - initiatorType
      type: object
    transferDetailsResponse:
      properties:
        amount:
          $ref: '#/components/schemas/money'
        amountType:
          $ref: '#/components/schemas/amountType'
        currency:
          $ref: '#/components/schemas/currency'
        extensions:
          $ref: '#/components/schemas/extensionList'
        from:
          $ref: '#/components/schemas/transferParty'
        homeTransactionId:
          description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems.
          type: string
        note:
          maxLength: 128
          type: string
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        timestamp:
          $ref: '#/components/schemas/timestamp'
        to:
          $ref: '#/components/schemas/transferParty'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        transferState:
          $ref: '#/components/schemas/transferState'
      required:
        - homeTransactionId
        - from
        - to
        - amountType
        - currency
        - amount
        - transferState
        - transactionType
        - timestamp
      type: object
    transferId:
      description: A Mojaloop API transfer identifier (UUID/ULID).
      pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-7][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$|^[0-9A-HJKMNP-TV-Z]{26}$
      type: string
    transferParty:
      properties:
        dateOfBirth:
          $ref: '#/components/schemas/dateOfBirth'
        displayName:
          description: Display name of the sender, if known.
          type: string
        extensionList:
          $ref: '#/components/schemas/extensionList'
        firstName:
          description: Party first name.
          type: string
        fspId:
          description: Mojaloop scheme FSPID of the DFSP which owns the party account.
          type: string
        idSubValue:
          $ref: '#/components/schemas/idSubValue'
        idType:
          $ref: '#/components/schemas/idType'
        idValue:
          description: The identifier string used to identify the sender.
          type: string
        lastName:
          description: Party last name.
          type: string
        merchantClassificationCode:
          description: Up to 4 digits specifying the sender's merchant classification, if known and applicable.
          type: string
        middleName:
          description: Party middle name.
          type: string
        type:
          $ref: '#/components/schemas/payerType'
        supportedCurrencies:
          type: array
          description: Currencies in which the party can receive funds.
          items:
            $ref: '#/components/schemas/currency'
          minItems: 0
          maxItems: 16
        kycInformation:
          $ref: ../../../fspiop/v2_0/openapi3/components/schemas/KYCInformation.yaml
      required:
        - idType
        - idValue
      type: object
    transferRequest:
      properties:
        homeR2PTransactionId:
          type: string
          description: >-
            Linked homeR2PTransactionId which was generated as part of POST /requestToPay to SDK incase of requestToPay transfer.
        amount:
          $ref: '#/components/schemas/money'
        amountType:
          $ref: '#/components/schemas/amountType'
        currency:
          $ref: '#/components/schemas/currency'
        from:
          $ref: '#/components/schemas/transferParty'
        ilpPacket:
          properties:
            data:
              $ref: '#/components/schemas/ilpPacketData'
          required:
            - data
          type: object
        note:
          maxLength: 128
          type: string
        quote:
          $ref: '#/components/schemas/quoteResponse'
        quoteRequestExtensions:
          $ref: '#/components/schemas/extensionList'
        subScenario:
          $ref: '../components/schemas/TransactionSubScenario.yaml'
        to:
          $ref: '#/components/schemas/transferParty'
        transactionType:
          $ref: '#/components/schemas/transactionType'
        transferId:
          $ref: '#/components/schemas/transferId'
        transactionRequestId:
          $ref: '#/components/schemas/transactionRequestId'
      required:
        - transferId
        - quote
        - from
        - to
        - amountType
        - currency
        - amount
        - transactionType
        - ilpPacket
      type: object
    transferResponse:
      properties:
        completedTimestamp:
          $ref: '#/components/schemas/timestamp'
        fulfilment:
          $ref: '../components/schemas/IlpFulfilment.yaml'
        homeTransactionId:
          description: Transaction ID from the DFSP backend, used to reconcile transactions between the Switch and DFSP backend systems.
          type: string
        transferState:
          $ref: '../components/schemas/TransferStateFromBackend.yaml'
      required:
        - homeTransactionId
      type: object
    transferState:
      description: |
        Below are the allowed values for the enumeration - RECEIVED DFSP has received the transfer. - RESERVED DFSP has reserved the transfer. - COMMITTED DFSP has successfully performed the transfer. - ABORTED DFSP has aborted the transfer due a rejection or failure to perform the transfer.
      enum:
        - RECEIVED
        - RESERVED
        - COMMITTED
        - ABORTED
      type: string
    transferStatus:
      enum:
        - ERROR_OCCURRED
        - WAITING_FOR_PARTY_ACCEPTANCE
        - WAITING_FOR_QUOTE_ACCEPTANCE
        - COMPLETED
      type: string
    requestToPayCallback:
      description: Callback for requestToPay.
      properties:
        homeR2PTransactionId:
          type: string
          description: >-
            Transaction ID from the DFSP backend, used to reconcile transactions
            between the Switch and DFSP backend systems.
        transactionRequestState:
          $ref: '#/components/schemas/transactionRequestState'
      required:
        - transactionRequestState