Pular para o conteúdo

Execute exchange transfer

Requisição

Execute an exchange transfer to move funds from one of your accounts in one currency (USD, for example) to another one of your accounts in another currency (EUR, for example) at an exchange rate set by your peer who maintains both of your accounts on their ledger. An exchange transfer enables you to fund a foreign currency account from your domestic currency account in bulk.

Before you make this request, you may want to use the Quote Exchange Transfer request to see a quote for the exchange transfer you want to make.

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

RippleNet account name and address of the sender, in the format accountname@ripplenetaddress. For example, new_york@rn.us.ny.new_york.

Exemplo:"alias_usd_lon@rn.eur.uk.london"
receiver_addressstringobrigatório

RippleNet account name and address of the receiver, in the format accountname@ripplenetaddress. For example, new_york@rn.us.ny.new_york.

Exemplo:"conct_gbp_lon@rn.eur.uk.london"
amountnumber, >= 0obrigatório

Amount transferred, expressed in the curency of the account indicated by the amount_type value.

Exemplo:100
amount_typestringobrigatório

Amount type used for the exchange transfer.

To indicate that the amount is expressed in the currency of the account provided by the sender_address value, set to SENDER_AMOUNT.

To indicate that the amount is expressed in the currency of the account provided by the receiver_address value, set to RECEIVER_AMOUNT.

Enum:"SENDER_AMOUNT""RECEIVER_AMOUNT"
Exemplo:"SENDER_AMOUNT"
end_to_end_idstring, <= 128 characters

ID set by the sender that is persisted on all fiat node instances that participated in the transfer.

Exemplo:378910
internal_idstring, <= 128 characters

Internal ID that the sender can optionally specify. Only visible to the sender. Only the sending fiat node instance stores this ID.

Exemplo:1987
user_infoobject

Provide one or more arbitrary key/value pairs.

curl -i -X POST \
  https://docs.ripple.com/_mock/pt-br/products/payments-odl/api-docs/ripplenet/reference/openapi/exchange_transfers/execute \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "sender_address": "alias_usd_lon@rn.eur.uk.london",
    "receiver_address": "conct_gbp_lon@rn.eur.uk.london",
    "amount": 100,
    "amount_type": "SENDER_AMOUNT",
    "end_to_end_id": 378910,
    "internal_id": 1987,
    "user_info": {}
  }'

Respostas

Successfully executed exchange transfer.

Corpoapplication/json
exchange_transfer_idstring, (uuid)obrigatório

Unique identifier of the exchange transfer.

Exemplo:"e3b20ba4-28ed-4752-990d-e67887bb331e"
statestringobrigatório

State of the exchange transfer.

Enum:"EXECUTED""COMPLETED""FAILED"
Exemplo:"EXECUTED"
typestringobrigatório

Indicates the exchange transfer's quoted FX rate type.

Padrão:"FIRM"
Enum ValueDescription
FIRM

A firm exchange rate ensures that the quoted and delivered transfer amounts are equal.

INDICATIVE

An indicative exchange rate allows for movement between quoted rate and transfer execution, such that the quoted amount and delivered amount may differ.

Exemplo:"INDICATIVE"
sender_addressstringobrigatório

RippleNet account name and address of the sender, in the format accountname@ripplenetaddress. For example, new_york@rn.us.ny.new_york.

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

RippleNet account name and address of the receiver, in the format accountname@ripplenetaddress. For example, new_york@rn.us.ny.new_york.

Exemplo:"sf_gbp@rn.us.ca.san_francisco"
source_amountnumberobrigatório

Sending amount of the exchange transfer.

Exemplo:1
destination_amountnumberobrigatório

Receiving amount of the exchange transfer.

Exemplo:355
source_currencystringobrigatório

Sending currency of the exchange transfer.

Exemplo:"USD"
destination_currencystringobrigatório

Receiving currency of the exchange transfer.

Exemplo:"GBP"
fx_transfer_rateobjectobrigatório

Rate used to make the exchange transfer.

end_to_end_idstringobrigatório

ID set by the sender that is persisted on all fiat node instances that participated in the transfer.

internal_idstringobrigatório

Internal ID that the sender can optionally specify. Only visible to the sender. Only the sending fiat node instance stores this ID.

user_infoArray of objectsobrigatório

Custom information set by a RippleNet address involved in the exchange transfer.

Resposta
{ "exchange_transfer_id": "e3b20ba4-28ed-4752-990d-e67887bb331e", "state": "EXECUTED", "type": "INDICATIVE", "sender_address": "sf@rn.us.ca.san_francisco", "receiver_address": "sf_gbp@rn.us.ca.san_francisco", "source_amount": 1, "destination_amount": 355, "source_currency": "USD", "destination_currency": "GBP", "fx_transfer_rate": { "rate": 0.89, "base_currency": "USD", "counter_currency": "GBP", "rate_type": "BUY" }, "end_to_end_id": "string", "internal_id": "string", "user_info": [ { … } ] }