You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
GET currencies/convert_from_default_currency
This method accepts a value (price rate, amount) in CRM.COM's default currency and converts it into another currency value. The method uses the effective currency period rate in order to convert the value from the default currency to the required currency.
Resource URL
Parameters
Name | Type | Description |
token (mandatory) | String | The token retrieved from the login method |
value (mandatory) | Number | The value in CRM.COM's default currency that will be converted into another currency's value |
currency_identifier (mandatory) | Currency Identifier | The identifier of the currency to which value will be converted to. The allowed currency identifier fields are the following:Name | Type | Description |
---|
id (semi-optional) | String | The ID of the currency | code (semi-optional) | String | The code of the currency |
|
Restrictions
- It is mandatory to specify one of the semi-optional parameters.
Response Data
Name | Type | Description |
value
| Number | The value in the default currency |
converted_value | Number | The converted value into the required currency |
default_currency | Currency Object | CRM.COM's default currency as this is defined in General Settings |
currency_period_rate | Currency Period Rate Object | The Currency Rate Period of the Currency to which the value in the default currency was converted |
Referred Objects Response Data
currency object response data
Name | Type | Description |
---|
id | String | The ID of the retrieved currency |
code | String | The code of the retrieved currency |
prefix_symbol | String | The prefix symbol for the specified currency |
suffix_symbol | String | The suffix symbol for the specified currency |
life_cycle_state | String | The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE |
integer_part_name | String | The integer part name for the specified currency |
decimal_part_name | String | The decimal part name for the specified currency |
currency rate period object response data
Name | Type | Description |
---|
id | String | The ID of the retrieved currency rate period |
rate | Number | The exchange rate of the currency rate period |
inverse_rate | Number | The inverse exchange rate of the currency rate period |
from_date | Date | The date from which the exchange rate is valid |
to_date | Date | The date until which the exchange rate is valid |
currency | Currency Object | The Currency with which the returned exchange rate information refers to |
Referred Objects Response Data
currency object response data
Name | Type | Description |
---|
id | String | The ID of the retrieved currency |
code | String | The code of the retrieved currency |
prefix_symbol | String | The prefix symbol for the specified currency |
suffix_symbol | String | The suffix symbol for the specified currency |
life_cycle_state | String | The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE |
integer_part_name | String | The integer part name for the specified currency |
decimal_part_name | String | The decimal part name for the specified currency |
Examples
Example 1
HTTP Method: GET
Request:
Response:
{
"data": {
"converted_value": 4.6,
"currency_period_rate": {
"from_date": "C7D7ED57F21B47028144967E015DCBE5",
"to_date": 2.3,
"rate": 2.3,
"inverse_rate": 0.23000000417232513,
"currency": {
"decimal_part_name": null,
"code": "GBP",
"integer_part_name": null,
"prefix": "£",
"id": "9",
"suffix": null
},
"id": "C7D7ED57F21B47028144967E015DCBE5"
},
"default_currency": {
"decimal_part_name": null,
"code": "EUR",
"integer_part_name": null,
"prefix": "€",
"id": "2",
"suffix": null
},
"value": "2"
},
"status": {
"code": "OK",
"description": "",
"message": ""
}
}