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_to_default_currency
This method accepts a value (price rate, amount) in a currency and converts it into CRM.COM's default currency value. The method uses the effective currency period rate in order to convert the value into the default currency.
Resource URL
Parameters
Name | Type | Description |
token (mandatory) | String | The token retrieved from the login method |
value (mandatory) | Number | The value that will be converted into CRM.COM default currency value |
currency_identifier (mandatory) | Currency Identifier | The identifier of the provided value's related currency. 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 that was converted into CRM.COM default currency value |
converted_value | Number | The value converted into default currency value |
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 which was used in order to convert the provided value into default currency value. |
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": 0.46000000834465027,
"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": ""
}
}