Pular para o conteúdo

Create quote collection

Requisição

Creates a collection of quotes for a proposed payment, one for each payment rail available for the corridor. A payment rail Ripple can't price is left out. Each quote has its own quoteId, paymentRail, exchange rate, and fees, and all quotes in the collection have the same expiry time. To create the payment, use the quoteId of the quote you choose.

To request a quote for one payment rail only, include paymentRail. For valid values, see Payment rail reference.

Request notes:

  • payoutCategory and destinationBlockchainNetwork aren't part of the request. For a stablecoin payout, the blockchain network is the payment rail, and you omit destinationCountry.
  • paymentRail is an optional request field.
  • The payinCategory values FUNDED and T_PLUS_ONE are not accepted. Use PRE_FUNDING in place of FUNDED, and CREDIT_FUNDING in place of T_PLUS_ONE.
Segurança
Bearer
Corpoapplication/jsonobrigatório

Create quote collection request

quoteAmountnumber, (double), >= 1obrigatório

The amount for which you wish to receive a collection of quotes.

Exemplo:123.45
quoteAmountTypestringobrigatório

The type of amount for which you want to get a quote.

Padrão:"SOURCE_AMOUNT"
Enum ValueDescription
SOURCE_AMOUNT

Specify this value to get a quote for the amount that you want to send.

DESTINATION_AMOUNT

Specify this value to get a quote for the amount that the beneficiary should receive.

sourceCurrencystring^[a-zA-Z]{3,5}$obrigatório

The currency code of the currency that you are sending.

Exemplo:"USD"
destinationCurrencystring^[a-zA-Z]{3,5}$obrigatório

The currency code of the currency in which your beneficiary will receive this payment.

Exemplo:"MXN"
sourceCountrystring^[a-zA-Z]{2}$

The country code of the country from where you are sending the funds. This is an ISO 3166-1 alpha-2 code.

Exemplo:"US"
destinationCountrystring^[a-zA-Z]{2}$

The country where the beneficiary is located specified in Alpha-2 Code format as defined in the ISO CountryCode ISO 3166-1 list. If the beneficiary is an individual, then this value is their country of residence. If the beneficiary is an institution, then this value is their country of incorporation.

Required for a fiat payout; omitting it returns USR_017. Omit it for a stablecoin payout, or the request fails.

Exemplo:"MX"
payinCategorystring, [ 1 .. 128 ] charactersobrigatório

The name of the pay in category indicating how this payment will be funded.

Enum ValueDescription
PRE_FUNDING

Indicates that the payment is being made from funds you've deposited with Ripple.

CREDIT_FUNDING

Indicates the payment is being made and you will pay the outstanding invoice.

JIT_FUNDING

Indicates that the payment is being made and you will pay the outstanding amount before the payment expires.

Exemplo:"PRE_FUNDING"
paymentRailstring, [ 1 .. 50 ] characters

The payment rail to quote. Include it to request a quote for this payment rail only. If you omit it, the collection contains a quote for each payment rail available for the corridor. For valid values, see Payment rail reference.

Exemplo:"SPEI"
curl -i -X POST \
  https://docs.ripple.com/_mock/pt-br/products/payments-direct-2/api-docs/payments-direct-api/payments-direct-2-api/v3/quotes/quote-collection \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "quoteAmount": 123.45,
    "quoteAmountType": "SOURCE_AMOUNT",
    "sourceCurrency": "USD",
    "destinationCurrency": "MXN",
    "sourceCountry": "US",
    "destinationCountry": "MX",
    "payinCategory": "PRE_FUNDING",
    "paymentRail": "SPEI"
  }'

Respostas

Creates a collection of quotes

Corpoapplication/json
quoteCollectionIdstring, (uuid), [ 1 .. 36 ] charactersobrigatório

Unique ID that represents this quote collection.

Exemplo:"11111111-aaaa-2222-bbbb-222222222222"
quotesArray of objects, >= 0 itemsobrigatório

List of quotes

Resposta
{ "quoteCollectionId": "11111111-aaaa-2222-bbbb-222222222222", "quotes": [ { … } ] }