Market for partners

<currencies>

The <currencies> element sets a list of the store's exchange rates. Each currency is described in a separate <currency> element.

Price data is accepted in rubles (RUR, RUB), hrivnas (UAH), Belarusian rubles (BYR), tenge (KZT), dollars (USD), and euros (EUR). Prices can be displayed on Market in rubles, hrivnas, Belarusian rubles, and tenge, depending on the user's region. If your YML file does not set the exchange rate for currencies that can be displayed, they use the exchange rates from the Central Bank of the country the user's region belongs to. The current day's exchange rate is applied. The exchange rate is updated daily at 00:00.

Example:

<currencies>
    <currency id="RUR" rate="1"/>
    <currency id="USD" rate="23.98"/>
    <currency id="EUR" rate="CBRF"/>
    <currency id="UAH" rate="NBU"/>
    <currency id="KZT" rate="CB"/>
</currencies>

The id parameter for the <currency> element specifies the code of one or several currencies that can be used in the YML file.

The rate parameter specifies the exchange rate with the rate of the main currency used as a unit (the currency for which rate="1"). The rate parameter can have the following values:

  • Constant number — The internal exchange rate that you use.

  • CBRF — Rate of the Central Bank of the Russian Federation.

  • NBU — Rate of the National Bank of Ukraine.

  • NBK — Rate of the National Bank of Kazakhstan.

  • СВ — Rate of the bank of the country the store belongs to according to the region specified in the Partner interface.

For the main currency (for which rate="1"), only rubles (RUR, RUB), Belarusian rubles (BYR), hrivnas (UAH) or tenges (KZT) can be used.

Example:

The rate of USD and EUR correspond to the rate of the National Bank of Ukraine.

<currencies>
    <currency id="UAH" rate="1"/>
    <currency id="USD" rate="NBU"/>
    <currency id="EUR" rate="NBU"/>
</currencies>

Example:

The rate of USD is the rate of the Central Bank of the Russian Federation + 3%.

<currencies>
    <currency id="RUR" rate="1"/>
    <currency id="USD" rate="CBRF" plus="3"/>
    <currency id="EUR" rate="CBRF" plus="3"/>
    ...
</currencies>

Example:

The rate of USD is the rate of the National Bank of Ukraine + 1%, but the rate or EUR is the rate of the NBU + 3%.

<currencies>
    <currency id="UAH" rate="1"/>
    <currency id="USD" rate="NBU" plus="1"/>
    <currency id="EUR" rate="NBU" plus="3"/>
    ...
</currencies>

If exchange rate values differ too much (more than 30%) from the rate of the CB RF or NBU, the data is considered invalid.

Attention! 

As a decimal separator, all numbers in YML regardless of regional settings use the dot (never the comma).

YML examples for Ukrainian stores:

The store passes prices in hrivnas.

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2009-05-19 16:02">
 
<shop>
    <name>Магазин</name>
    <company>Магазин</company>
    <url>www.magazin.ua</url>
    <currencies>
        <currency id="UAH" rate="1"/>
    </currencies>
    <categories>
   <category id="1">Вентиляторы</category>
    </categories>
    <offers>
 <offer id="111" type="vendor.model" available="true" bid="10">
 <url>http://www.magazin.ua/price.php?id=88521</url>
 <price>811.00</price>
 <currencyId>UAH</currencyId>
 <categoryId>1</categoryId>
 <typePrefix>Вентилятор</typePrefix>
 <vendor>UFO</vendor>
 <vendorCode>12345</vendorCode>
 <model>ATTFI-02</model>
 <description>Отличный вентилятор для домашнего использования.</description>
        </offer>
    </offers>
</shop>
</yml_catalog>

The store passes prices in dollars and uses an internal exchange rate of 7 hrivnas to one dollar.

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2009-05-19 16:02">
 
<shop>
    <name>Магазин</name>
    <company>Магазин</company>
    <url>www.magazin.ua</url>
    <currencies>
 <currency id="UAH" rate="1"/>
 <currency id="USD" rate="7"/>
    </currencies>
    <categories>
   <category id="1">вентиляторы</category>
 </categories>

    <offers>
 <offer id="111" type="vendor.model" available="true" bid="10">
 <url>http://www.magazin.ua/price.php?id=88521</url>
 <price>115.85</price>
 <currencyId>USD</currencyId>
 <categoryId>1</categoryId>
 <typePrefix>Вентилятор</typePrefix>
 <vendor>UFO</vendor>
 <vendorCode>12345</vendorCode>
 <model>ATTFI-02</model>
 <description>Отличный вентилятор для домашнего использования.</description>
        </offer>
    </offers>
</shop>
</yml_catalog>

Rate this article
Thank you for your feedback!