post:
  summary: >-
    Used to trigger funds from customer fsp account to merchant fsp account.
    This is a follow-up request to requestToPay.
  description: >
    The HTTP request `POST /requestToPayTransfer` is used to request the
    movement of funds from payer DFSP to payee DFSP.

    The underlying Mojaloop API has three stages for money transfer:

      1. Quotation. This facilitates the exchange of fee information and the construction of a cryptographic "contract" between payee and payer DFSPs before funds are transferred.
      2. Authorization. This facilitates getting OTP from payee DFSP.
      3. Transfer. The enactment of the previously agreed "contract"

    This method has several modes of operation.

    - If the configuration variable `AUTO_ACCEPT_QUOTES` is set to `"false"`
    this method will terminate and return the quotation when it has been
    received from the payee DFSP.
      If the payee wished to proceed with the otp, then a subsequent `PUT /transfers/{transferId}` request (accepting the quote) is required to continue the operation.
      The scheme adapter will then proceed with the transfer state.

    - If the configuration variable `AUTO_ACCEPT_OTP` is set to `"false"` this
    method will terminate and return the otp when it has been received from the
    payee DFSP.
      If the payer wished to proceed with the transfer, then a subsequent `PUT /transfers/{transferId}` request (accepting the quote) is required to continue the operation.
      The scheme adapter will then proceed with the transfer state.

    If the configuration variables `AUTO_ACCEPT_PARTIES` and
    `AUTO_ACCEPT_QUOTES` are both set to `"true"` this method will block until
    all three transfer stages are complete. Upon completion it will return the
    entire set of transfer details received during the operation.


    Combinations of settings for `AUTO_ACCEPT...` configuration variables allow
    the scheme adapter user to decide which mode of operation best suits their
    use cases. i.e. the scheme adapter can be configured to "break" the three
    stage transfer at these points in order to execute backend logic such as
    party verification, quoted fees assessments etc...
  tags:
    - RequestToPayTransfer
  requestBody:
    description: Request To Pay Transfer request body
    content:
      application/json:
        schema:
          $ref: ../../components/schemas/requestToPayTransferRequest.yaml
    required: true
  responses:
    '200':
      $ref: ../../components/responses/requestToPayTransferSuccess.yaml
    '400':
      $ref: ../../components/responses/requestToPayTransferBadRequest.yaml
    '500':
      $ref: ../../components/responses/transferServerError.yaml
    '504':
      $ref: ../../components/responses/transferTimeout.yaml
