Pular para o conteúdo

Create quote collection

Requisição

Creates a collection of quotes for a proposed payment.

Segurança
Bearer
Corpoapplication/jsonobrigatório
sending_addressstringobrigatório

RippleNet account name and address of the sender.

Format: accountname@ripplenetaddress

Example: new_york@rn.us.ny.new_york

Exemplo:"sf@rn.us.ca.san_francisco"
receiving_addressstringobrigatório

RippleNet account name and address of the receiver.

Format: accountname@ripplenetaddress

Example: new_york@rn.us.ny.new_york

Exemplo:"sf_gbp@rn.us.ca.san_francisco"
amountstring, >= 1obrigatório

Amount to be sent or received, depending on the quote_type.

Use this table to determine what amount to assign.

Example: "1"

Quote typeAmount
SENDER_AMOUNTAmount to be sent by the payment originator
SENDER_INSTITUTION_AMOUNTSet to SENDER_INSTITUTION_AMOUNT to calculate the quote based on the amount to be sent, plus any fees collected by the sending institution
RECEIVER_AMOUNTAmount to be received by the payment beneficiary
RECEIVER_INSTITUTION_AMOUNTSet to RECEIVER_INSTITUTION_AMOUNT to calculate the quote based on the amount to be received, minus any fees collected by the receiving institution
Exemplo:"1"
currencystringobrigatório

Currency code of the amount to be sent or received, depending on the quote_type.

Use this table to determine what currency code to assign.

Example: USD

Quote typeCurrency code description
SENDER_AMOUNTSpecify the currency code for the sending currency, for example USD
SENDER_INSTITUTION_AMOUNTSpecify the currency code for the sending currency, for example USD
RECEIVER_AMOUNTSpecify the currency code for the receiving currency, for example USD
RECEIVER_INSTITUTION_AMOUNTSpecify the currency code for the receiving currency, for example USD
Exemplo:"USD"
quote_typestringobrigatório

Specifies how to calculate the quote.

Example: SENDER_AMOUNT

Enum ValueDescription
SENDER_AMOUNT

Quote based on the amount the payment originator or originating institution wants to send

SENDER_INSTITUTION_AMOUNT

Quote based on the amount (to debit the originator) is amount plus any fees to be collected by the sending institution

RECEIVER_AMOUNT

Quote based on the amount the payment beneficiary or beneficiary institution should receive

RECEIVER_INSTITUTION_AMOUNT

The amount (to credit the beneficiary) is amount minus any fees to be collected by the receiving institution

Exemplo:"SENDER_AMOUNT"
sender_or_receiver_currencystring

Currency code of the sender or receiver based on quote_type.

If provided, you can use this to filter the options for quotes.

Exemplo:"USD"
custom_feenumber

Custom fee for the sending account.

Setting this field overrides all fees configured on the sender's RippleNet instance.

custom_rateobject

Custom rate that quotes must use. The request returns only quotes that are able to provide this custom rate.

quote_routeArray of strings

Custom route that quote must follow.

Provide an array of RippleNet address strings that convey the route the quote must follow.

Example: g.us.ca.san_francisco

Exemplo:
[ "rn.us.ca.san_francisco", "rn.us.tx.austin", "rn.us.ny.new_york" ]
payment_methodstring

Payout method for the quote.

Senders can use this field to define the payout method that the receiver should use to deliver the payment to end customer.

On-Demand Liquidity (ODL) receivers should set payment_method to the outlet_id or the string none (not an empty value) to keep funds at the destination exchange when paying out to a local rail.

Caution: The existing quote parameter is named payment_method while elsewhere it is payout_method.

enable_quote_per_payout_methodboolean

Enable this flag to generate quotes using payout methods configured by the receiver.

Exemplo:true
digital_asset_originationboolean

When true, this flag tells RippleNet to provide a full quote as if the payment originates in the specified source fiat currency.

The quote for the source exchange excludes trading fees.

On execution, the source exchange trade is skipped, and XRP is withdrawn from the source exchange as the first step.

Exemplo:false
force_path_finding_and_liquidity_path_findingboolean

When true, this flag tells RippleNet to ignore cached value for path finding and liquidity path finding.

Force performing new path finding and liquidity path finding.

Padrão:false
Exemplo:false
payout_method_categorystring

Category the payout method will be associated with. Defaults to OTHER if not specified.

Enum ValueDescription
REAL_TIME_GROSS_SETTLEMENT_SYSTEM

Real-time gross settlement system

REAL_TIME_NET_SETTLEMENT_SYSTEM

Real-time net settlement system

MASS_NET_PAYMENT_SYSTEM

Mass net payment system

BOOK_TRANSFER

Book transfer

CASH_PAYOUT

Cash payout

WALLET_PAYMENT

Wallet payment

OTHER

Other

Exemplo:"BOOK_TRANSFER"
sender_segregated_accountstring, <= 254 characters

RippleNet account name and address of the sender owned account at receiver to be used for failure conversion (in case of payment failure).

Format: accountname@ripplenetaddress

Example: new_york@rn.us.ny.new_york

Exemplo:"conct_php_receiver_coins_sender@receiver"
quote_limitinteger

Flag for truncating the total amount of quotes to a maximum amount after sorting and filters are applied. Optional.

quote_filter_typesArray of strings

Filter on a type of quote.

Items Enum ValueDescription
LIQUIDITY_WARNINGS

Filter for liquidity warnings

QUOTE_ERRORS

Filter for quote errors

curl -i -X POST \
  https://docs.ripple.com/_mock/pt-br/products/payments-odl/api-docs/ripplenet/reference/openapi/quote_collections \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "sending_address": "sf@rn.us.ca.san_francisco",
    "receiving_address": "sf_gbp@rn.us.ca.san_francisco",
    "amount": "1",
    "currency": "USD",
    "quote_type": "SENDER_AMOUNT",
    "sender_or_receiver_currency": "USD",
    "custom_fee": 0,
    "custom_rate": {
      "rate": 0,
      "base_currency": "string",
      "counter_currency": "string",
      "rate_type": "buy"
    },
    "quote_route": [
      "rn.us.ca.san_francisco",
      "rn.us.tx.austin",
      "rn.us.ny.new_york"
    ],
    "payment_method": "string",
    "enable_quote_per_payout_method": true,
    "digital_asset_origination": false,
    "force_path_finding_and_liquidity_path_finding": false,
    "payout_method_category": "BOOK_TRANSFER",
    "sender_segregated_account": "conct_php_receiver_coins_sender@receiver",
    "quote_limit": 0,
    "quote_filter_types": [
      "LIQUIDITY_WARNINGS"
    ]
  }'

Respostas

Successfully returned quote collection.

Corpoapplication/json
quote_collection_idstring, (uuid)obrigatório

Unique identifier of the quote collection.

Exemplo:"4711728c-cd35-49ec-96a5-72732b4333ec"
quotesArray of objectsobrigatório

For more information on quote elements, see Create quote collections.

quote_errorsArray of objects
Resposta
{ "quote_collection_id": "4711728c-cd35-49ec-96a5-72732b4333ec", "quotes": [ { … } ], "quote_errors": [ { … } ] }