v1

latestOpenAPI 3.0.02026-08-06102185472.3 KB
Non-orchestration payments

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.

post/quote_collections/return

Request body

original_payment_idstring uuid required

ID of the original payment to be returned.

return_reasonsobject

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_feenumber

Custom fee charged and collected by the sending account. Setting this field overrides all applicable fees configured on the sender's RippleNet instance.

force_path_finding_and_liquidity_path_findingboolean

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_addressstring

The desired receiving account for the return payment as a RippleNet address. This account must be owned by the original payment's sender.

Example request

{
  "original_payment_id": "d485f100-2af7-4e48-9ab1-3c7e28775691",
  "return_reasons": {
    "REASON": "Wrong receiving amount",
    "TYPE": "Account Error",
    "CODE": "A-999"
  },
  "return_amount_type": "TOTAL_RECEIVED_MINUS_FEES",
  "receiver_address": "sf@rn.us.ca.san_francisco"
}

Response

Successfully returned a collection of quotes to return a payment.

quote_collection_idstring uuid required

Unique identifier of the quote collection.

Example response

{
  "quote_collection_id": "4711728c-cd35-49ec-96a5-72732b4333ec",
  "quotes": [
    {
      "quote_id": "2a547e56-4aac-4375-86a8-8b3e7014801d",
      "created_at": "2020-01-29T20:59:44.925Z",
      "expires_at": "2020-01-29T21:29:44.925Z",
      "type": "SENDER_AMOUNT",
      "price_guarantee": "FIRM",
      "sender_address": "sf@rn.us.ca.san_francisco",
      "receiver_address": "sf_gbp@rn.us.ca.san_francisco",
      "amount": "1",
      "currency_code": "USD",
      "currency_code_filter": "EUR",
      "quote_elements": [
        {
          "quote_element_id": "259189e7-cb14-42e7-99ef-375f3285e356",
          "quote_element_type": "EXCHANGE",
          "quote_element_order": "1",
          "sender_address": "sf@rn.us.ca.san_francisco",
          "receiver_address": "sf_gbp@rn.us.ca.san_francisco",
          "sending_amount": 1,
          "receiving_amount": 355,
          "sending_currency_code": "USD",
          "receiving_currency_code": "GBP",
          "fx_rate": {
            "rate": 3.25,
            "base_currency_code": "USD",
            "counter_currency_code": "GBP",
            "type": "buy"
          }
        }
      ],
      "payment_method": "LOCAL_RAILS",
      "payment_method_fields": "{\"category_id\":\"bank\",\"required_originator_fields\":[{\"field_name\":\"sender_address\",\"field_label\":\"Sender address\"}]}",
      "payout_method_info": {
        "payout_method_name": "Cash Payout",
        "payout_method_category": "BOOK_TRANSFER",
        "description": "local rails",
        "estimated_time_to_credit": "3 days"
      }
    }
  ],
  "quote_errors": [
    {
      "failed_path": [
        {
          "account_liquidity_relationship_id": "480e3a6f-3bcd-48cd-9ce9-9d940aa3c9c6",
          "peer_liquidity_relationship_id": "480e3a6f-3bcd-48cd-9ce9-9d940aa3c9c6"
        }
      ]
    }
  ]
}