Creates an exchange rate for a specified currency pair.
Example - Applying a margin to the live FX rate:
A USD-GBP live FX rate of 0.80 is provided by a third-party rate provider and you want to reduce that rate by 20 BPS. In this API call, you would set "value_type": "MARGIN", then "margin_type": "BPS", and "rate": "20". After that, during the Get quotes call, the final FX rate will be calculated as 0.80*(1-(20/10000))=0.7984 and then applied during quote creation.
Set to the amount of time in milliseconds that the rate is valid for after the rate's created_date value. Set to 0 to indicate that the rate does not expire. The value returned in the response object for this field is null. Refer to the expires_at value in the response object to verify your expiration offset timing.
Set to the order type for the exchange rate.
This value of this field represents either rate or margin based on what you specify in the value_type field.
If you specify value_type=rate, set the value of this field to the exchange rate for a base and counter currency. The rate can use up to 6 decimal places.
If you specify value_type=margin, set the value of this field depending on the unit of margin you specified in the margin_type field.
Provide the ledger object to create an exchange rate that applies to exchanges between a specific source ledger and destination ledger. You can provide either the ledger object or account object, but not both.
Provide the account object to create an exchange rate that applies to exchanges between a specific source ledger account and destination ledger account. You can provide either the account object or ledger object, but not both.
To create a slab-based exchange rate, provide the lower limit of the slab. You must also provide an upper_limit value.
To create a slab-based exchange rate, provide the upper limit of the slab. You must also provide a lower_limit value.
Specify whether you want to use a live exchange rate (MARGIN) or an exchange rate manually configured by Ripple (RATE). If you set this value to MARGIN, you must also provide margin_type.
- Mock serverhttps://docs.ripple.com/_mock/pt-br/products/payments-odl/api-docs/ripplenet/reference/openapi/config/rates
- https://[domainPrefix].ripplexcurrent.com/v4https://[domainPrefix].ripplexcurrent.com/v4/config/rates
curl -i -X POST \
https://docs.ripple.com/_mock/pt-br/products/payments-odl/api-docs/ripplenet/reference/openapi/config/rates \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"expiration_offset": 95000,
"order_type": "buy",
"rate": 0.89,
"base_currency": "USD",
"counter_currency": "GBP",
"ledger": {
"source_ledger": "rn.eur.uk.london",
"destination_ledger": "rn.eur.uk.london"
},
"account": {
"source_ledger": "rn.eur.uk.london",
"destination_ledger": "rn.eur.uk.london",
"source_ledger_account": "alias_usd_lon",
"destination_ledger_account": "conct_gbp_lon"
},
"lower_limit": 0,
"upper_limit": 1000,
"payout_method": "LOCAL_RAILS",
"value_type": "MARGIN",
"margin_type": "BPS"
}'Successfully created rate.
Unique identifier of the exchange rate.
(DEPRECATED) This property is deprecated. Refer to expires_at to determine rate expiration.
Amount of time in milliseconds that the rate is valid for after the rate's created_date value. For example, if the expiration_offset value is 100000 milliseconds, the rate expires 100000 milliseconds after this created_date value. If set to 0, the rate does not expire.
Number of decimal places to which the exchange rate is calculated. For example, if the rate_scale value is set to 9 and the rate value is set to 1.25, the scaled value of the rate is 1.250000000.
If order_type is set to buy, this is set to the base currency. If order_type is set to sell, this is set to the counter currency.
If order_type is set to buy, this is set to the counter currency. If order_type is set to sell, this is set to the base currency.
Source ledger associated with the exchange rate.
Destination ledger associated with the exchange rate.
Account on the source ledger associated with rate.
Account on the destination ledger associated with rate.
Date and time at which the exchange rate was created, as an ISO-8601 timestamp in UTC. Fiat determines a rate's expiration date and time based on this value and expiration_offset value. For example, if the expiration_offset value is 100000 milliseconds, the rate expires 100000 milliseconds after this created_date value.
For a slab-based exchange rate, indicates the lower limit of the slab.
For a slab-based exchange rate, indicates the upper limit of the slab.
Indicates whether the rate is a live exchange rate (MARGIN) or an exchange rate manually configured by Ripple (RATE). If this value is MARGIN, then margin_type will show a value.
{ "rate_id": "328b3e50-7983-46d5-94a0-ef004d78db1d", "expiration_offset": 95000, "order_type": "buy", "rate_scale": 9, "rate": 0.89, "base_currency": "USD", "counter_currency": "GBP", "source_currency": "USD", "destination_currency": "GBP", "source_ledger": "rn.eur.uk.london", "destination_ledger": "rn.eur.uk.london", "source_ledger_account": "alias_usd_lon", "destination_ledger_account": "conct_gbp_lon", "created_date": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "lower_limit": 0, "upper_limit": 1000, "payout_method": "LOCAL_RAILS", "value_type": "MARGIN", "margin_type": "BPS" }