Skip to end of banner
Go to start of banner

GET currencies/convert_to_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_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)

NumberThe value that will be converted into CRM.COM default currency value

currency_identifier

(mandatory)

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


NumberThe value that was converted into CRM.COM default currency value
converted_valueNumberThe value converted into default currency value
default_currencyCurrency ObjectCRM.COM's default currency as this is defined in General Settings
currency_period_rateCurrency Period Rate ObjectThe 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_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": 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": ""
  }
}
  • No labels