---
title: "Create quote to return payment"
method: POST
path: "/quote_collections/return"
tags: ["Non-orchestration payments"]
---

# Create quote to return payment

`POST /quote_collections/return`

Creates a collection of quotes that can be used to return a payment.

The receiver can make this request while the payment is in states `EXECUTED`, `COMPLETED`, or `FAILED`. When the returned payment is successfully moved to the `COMPLETED` state, the original payment is moved to the `RETURNED` state.

**Note**: Currently, when making a Return Payment to a RippleNet Cloud account on a RippleNet ledger, the RippleNet user must lock and complete the payment. This means that the RippleNet user takes all action on the return: Get and Accept Quote, Lock, Settle, and Complete payment.

## Request body

- PaymentReturnQuoteRequest — Use this JSON request object to generate a collection of quotes that can be used to return a payment.
  - `original_payment_id` string, uuid, required — ID of the original payment to be returned.
  - `return_reasons` object — Object with `key` and `value` pairs that describe the reason the payment is being returned. The fields should contain the following `key` values: `reason`, `code`, and `type`. These values are included in a payment created from a quote in the response. They are included in the `user_info.returned` array for the node sending the return payment.
  - `return_amount_type` 'TOTAL_RECEIVED' | 'TOTAL_RECEIVED_MINUS_FEES' — Amount type of the return payment.<p>To indicate that the sender of the return payment will send the amount it received, set to `TOTAL_RECEIVED`.</p><p>To indicate that the sender of the return payment will send the amount it received minus its receiving fees, set to `TOTAL_RECEIVED_MINUS_FEES`.</p>
  - `custom_fee` number — Custom fee charged and collected by the sending account. Setting this field overrides all applicable fees configured on the sender's RippleNet instance.
  - `custom_rate` PaymentQuoteCustomRateRequest — JSON request object to specify a custom exchange rate during quote collection generation.
    - `rate` number, required — Exchange rate for a base and counter currency.
    - `base_currency` string, required — Base currency of the exchange rate.
    - `counter_currency` string, required — Counter currency of the exchange rate.
    - `rate_type` 'buy' | 'sell', required — Order type for the exchange rate. Valid values are `sell` or `buy`. <p><ul><li>When rate_type = buy, `base_currency` is source ccy and `counter_currency` is destination ccy.</li> <li>When rate_type = sell, `base_currency` is destination ccy and `counter_currency` is source ccy.</li> </ul></p>
  - `force_path_finding_and_liquidity_path_finding` boolean — When true, this flag tells RippleNet to ignore cached value for path finding and liquidity path finding and perform new path finding and liquidity path finding.
  - `receiver_address` string — The desired receiving account for the return payment as a RippleNet address. This account must be owned by the original payment's sender.

## Response `200`

Successfully returned a collection of quotes to return a payment.

- QuoteCollection — When provided as a response to the [Create quote collection](#operation/createQuoteCollection) request, provides a JSON object representing quotes for a proposed payment. <p>When provided as a response to the [Create quote to return payment](#operation/createQuoteToReturnPayment) request, provides a JSON object representing quotes for a proposed return payment.</p> <p>When provided as a response to the [Reverse Payment](#operation/createQuoteToReversePayment) request, provides a JSON object representing a quote for a proposed reverse payment.</p> <p>When provided as a response to the [Get quote collection by ID](#operation/createQuoteCollection) request, provides the requested quote collection.</p>
  - `quote_collection_id` string, uuid, required — Unique identifier of the quote collection.
  - `quotes` Quote[], required — For more information on quote elements, see [Create quote collections](/products/payments-odl/api-docs/ripplenet/tutorials/configure-fees#create-quote-collections).
    - `quote_id` string, uuid, required — Unique identifier for the quote.
    - `created_at` string, date-time, required — Date and time at which the quote was created, as an ISO-8601 timestamp in UTC.
    - `expires_at` string, date-time, required — Date and time after which the quote and its pricing expire, as an ISO-8601 timestamp in UTC.
    - `type` 'SENDER_AMOUNT' | 'RECEIVER_AMOUNT' | 'SENDER_INSTITUTION_AMOUNT' | 'RECEIVER_INSTITUTION_AMOUNT' | 'REVERSAL_AMOUNT', required — Indicates how the amount field should be treated for calculating quote values.
    - `price_guarantee` string, required — Indicates whether a quote's pricing is `INDICATIVE` or `FIRM`. An `INDICATIVE` quote allows for price movements between quote issuance and payment execution, such that the quoted amount and delivered amount may differ. A `FIRM` quote ensures that the quoted and delivered payment amounts are equal.
    - `sender_address` string, required — RippleNet account name and address of the sender, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
    - `receiver_address` string, required — RippleNet account name and address of the receiver, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
    - `amount` string, required — Amount to be sent or received, depending on the `type` value.
    - `currency_code` string, required — Currency code for the `amount` value.
    - `currency_code_filter` string, required — Currency code that can be used to filter quotes at the opposite end of the quote request. For example, you can filter by this currency code to find the receiving currency for a quote with a `SENDER_AMOUNT` quote_type. If not sent in the request, this field value is set to `null`.
    - `service_type` string, required — Returns `null`.
    - `quote_elements` QuoteElement[], required — Transfer and exchange elements. A transfer element represents a movement of funds between two accounts. An exchange element represents the exchange of currencies between two accounts.
      - `quote_element_id` string, uuid, required — Unique identifier for the quote element.
      - `quote_element_type` 'TRANSFER' | 'EXCHANGE' | 'EXCHANGE_TRADE' | 'CRYPTO_TRANSFER', required — Type of quote element.<p><ul> <li>`TRANSFER` represents the movement of funds between two accounts.</li> <li>`EXCHANGE` represents the exchange of currencies between two accounts.</li> <li>`EXCHANGE_TRADE` represents the exchange of fiat to digital currency on a digital exchange.</li> <li>`CRYPTO_TRANSFER` represents the movement of digital funds between two digital exchanges.</li> </ul></p>
      - `quote_element_order` string, required — Order of each quote element along the liquidity path. If a quote includes five quote elements, each one is enacted according to its quote_element_order number to make the proposed payment.
      - `sender_address` string, required — RippleNet account name and address of the sender, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
      - `receiver_address` string, required — RippleNet account name and address of the receiver, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
      - `sending_amount` number, required — Amount the sender is sending.
      - `receiving_amount` number, required — Amount the receiver is receiving.
      - `sending_fee` number, required — Fees the sender is charging. When `quote_element_type` is set to `EXCHANGE`, this field value is always set to `0`.
      - `receiving_fee` number, required — Fees the receiver is charging. When `quote_element_type` is set to `EXCHANGE`, this field value is always set to `0`.
      - `sending_currency_code` string — Currency code of the sending amount. Included in quote elements with `quote_element_type` set to `EXCHANGE`.
      - `receiving_currency_code` string — Currency code of the receiving amount. Included in quote elements with `quote_element_type` set to `EXCHANGE`.
      - `fx_rate` FXRate — The details of an FX Rate for a quote or payment.
        - `rate` number, required — Exchange rate between a base and counter currency.
        - `base_currency_code` string, required — Currency code of the base currency.
        - `counter_currency_code` string, required — Currency code of the counter currency.
        - `type` string, required — Order type of the exchange rate. Valid values are `buy` or `sell`.
      - `transfer_currency_code` string — Currency code of the transfer. Included in quote elements with `quote_element_type` set to `TRANSFER`.
    - `liquidity_warning` string, required — Triggered when a quote causes an account to go below its `minimum_allowed_balance`. Otherwise, this field value is set to `null`.
    - `payment_method` string — Payout method for the quote.
    - `payment_method_fields` string — JSON object containing payment method metadata.
    - `payout_method_info` object — Details about the payout method.
      - `payout_method_name` string — Payout method for the quote.
      - `payout_method_category` 'REAL_TIME_GROSS_SETTLEMENT_SYSTEM' | 'REAL_TIME_NET_SETTLEMENT_SYSTEM' | 'MASS_NET_PAYMENT_SYSTEM' | 'BOOK_TRANSFER' | 'CASH_PAYOUT' | 'WALLET_PAYMENT' | 'OTHER' — Category of the payout method. Defaults to <code>OTHER</code> if not specified.
      - `description` string — User defined description of the payout method.
      - `estimated_time_to_credit` string — The estimated time to credit the beneficiary using this payout method.
  - `quote_errors` QuoteError[]
    - `failed_path` QuotePathRos[], required — Quote path that failed.
      - `source` string, required — RippleNet account name and address of the source account, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
      - `destination` string, required — RippleNet account name and address of the destination account, in the format `accountname@ripplenetaddress`. For example, `new_york@rn.us.ny.new_york`.
      - `source_currency` string, required — Currency associated with the source account.
      - `destination_currency` string, required — Currency associated with the destination account.
      - `account_liquidity_relationship_id` string, uuid — Unique identifier for an account liquidity relationship.
      - `peer_liquidity_relationship_id` string, uuid — Unique identifier for a peer liquidity relationship.
    - `error_origin` string — RippleNet address of where the error originated. For example, `rn.us.ny.new_york`.
    - `error_message` string, required — Message that describes the error.

## Other responses

- `400` — Bad request.
- `404` — Payment not found.
- `500` — Server Error - an internal error occured while making Return Quote calls.

---

[API](https://skmtc.dev/ripple/apis/ripplenet-server-api.md) · [All operations](https://skmtc.dev/ripple/apis/ripplenet-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ripple/ripplenet-server-api/revisions/7843f07ca150/schema)
