Skip to end of banner
Go to start of banner

GET currencies/convert_from_default_currency

Skip to end of metadata
Go to start of metadata

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)

NumberThe value in CRM.COM's default currency that will be converted into another currency's value

currency_identifier

(mandatory)

Currency IdentifierThe 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


NumberThe value in the default currency
converted_valueNumberThe converted value into the required currency
default_currencyCurrency ObjectCRM.COM's default currency as this is defined in General Settings
currency_period_rateCurrency Period Rate ObjectThe 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_symbolStringThe prefix symbol for the specified currency

suffix_symbol

StringThe suffix symbol for the specified currency
life_cycle_stateString

The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE

Available from CRM.COM R14.0.0

integer_part_nameStringThe integer part name for the specified currency
decimal_part_nameStringThe 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

rateNumberThe exchange rate of the currency rate period
inverse_rateNumberThe inverse exchange rate of the currency rate period
from_dateDateThe date from which the exchange rate is valid
to_dateDateThe date until which the exchange rate is valid
currencyCurrency ObjectThe 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_symbolStringThe prefix symbol for the specified currency

suffix_symbol

StringThe suffix symbol for the specified currency
life_cycle_stateString

The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE

Available from CRM.COM R14.0.0

integer_part_nameStringThe integer part name for the specified currency
decimal_part_nameStringThe 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": ""
  }
}
  • No labels