# Create quote to return payment 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. Endpoint: POST /quote_collections/return Version: 4.0.0 Security: Bearer ## Request fields (application/json): - `original_payment_id` (string, required) ID of the original payment to be returned. Example: "d485f100-2af7-4e48-9ab1-3c7e28775691" - `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. Example: {"REASON":"Wrong receiving amount","TYPE":"Account Error","CODE":"A-999"} - `return_amount_type` (string) Amount type of the return payment.To indicate that the sender of the return payment will send the amount it received, set to TOTAL_RECEIVED.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. Enum: "TOTAL_RECEIVED", "TOTAL_RECEIVED_MINUS_FEES" - `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` (object) JSON request object to specify a custom exchange rate during quote collection generation. - `custom_rate.rate` (number, required) Exchange rate for a base and counter currency. - `custom_rate.base_currency` (string, required) Base currency of the exchange rate. - `custom_rate.counter_currency` (string, required) Counter currency of the exchange rate. - `custom_rate.rate_type` (string, required) Order type for the exchange rate. Valid values are sell or buy. When rate_type = buy, base_currency is source ccy and counter_currency is destination ccy. When rate_type = sell, base_currency is destination ccy and counter_currency is source ccy. Enum: "buy", "sell" - `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. Example: "sf@rn.us.ca.san_francisco" ## Response 200 fields (application/json): - `quote_collection_id` (string, required) Unique identifier of the quote collection. Example: "4711728c-cd35-49ec-96a5-72732b4333ec" - `quotes` (array, required) For more information on quote elements, see [Create quote collections](/products/payments-odl/api-docs/ripplenet/tutorials/configure-fees#create-quote-collections). - `quotes.quote_id` (string, required) Unique identifier for the quote. Example: "2a547e56-4aac-4375-86a8-8b3e7014801d" - `quotes.created_at` (string, required) Date and time at which the quote was created, as an ISO-8601 timestamp in UTC. Example: "2020-01-29T20:59:44.925Z" - `quotes.expires_at` (string, required) Date and time after which the quote and its pricing expire, as an ISO-8601 timestamp in UTC. Example: "2020-01-29T21:29:44.925Z" - `quotes.type` (string, required) Indicates how the amount field should be treated for calculating quote values. Enum: "SENDER_AMOUNT", "RECEIVER_AMOUNT", "SENDER_INSTITUTION_AMOUNT", "RECEIVER_INSTITUTION_AMOUNT", "REVERSAL_AMOUNT" - `quotes.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. Example: "FIRM" - `quotes.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. Example: "sf@rn.us.ca.san_francisco" - `quotes.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. Example: "sf_gbp@rn.us.ca.san_francisco" - `quotes.amount` (string, required) Amount to be sent or received, depending on the type value. Example: "1" - `quotes.currency_code` (string, required) Currency code for the amount value. Example: "USD" - `quotes.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. Example: "EUR" - `quotes.service_type` (string, required) Returns null. - `quotes.quote_elements` (array, 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. - `quotes.quote_elements.quote_element_id` (string, required) Unique identifier for the quote element. Example: "259189e7-cb14-42e7-99ef-375f3285e356" - `quotes.quote_elements.quote_element_type` (string, required) Type of quote element. TRANSFER represents the movement of funds between two accounts. EXCHANGE represents the exchange of currencies between two accounts. EXCHANGE_TRADE represents the exchange of fiat to digital currency on a digital exchange. CRYPTO_TRANSFER represents the movement of digital funds between two digital exchanges. Enum: "TRANSFER", "EXCHANGE", "EXCHANGE_TRADE", "CRYPTO_TRANSFER" - `quotes.quote_elements.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. Example: "1" - `quotes.quote_elements.sending_amount` (number, required) Amount the sender is sending. Example: 1 - `quotes.quote_elements.receiving_amount` (number, required) Amount the receiver is receiving. Example: 355 - `quotes.quote_elements.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. - `quotes.quote_elements.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. - `quotes.quote_elements.sending_currency_code` (string) Currency code of the sending amount. Included in quote elements with quote_element_type set to EXCHANGE. Example: "USD" - `quotes.quote_elements.receiving_currency_code` (string) Currency code of the receiving amount. Included in quote elements with quote_element_type set to EXCHANGE. Example: "GBP" - `quotes.quote_elements.fx_rate` (object) The details of an FX Rate for a quote or payment. - `quotes.quote_elements.fx_rate.rate` (number, required) Exchange rate between a base and counter currency. Example: 3.25 - `quotes.quote_elements.fx_rate.base_currency_code` (string, required) Currency code of the base currency. Example: "USD" - `quotes.quote_elements.fx_rate.counter_currency_code` (string, required) Currency code of the counter currency. Example: "GBP" - `quotes.quote_elements.fx_rate.type` (string, required) Order type of the exchange rate. Valid values are buy or sell. Example: "buy" - `quotes.quote_elements.transfer_currency_code` (string) Currency code of the transfer. Included in quote elements with quote_element_type set to TRANSFER. - `quotes.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. - `quotes.payment_method` (string) Payout method for the quote. Example: "LOCAL_RAILS" - `quotes.payment_method_fields` (string) JSON object containing payment method metadata. Example: "{\"category_id\":\"bank\",\"required_originator_fields\":[{\"field_name\":\"sender_address\",\"field_label\":\"Sender address\"}]}" - `quotes.payout_method_info` (object) Details about the payout method. - `quotes.payout_method_info.payout_method_name` (string) Payout method for the quote. Example: "Cash Payout" - `quotes.payout_method_info.payout_method_category` (string) Category of the payout method. Defaults to OTHER if not specified. Enum: "REAL_TIME_GROSS_SETTLEMENT_SYSTEM", "REAL_TIME_NET_SETTLEMENT_SYSTEM", "MASS_NET_PAYMENT_SYSTEM", "BOOK_TRANSFER", "CASH_PAYOUT", "WALLET_PAYMENT", "OTHER" - `quotes.payout_method_info.description` (string) User defined description of the payout method. Example: "local rails" - `quotes.payout_method_info.estimated_time_to_credit` (string) The estimated time to credit the beneficiary using this payout method. Example: "3 days" - `quote_errors` (array) - `quote_errors.failed_path` (array, required) Quote path that failed. - `quote_errors.failed_path.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. - `quote_errors.failed_path.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. - `quote_errors.failed_path.source_currency` (string, required) Currency associated with the source account. - `quote_errors.failed_path.destination_currency` (string, required) Currency associated with the destination account. - `quote_errors.failed_path.account_liquidity_relationship_id` (string) Unique identifier for an account liquidity relationship. Example: "480e3a6f-3bcd-48cd-9ce9-9d940aa3c9c6" - `quote_errors.failed_path.peer_liquidity_relationship_id` (string) Unique identifier for a peer liquidity relationship. Example: "480e3a6f-3bcd-48cd-9ce9-9d940aa3c9c6" - `quote_errors.error_origin` (string) RippleNet address of where the error originated. For example, rn.us.ny.new_york. - `quote_errors.error_message` (string, required) Message that describes the error. ## Response 400 fields (application/json): - `type` (string) URL to the error documentation. Example: "https://errors.ripplenet.ripple.com/error/json-processing-error" - `title` (string) Summary of the returned problem. Example: "Invalid Request Object" - `detail` (string) Description of the returned problem. Example: "The request parameter [account_id] is not in the correct format." - `status` (number) HTTP error code. Example: 400 - `ripplenet_error_code` (string) RippleNet specific error code. Example: "E0104" - `finality` (string) Specifies if the request can be retried for a successful response. Example: "PERMANENT" ## Response 404 fields (application/json): - `type` (string) URL to the error documentation. Example: "https://errors.ripplenet.ripple.com/error/json-processing-error" - `title` (string) Summary of the returned problem. Example: "Invalid Request Object" - `detail` (string) Description of the returned problem. Example: "The request parameter [account_id] is not in the correct format." - `status` (number) HTTP error code. Example: 400 - `ripplenet_error_code` (string) RippleNet specific error code. Example: "E0104" - `finality` (string) Specifies if the request can be retried for a successful response. Example: "PERMANENT" ## Response 500 fields (application/json): - `type` (string) URL to the error documentation. Example: "https://errors.ripplenet.ripple.com/error/json-processing-error" - `title` (string) Summary of the returned problem. Example: "Invalid Request Object" - `detail` (string) Description of the returned problem. Example: "The request parameter [account_id] is not in the correct format." - `status` (number) HTTP error code. Example: 400 - `ripplenet_error_code` (string) RippleNet specific error code. Example: "E0104" - `finality` (string) Specifies if the request can be retried for a successful response. Example: "PERMANENT"